Skip to content

Commit 18a04f0

Browse files
authored
Polish and improve the UI (#2)
1 parent 4ab678d commit 18a04f0

File tree

97 files changed

+2263
-263
lines changed

Some content is hidden

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

97 files changed

+2263
-263
lines changed

.dockerignore

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
### Dependencies and Caches
2+
/node_modules/
3+
/.npm/
4+
/.pnpm-store/
5+
/.eslintcache
6+
.yarn/*
7+
!.yarn/patches
8+
!.yarn/plugins
9+
!.yarn/releases
10+
!.yarn/sdks
11+
!.yarn/versions
12+
.yarnrc
13+
.yarnrc.yml
14+
15+
### Build and Runtime Artifacts
16+
/dist/
17+
/build/
18+
/out/
19+
/tmp/
20+
*.tsbuildinfo
21+
*.pid
22+
*.pid.lock
23+
24+
### Logs and Test Reports
25+
/logs/
26+
*.log
27+
npm-debug.log*
28+
yarn-debug.log*
29+
yarn-error.log*
30+
pnpm-debug.log*
31+
/coverage/
32+
/.nyc_output/
33+
junit.xml
34+
coverage-final.json
35+
36+
### Environment Variables
37+
.env
38+
.env.*
39+
!.env.example
40+
.envrc
41+
/.direnv/
42+
43+
### IDE, Editor, and System Files
44+
/.vscode/
45+
/.idea/
46+
/.fleet/
47+
/.history/
48+
*.iml
49+
nodemon.json
50+
.DS_Store
51+
Thumbs.db
52+
*~
53+
*.swp
54+
*.swo
55+
56+
### Auxiliary Tooling Artifacts
57+
/__pycache__/
58+
*.py[cod]
59+
/.pytest_cache/
60+
/.mypy_cache/
61+
/.venv/
62+
/venv/
63+
/.tox/
64+
*.out
65+
*.o
66+
*.obj
67+
*.so
68+
*.a
69+
*.dll
70+
*.exe
71+
72+
### Project-Specific Ignores
73+
pyproject.toml
74+
.pre-commit-config.yaml
75+
README.md
76+
ROADMAP.md
77+
LICENSE
78+
CODE_OF_CONDUCT.md
79+
CONTRIBUTING.md
80+
BINHARIC.md
81+
AGENT.md
82+
/docs/
83+
/tests/
84+
vitest.config.ts
85+
tsconfig.spec.json
86+
*.png
87+
*.jpg
88+
*.jpeg
89+
*.gif
90+
*.ico
91+
*.svg

.github/workflows/lints.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ on:
66
branches:
77
- main
88
push:
9-
branches:
10-
- main
119
tags:
1210
- "v*"
1311

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Publish Docker Image to GHCR
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
call_tests:
19+
uses: ./.github/workflows/tests.yml
20+
21+
build-and-push:
22+
runs-on: ubuntu-latest
23+
needs: call_tests
24+
permissions:
25+
contents: read
26+
packages: write
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v3
33+
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v3
36+
37+
- name: Log in to GHCR
38+
uses: docker/login-action@v3
39+
with:
40+
registry: ghcr.io
41+
username: ${{ github.repository_owner }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Extract Docker Metadata
45+
id: meta
46+
uses: docker/metadata-action@v5
47+
with:
48+
images: |
49+
ghcr.io/${{ github.repository }}
50+
tags: |
51+
type=ref,event=branch
52+
type=semver,pattern={{version}}
53+
type=semver,pattern={{major}}.{{minor}}
54+
type=raw,value=latest,enable={{is_default_branch}}
55+
56+
- name: Set Fallback Tag (latest)
57+
id: fallback
58+
run: |
59+
if [ -z "${{ steps.meta.outputs.tags }}" ]; then
60+
echo "tags=ghcr.io/${{ github.repository }}:latest" >> $GITHUB_OUTPUT
61+
else
62+
first_tag=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
63+
echo "tags=${first_tag}" >> $GITHUB_OUTPUT
64+
fi
65+
66+
- name: Build and Push
67+
uses: docker/build-push-action@v6
68+
with:
69+
context: .
70+
file: ./Dockerfile
71+
platforms: linux/amd64,linux/arm64
72+
push: true
73+
tags: ${{ steps.fallback.outputs.tags }}
74+
labels: ${{ steps.meta.outputs.labels }}
75+
cache-from: type=gha
76+
cache-to: type=gha,mode=max
77+
provenance: false

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# --- Build Stage ---
2+
FROM node:20-alpine AS builder
3+
WORKDIR /app
4+
COPY package*.json ./
5+
6+
# Install dependencies, ignoring peer conflicts
7+
RUN npm ci --legacy-peer-deps
8+
COPY tsconfig.json ./
9+
COPY src ./src
10+
11+
# Build the application
12+
RUN npm run build
13+
14+
# --- Runtime Stage ---
15+
FROM node:20-alpine AS runtime
16+
RUN apk add --no-cache bash
17+
WORKDIR /app
18+
ENV NODE_ENV=production
19+
COPY package*.json ./
20+
21+
# Install production dependencies only
22+
RUN npm ci --omit=dev --legacy-peer-deps
23+
24+
# Copy built application from the build stage
25+
COPY --from=builder /app/dist ./dist
26+
27+
# Set the container's entrypoint
28+
ENTRYPOINT ["node","dist/cli.js"]

Makefile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
PACKAGE_MANAGER ?= npm
55
NODE_MODULES_DIR ?= node_modules
66
REMOVABLE_THINGS ?= .vitest-cache coverage site
7+
DOCKER_IMAGE_NAME ?= binharic-cli
8+
DOCKER_IMAGE_TAG ?= latest
9+
DOCKER_CONTAINER_ARGS ?=
710

811
# ==============================================================================
912
# SETUP & CHECKS
@@ -22,7 +25,8 @@ check-deps:
2225

2326
# Declare all targets as phony (not files)
2427
.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
28+
test-hooks npm-login npm-whoami pack pack-dry-run publish publish-dry-run version-patch version-minor version-major \
29+
docker-image docker-run
2630

2731
.DEFAULT_GOAL := help
2832

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

8690
# ==============================================================================
87-
# PUBLISHING
91+
# PUBLISHING TO NPM
8892
# ==============================================================================
8993
npm-login: ## Log in to npm registry
9094
@$(PACKAGE_MANAGER) login
@@ -112,3 +116,15 @@ version-minor: ## Bump minor version (x.y.z -> x.(y+1).0)
112116

113117
version-major: ## Bump major version ((x+1).0.0)
114118
@$(PACKAGE_MANAGER) version major
119+
120+
# ==============================================================================
121+
# DOCKER
122+
# ==============================================================================
123+
124+
docker-image: ## Build the Docker image
125+
@echo "Building Docker image: $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)"
126+
@docker build -t $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) .
127+
128+
docker-run: ## Run the application in a Docker container
129+
@echo "Running Docker image: $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) with args: $(DOCKER_CONTAINER_ARGS)"
130+
@docker run --rm -it $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) $(DOCKER_CONTAINER_ARGS)

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ like the ability to analyze projects, run tests, find bugs, and perform code rev
3636
- Can use models from OpenAI, Google, Anthropic, and Ollama
3737
- Is fully customizable (like customizing system prompt)
3838
- Comes with a built-in retrieval-augmented generation (RAG) pipeline
39-
- Comes with a large set of built-in tools (like reading and writing files); can use external tools via MCP
39+
- Comes with a large set of built-in tools (like reading and writing files)
40+
- Can use external tools via Model Context Protocol (MCP)
4041
- Comes with built-in workflows for standard software development tasks (like debugging and code review)
4142

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

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

75+
> [!NOTE]
76+
> The performance of a coding agent like Binharic, to a great extent, depends on the model it uses.
77+
> 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
78+
> results.
79+
7480
---
7581

7682
#### Documentation

ROADMAP.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ It includes planned features, improvements, and their current implementation sta
103103
- [x] File search with @ mention
104104
- [x] Non-blocking UI during LLM responses
105105
- [x] Command syntax highlighting (partial match in yellow, full match in cyan)
106-
- [x] Colored help menu items\*\*
106+
- [x] Colored help menu items**
107107
- [x] Clean message display (no "Binharic:" prefix)
108108
- [x] Dynamic username from system (not hardcoded)
109109
- [x] Tool results hidden from UI (only failures shown)
@@ -117,6 +117,7 @@ It includes planned features, improvements, and their current implementation sta
117117
- [x] Git branch display
118118
- [x] Responsive input field (non-blocking)
119119
- [x] Clear error messages for tool failures
120+
- [x] Exit summary screen on quit (session ID, tool calls, success rate, timings, model usage)
120121
- [ ] Progress bars for long operations
121122
- [ ] Notification system
122123
- [ ] Undo/redo for file operations
@@ -154,6 +155,7 @@ It includes planned features, improvements, and their current implementation sta
154155
- [x] Tool execution timeout protection (10 seconds for autofix)
155156
- [ ] Error recovery suggestions
156157
- [ ] Automatic error reporting (opt-in)
158+
- [ ] Configurable stderr suppression via env flag (planned)
157159
- **Optimization**
158160
- [x] Efficient token counting
159161
- [x] Context window optimization
@@ -169,7 +171,8 @@ It includes planned features, improvements, and their current implementation sta
169171
- [x] Provider availability checks
170172
- [x] Detailed tool execution logging
171173
- [x] Autofix attempt tracking
172-
- [ ] Performance metrics collection
174+
- [x] Basic session metrics rendered on exit (LLM API time, tool time, request counts)
175+
- [ ] Persistent performance metrics collection
173176
- [ ] Usage analytics (tokens, costs)
174177
- [ ] Health checks and diagnostics
175178

@@ -205,6 +208,7 @@ It includes planned features, improvements, and their current implementation sta
205208
- [ ] Comprehensive user guide
206209
- [ ] Video tutorials
207210
- [ ] FAQ section
211+
- [ ] Docker/Container usage guide (planned)
208212
- **Developer Documentation**
209213
- [x] Code of conduct
210214
- [x] Architecture documentation
@@ -218,14 +222,18 @@ It includes planned features, improvements, and their current implementation sta
218222
- **Package Management**
219223
- [x] NPM package structure
220224
- [x] TypeScript compilation
221-
- [ ] NPM registry publication
222-
- [ ] Semantic versioning
223-
- [ ] Release automation
225+
- [x] NPM registry publication
226+
- [x] Semantic versioning (via git tags)
227+
- [x] Release automation (GitHub Actions: npm + GHCR)
224228
- **Installation Methods**
225229
- [ ] Homebrew formula (macOS)
226230
- [ ] Snap package (Linux)
227231
- [ ] Chocolatey package (Windows)
228-
- [ ] Docker image
232+
- [x] Docker image
233+
- Published to GitHub Container Registry: `ghcr.io/<owner>/<repo>`
234+
- Multi-arch builds (linux/amd64, linux/arm64) via Buildx
235+
- Makefile targets for local and CI builds/pushes
236+
- Optimized build context via comprehensive `.dockerignore`
229237
- [ ] Standalone binary releases
230238
- **Cloud and Remote**
231239
- [ ] Remote execution support
@@ -242,7 +250,7 @@ It includes planned features, improvements, and their current implementation sta
242250
- [x] Multi-step tool execution with automatic loop control
243251
- [x] Specialized agents with distinct personalities
244252
- [ ] onStepFinish callbacks for monitoring
245-
- [ ] prepareStep callbacks for dynamic configuration\*\*
253+
- [ ] prepareStep callbacks for dynamic configuration**
246254
- [ ] Multiple stopping conditions (step count, budget, errors, validation, completion)
247255
- [ ] Goal-oriented planning
248256
- [ ] Task decomposition

0 commit comments

Comments
 (0)