Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
### Dependencies and Caches
/node_modules/
/.npm/
/.pnpm-store/
/.eslintcache
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.yarnrc
.yarnrc.yml

### Build and Runtime Artifacts
/dist/
/build/
/out/
/tmp/
*.tsbuildinfo
*.pid
*.pid.lock

### Logs and Test Reports
/logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
/coverage/
/.nyc_output/
junit.xml
coverage-final.json

### Environment Variables
.env
.env.*
!.env.example
.envrc
/.direnv/

### IDE, Editor, and System Files
/.vscode/
/.idea/
/.fleet/
/.history/
*.iml
nodemon.json
.DS_Store
Thumbs.db
*~
*.swp
*.swo

### Auxiliary Tooling Artifacts
/__pycache__/
*.py[cod]
/.pytest_cache/
/.mypy_cache/
/.venv/
/venv/
/.tox/
*.out
*.o
*.obj
*.so
*.a
*.dll
*.exe

### Project-Specific Ignores
pyproject.toml
.pre-commit-config.yaml
README.md
ROADMAP.md
LICENSE
CODE_OF_CONDUCT.md
CONTRIBUTING.md
BINHARIC.md
AGENT.md
/docs/
/tests/
vitest.config.ts
tsconfig.spec.json
*.png
*.jpg
*.jpeg
*.gif
*.ico
*.svg
2 changes: 0 additions & 2 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
branches:
- main
push:
branches:
- main
tags:
- "v*"

Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Publish Docker Image to GHCR

on:
workflow_dispatch:
push:
tags:
- "v*"

permissions:
contents: read
packages: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
call_tests:
uses: ./.github/workflows/tests.yml

build-and-push:
runs-on: ubuntu-latest
needs: call_tests
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}

- name: Set Fallback Tag (latest)
id: fallback
run: |
if [ -z "${{ steps.meta.outputs.tags }}" ]; then
echo "tags=ghcr.io/${{ github.repository }}:latest" >> $GITHUB_OUTPUT
else
first_tag=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
echo "tags=${first_tag}" >> $GITHUB_OUTPUT
fi

- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.fallback.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# --- Build Stage ---
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./

# Install dependencies, ignoring peer conflicts
RUN npm ci --legacy-peer-deps
COPY tsconfig.json ./
COPY src ./src

# Build the application
RUN npm run build

# --- Runtime Stage ---
FROM node:20-alpine AS runtime
RUN apk add --no-cache bash
WORKDIR /app
ENV NODE_ENV=production
COPY package*.json ./

# Install production dependencies only
RUN npm ci --omit=dev --legacy-peer-deps

# Copy built application from the build stage
COPY --from=builder /app/dist ./dist

# Set the container's entrypoint
ENTRYPOINT ["node","dist/cli.js"]
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
PACKAGE_MANAGER ?= npm
NODE_MODULES_DIR ?= node_modules
REMOVABLE_THINGS ?= .vitest-cache coverage site
DOCKER_IMAGE_NAME ?= binharic-cli
DOCKER_IMAGE_TAG ?= latest
DOCKER_CONTAINER_ARGS ?=

# ==============================================================================
# SETUP & CHECKS
Expand All @@ -22,7 +25,8 @@ check-deps:

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

.DEFAULT_GOAL := help

Expand Down Expand Up @@ -84,7 +88,7 @@ test-hooks: ## Test Git hooks on all files
@pre-commit run --all-files --show-diff-on-failure

# ==============================================================================
# PUBLISHING
# PUBLISHING TO NPM
# ==============================================================================
npm-login: ## Log in to npm registry
@$(PACKAGE_MANAGER) login
Expand Down Expand Up @@ -112,3 +116,15 @@ version-minor: ## Bump minor version (x.y.z -> x.(y+1).0)

version-major: ## Bump major version ((x+1).0.0)
@$(PACKAGE_MANAGER) version major

# ==============================================================================
# DOCKER
# ==============================================================================

docker-image: ## Build the Docker image
@echo "Building Docker image: $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)"
@docker build -t $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) .

docker-run: ## Run the application in a Docker container
@echo "Running Docker image: $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) with args: $(DOCKER_CONTAINER_ARGS)"
@docker run --rm -it $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) $(DOCKER_CONTAINER_ARGS)
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ like the ability to analyze projects, run tests, find bugs, and perform code rev
- Can use models from OpenAI, Google, Anthropic, and Ollama
- Is fully customizable (like customizing system prompt)
- Comes with a built-in retrieval-augmented generation (RAG) pipeline
- Comes with a large set of built-in tools (like reading and writing files); can use external tools via MCP
- Comes with a large set of built-in tools (like reading and writing files)
- Can use external tools via Model Context Protocol (MCP)
- Comes with built-in workflows for standard software development tasks (like debugging and code review)

See the [ROADMAP.md](ROADMAP.md) for the list of implemented and planned features.
Expand Down Expand Up @@ -71,6 +72,11 @@ binharic

[![asciicast](https://asciinema.org/a/vDae95b1lm20X7HGSlcVe3M6C.svg)](https://asciinema.org/a/vDae95b1lm20X7HGSlcVe3M6C)

> [!NOTE]
> The performance of a coding agent like Binharic, to a great extent, depends on the model it uses.
> So, it's recommended to use state-of-the-art models (like Claude Sonnet 4.5, GPT-5, and Gemini 2.5 Pro) for the best
> results.

---

#### Documentation
Expand Down
22 changes: 15 additions & 7 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ It includes planned features, improvements, and their current implementation sta
- [x] File search with @ mention
- [x] Non-blocking UI during LLM responses
- [x] Command syntax highlighting (partial match in yellow, full match in cyan)
- [x] Colored help menu items\*\*
- [x] Colored help menu items**
- [x] Clean message display (no "Binharic:" prefix)
- [x] Dynamic username from system (not hardcoded)
- [x] Tool results hidden from UI (only failures shown)
Expand All @@ -117,6 +117,7 @@ It includes planned features, improvements, and their current implementation sta
- [x] Git branch display
- [x] Responsive input field (non-blocking)
- [x] Clear error messages for tool failures
- [x] Exit summary screen on quit (session ID, tool calls, success rate, timings, model usage)
- [ ] Progress bars for long operations
- [ ] Notification system
- [ ] Undo/redo for file operations
Expand Down Expand Up @@ -154,6 +155,7 @@ It includes planned features, improvements, and their current implementation sta
- [x] Tool execution timeout protection (10 seconds for autofix)
- [ ] Error recovery suggestions
- [ ] Automatic error reporting (opt-in)
- [ ] Configurable stderr suppression via env flag (planned)
- **Optimization**
- [x] Efficient token counting
- [x] Context window optimization
Expand All @@ -169,7 +171,8 @@ It includes planned features, improvements, and their current implementation sta
- [x] Provider availability checks
- [x] Detailed tool execution logging
- [x] Autofix attempt tracking
- [ ] Performance metrics collection
- [x] Basic session metrics rendered on exit (LLM API time, tool time, request counts)
- [ ] Persistent performance metrics collection
- [ ] Usage analytics (tokens, costs)
- [ ] Health checks and diagnostics

Expand Down Expand Up @@ -205,6 +208,7 @@ It includes planned features, improvements, and their current implementation sta
- [ ] Comprehensive user guide
- [ ] Video tutorials
- [ ] FAQ section
- [ ] Docker/Container usage guide (planned)
- **Developer Documentation**
- [x] Code of conduct
- [x] Architecture documentation
Expand All @@ -218,14 +222,18 @@ It includes planned features, improvements, and their current implementation sta
- **Package Management**
- [x] NPM package structure
- [x] TypeScript compilation
- [ ] NPM registry publication
- [ ] Semantic versioning
- [ ] Release automation
- [x] NPM registry publication
- [x] Semantic versioning (via git tags)
- [x] Release automation (GitHub Actions: npm + GHCR)
- **Installation Methods**
- [ ] Homebrew formula (macOS)
- [ ] Snap package (Linux)
- [ ] Chocolatey package (Windows)
- [ ] Docker image
- [x] Docker image
- Published to GitHub Container Registry: `ghcr.io/<owner>/<repo>`
- Multi-arch builds (linux/amd64, linux/arm64) via Buildx
- Makefile targets for local and CI builds/pushes
- Optimized build context via comprehensive `.dockerignore`
- [ ] Standalone binary releases
- **Cloud and Remote**
- [ ] Remote execution support
Expand All @@ -242,7 +250,7 @@ It includes planned features, improvements, and their current implementation sta
- [x] Multi-step tool execution with automatic loop control
- [x] Specialized agents with distinct personalities
- [ ] onStepFinish callbacks for monitoring
- [ ] prepareStep callbacks for dynamic configuration\*\*
- [ ] prepareStep callbacks for dynamic configuration**
- [ ] Multiple stopping conditions (step count, budget, errors, validation, completion)
- [ ] Goal-oriented planning
- [ ] Task decomposition
Expand Down
Loading
Loading