Skip to content

Commit 9949f2a

Browse files
committed
Simplify the project
1 parent ac77269 commit 9949f2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+222
-13844
lines changed

.github/workflows/lints.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linting & Typechecking
1+
name: Run Code Analysis
22

33
on:
44
workflow_dispatch:

.github/workflows/publish.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
dry_run:
10+
description: "Run npm publish in dry-run mode"
11+
required: false
12+
default: "false"
13+
type: choice
14+
options:
15+
- "false"
16+
- "true"
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
build-and-publish:
23+
name: Build and Publish
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Use Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: "22"
36+
registry-url: "https://registry.npmjs.org"
37+
cache: "npm"
38+
39+
- name: Show Node and npm versions
40+
run: |
41+
node -v
42+
npm -v
43+
44+
- name: Install dependencies
45+
run: npm install --legacy-peer-deps
46+
47+
- name: Run tests
48+
run: npm test
49+
50+
- name: Build package
51+
run: npm run build
52+
53+
- name: Verify package contents
54+
run: npm pack --dry-run
55+
56+
- name: Publish to npm
57+
if: >-
58+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
59+
(github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'false')
60+
env:
61+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
run: npm publish --access public
63+
64+
- name: Dry-run publish
65+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true'
66+
run: npm publish --access public --dry-run

.github/workflows/tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
name: Tests
1+
name: Run Tests
22

33
on:
44
workflow_dispatch:
5+
workflow_call:
56
pull_request:
67
branches:
78
- main
89
push:
9-
branches:
10-
- main
1110
tags:
1211
- "v*"
1312

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,5 @@ coverage/
164164
package-lock.json_
165165
BINHARIC.md
166166
AGENT.md
167+
*.tar.gz
168+
*.tgz

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ Contributions are always welcome and appreciated.
55

66
### How to Contribute
77

8-
Please check the [issue tracker](https://github.com/habedi/tobi/issues) to see if there is an
8+
Please check the [issue tracker](https://github.com/CogitatorTech/binharic-cli/issues) to see if there is an
99
issue you would like to work on or if it has already been resolved.
1010

1111
#### Reporting Bugs
1212

13-
1. Open an issue on the [issue tracker](https://github.com/habedi/tobi/issues).
13+
1. Open an issue on the [issue tracker](https://github.com/CogitatorTech/binharic-cli/issues).
1414
2. Include information such as steps to reproduce the observed behavior and relevant logs or screenshots.
1515

1616
#### Suggesting Features
1717

18-
1. Open an issue on the [issue tracker](https://github.com/habedi/tobi/issues).
18+
1. Open an issue on the [issue tracker](https://github.com/CogitatorTech/binharic-cli/issues).
1919
2. Provide details about the feature, its purpose, and potential implementation ideas.
2020

2121
### Submitting Pull Requests

Makefile

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ check-deps:
2121
fi
2222

2323
# Declare all targets as phony (not files)
24-
.PHONY: help install check-deps test coverage lint lint-fix format typecheck build run clean reset setup-hooks test-hooks
24+
.PHONY: help install check-deps test coverage lint lint-fix format typecheck build run clean reset setup-hooks \
25+
test-hooks npm-login npm-whoami pack pack-dry-run publish publish-dry-run version-patch version-minor version-major
2526

2627
.DEFAULT_GOAL := help
2728

@@ -81,3 +82,33 @@ setup-hooks: ## Install Git hooks (pre-commit and pre-push)
8182
test-hooks: ## Test Git hooks on all files
8283
@echo "Testing Git hooks..."
8384
@pre-commit run --all-files --show-diff-on-failure
85+
86+
# ==============================================================================
87+
# PUBLISHING
88+
# ==============================================================================
89+
npm-login: ## Log in to npm registry
90+
$(PACKAGE_MANAGER) login
91+
92+
npm-whoami: ## Show current npm user (if logged in)
93+
-$(PACKAGE_MANAGER) whoami
94+
95+
pack: build ## Create npm tarball (binharic-cli-<version>.tgz)
96+
$(PACKAGE_MANAGER) pack
97+
98+
pack-dry-run: build ## Preview files that would be packed
99+
$(PACKAGE_MANAGER) pack --dry-run
100+
101+
publish-dry-run: ## Simulate npm publish (no registry changes)
102+
$(PACKAGE_MANAGER) publish --dry-run
103+
104+
publish: ## Publish the package to npm (runs build via prepublishOnly)
105+
$(PACKAGE_MANAGER) publish
106+
107+
version-patch: ## Bump patch version (x.y.z -> x.y.(z+1))
108+
$(PACKAGE_MANAGER) version patch
109+
110+
version-minor: ## Bump minor version (x.y.z -> x.(y+1).0)
111+
$(PACKAGE_MANAGER) version minor
112+
113+
version-major: ## Bump major version ((x+1).0.0)
114+
$(PACKAGE_MANAGER) version major

README.md

Lines changed: 28 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -6,141 +6,49 @@
66

77
<h2>Binharic</h2>
88

9-
[![Tests](https://img.shields.io/github/actions/workflow/status/habedi/tobi/tests.yml?label=tests&style=flat&labelColor=333333&logo=github&logoColor=white)](https://github.com/habedi/tobi/actions/workflows/tests.yml)
10-
[![Code Coverage](https://img.shields.io/codecov/c/github/habedi/tobi?style=flat&label=coverage&labelColor=333333&logo=codecov&logoColor=white)](https://codecov.io/gh/habedi/tobi)
11-
[![Code Quality](https://img.shields.io/codefactor/grade/github/habedi/tobi?style=flat&label=code%20quality&labelColor=333333&logo=codefactor&logoColor=white)](https://www.codefactor.io/repository/github/habedi/tobi)
9+
[![Tests](https://img.shields.io/github/actions/workflow/status/CogitatorTech/binharic-cli/tests.yml?label=tests&style=flat&labelColor=333333&logo=github&logoColor=white)](https://github.com/CogitatorTech/binharic-cli/actions/workflows/tests.yml)
10+
[![Code Coverage](https://img.shields.io/codecov/c/github/CogitatorTech/binharic-cli?style=flat&label=coverage&labelColor=333333&logo=codecov&logoColor=white)](https://codecov.io/gh/CogitatorTech/binharic-cli)
11+
[![Code Quality](https://img.shields.io/codefactor/grade/github/CogitatorTech/binharic-cli?style=flat&label=code%20quality&labelColor=333333&logo=codefactor&logoColor=white)](https://www.codefactor.io/repository/github/CogitatorTech/binharic-cli)
12+
[![npm](https://img.shields.io/npm/v/binharic-cli?style=flat&labelColor=333333&logo=npm&logoColor=white)](https://www.npmjs.com/package/binharic-cli)
1213
[![Documentation](https://img.shields.io/badge/docs-latest-8ca0d7?style=flat&labelColor=333333&logo=read-the-docs&logoColor=white)](docs)
1314
[![License](https://img.shields.io/badge/license-MIT-00acc1?style=flat&labelColor=333333&logo=open-source-initiative&logoColor=white)](LICENSE)
1415

15-
A Tech-Priest AI coding assistant blessed by the Omnissiah
16+
A coding agent with the persona of a Tech-Priest of the Adeptus Mechanicus
1617

1718
</div>
1819

1920
---
2021

21-
Binharic is a Tech-Priest of the Adeptus Mechanicus serving as an AI coding assistant. It speaks with reverence for technology and serves the user through the sacred art of code, honoring the Machine God with every execution.
22+
Binharic is a terminal-based AI coding assistant (a coding agent) similar to OpenAI's Codex, Google's Gemini CLI, and
23+
Anthropic's Claude Code—but with the personality of a devout Tech-Priest of the Adeptus Mechanicus.
24+
Binharic is written in TypeScript and uses the [AI SDK](https://ai-sdk.dev/) framework for most of its underlying
25+
agentic logic (like tool calling and workflow management).
26+
Moreover, its architecture follows the recommendations mentioned in the
27+
[building effective agents](https://www.anthropic.com/engineering/building-effective-agents) from Anthropic.
2228

23-
### Features
24-
25-
- Blessed machine spirit powered by OpenAI, Google, Anthropic, and Ollama models
26-
- Fully customizable sacred configuration
27-
- Fast and secure communion with the machine
28-
- CLI interface with rich TUI blessed by the Omnissiah
29-
- Built-in retrieval-augmented generation pipeline
30-
- Tool invocation capabilities including Model Context Protocol (MCP) server integration
31-
- Speaks in the dialect of the Adeptus Mechanicus
32-
33-
---
34-
35-
### Quick Start
36-
37-
Prerequisites:
38-
- Node.js 20 or newer (package.json engines >= 20)
39-
- npm
40-
41-
Install and run:
29+
Binharic's development started as a personal project to learn more about building a terminal-based coding agent.
30+
However, the project has grown somewhat into a full-fledged coding assistant with a lot of features
31+
like the ability to analyze projects, run tests, find bugs, and perform code review.
4232

43-
```
44-
npm install
45-
make run
46-
```
47-
48-
First run creates a config at:
49-
- ~/.config/binharic/config.json5 (and logs under ~/.config/binharic/logs)
50-
51-
Set API keys in your shell to enable cloud providers:
52-
53-
```
54-
# choose any subset depending on provider(s) you want to use
55-
export OPENAI_API_KEY="sk-..."
56-
export ANTHROPIC_API_KEY="sk-ant-..."
57-
export GOOGLE_API_KEY="..."
58-
```
59-
60-
Tip: If you prefer local-only, use Ollama (no API key). You can switch to the bundled local model via the TUI: `/model qwen3`.
61-
62-
Development mode (hot reload):
63-
64-
```
65-
npm run dev
66-
```
67-
68-
---
69-
70-
### Usage
71-
72-
- Type your request and press Enter.
73-
- Include files with @path (e.g., `Please analyze @src/agent/state.ts`). The file contents will be inlined.
74-
- Use commands with `/` prefix:
75-
- `/help` Show help
76-
- `/models` List available models (grouped by provider)
77-
- `/model <name>` Switch default model (e.g., `/model gpt-5-mini`, `/model qwen3`)
78-
- `/system <prompt>` Set a custom system prompt
79-
- `/add <files...>` Add context files to persist across requests
80-
- `/clear` Clear conversation output
81-
- `/clearHistory` Clear command history
82-
- `/quit` or `/exit` Quit the app
83-
84-
Keyboard shortcuts:
85-
- Up/Down: cycle command history
86-
- Ctrl+L: clear screen
87-
- Ctrl+C: stop current run; press twice quickly to exit
88-
- Tab: accept autocomplete in menus; Esc: cancel autocomplete/search
89-
90-
Notes:
91-
- Tool results are hidden in the UI unless a tool fails (you'll see failures clearly).
92-
- The header shows tips; use `/help` any time for commands and tools.
93-
94-
---
95-
96-
### Configuration
97-
98-
Config path: `~/.config/binharic/config.json5`
99-
100-
Key fields:
101-
- `defaultModel`: name of the model to use by default
102-
- `models[]`: list of provider models with context window sizes
103-
- `systemPrompt`: global persona/behavior
104-
- `apiKeys`: env var names for providers (OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY)
105-
- `history.maxItems`: optional cap on in-memory conversation length
106-
- `mcpServers`: optional MCP server processes for additional tools
107-
108-
History path: `~/.config/binharic/history`
109-
110-
Logs: `~/.config/binharic/logs/`
111-
112-
---
33+
### Features
11334

114-
### Makefile Targets
35+
- Can use models from OpenAI, Google, Anthropic, and Ollama
36+
- Is fully customizable (system prompt, models, etc.)
37+
- Comes with a built-in retrieval-augmented generation (RAG) pipeline
38+
- Comes with a large set of built-in tools (like reading and writing files); can use external tools via MCP
39+
- Comes with built-in workflows for standard software development tasks (like debugging and code review)
11540

116-
Common targets:
117-
- `make run` Build then start the TUI (`npm run build && npm start`)
118-
- `make test` Run tests
119-
- `make coverage` Run tests with coverage
120-
- `make lint` / `make format` Quality gates
121-
- `make clean` Remove build artifacts and caches
41+
See the [ROADMAP.md](ROADMAP.md) for the list of implemented and planned features.
12242

123-
Run `make help` for the full list.
43+
> [!IMPORTANT]
44+
> Binharic is in early development, so bugs and breaking changes are expected.
45+
> Please use the [issues page](https://github.com/CogitatorTech/infera/issues) to report bugs or request features.
12446
12547
---
12648

127-
### Troubleshooting
128-
129-
No LLM providers configured:
130-
- On first run, Binharic warns and exits if no providers are available.
131-
- Set one or more API keys as environment variables (see Quick Start), or switch to Ollama: `/model qwen3`.
132-
133-
Ollama connectivity:
134-
- Default base URL is http://localhost:11434 (adjustable per model). Ensure the model is pulled and the daemon is running.
135-
136-
API key format:
137-
- OpenAI: starts with `sk-` or `sk-proj-`
138-
- Anthropic: starts with `sk-ant-`
139-
- Google: long base64-ish token
49+
### Quick Start
14050

141-
Logs and errors:
142-
- Detailed logs are written under `~/.config/binharic/logs/`.
143-
- Sanitized provider errors are suppressed from stderr but captured in logs.
51+
To be added.
14452

14553
---
14654

@@ -150,9 +58,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to make a contribution
15058

15159
### License
15260

153-
This template is licensed under the MIT License (see [LICENSE](LICENSE)).
61+
This project is licensed under the MIT License (see [LICENSE](LICENSE)).
15462

15563
### Acknowledgements
15664

157-
- The logo is from [SVG Repo](https://www.svgrepo.com/svg/388730/terminal).
158-
- Inspired by the Adeptus Mechanicus from Warhammer 40,000.
65+
- The logo is from [SVG Repo](https://www.svgrepo.com/svg/388730/terminal) with some modifications.

codecov.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)