Skip to content

Commit fbf1e0e

Browse files
authored
Fix a bunch of bugs (#3)
1 parent 18a04f0 commit fbf1e0e

35 files changed

+3176
-933
lines changed

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ RUN npm run build
1313

1414
# --- Runtime Stage ---
1515
FROM node:20-alpine AS runtime
16-
RUN apk add --no-cache bash
16+
RUN apk add --no-cache bash git
1717
WORKDIR /app
1818
ENV NODE_ENV=production
19+
1920
COPY package*.json ./
2021

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

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

27-
# Set the container's entrypoint
28-
ENTRYPOINT ["node","dist/cli.js"]
26+
ENV TERM=xterm-256color
27+
28+
ENTRYPOINT ["node", "dist/cli.js"]
29+
CMD []

Makefile

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,32 @@ docker-image: ## Build the Docker image
127127

128128
docker-run: ## Run the application in a Docker container
129129
@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)
130+
@docker run --rm -it \
131+
-v $(PWD):/workspace \
132+
-w /workspace \
133+
-e OPENAI_API_KEY \
134+
-e ANTHROPIC_API_KEY \
135+
-e GOOGLE_API_KEY \
136+
$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) $(DOCKER_CONTAINER_ARGS)
137+
138+
docker-run-local: ## Run with local config and workspace mounted
139+
@echo "Running Docker with local config and workspace"
140+
@docker run --rm -it \
141+
-v $(PWD):/workspace \
142+
-v $(HOME)/.config/binharic:/root/.config/binharic \
143+
-w /workspace \
144+
-e OPENAI_API_KEY \
145+
-e ANTHROPIC_API_KEY \
146+
-e GOOGLE_API_KEY \
147+
$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) $(DOCKER_CONTAINER_ARGS)
148+
149+
docker-shell: ## Open a shell in the Docker container for debugging
150+
@echo "Opening shell in Docker container"
151+
@docker run --rm -it \
152+
-v $(PWD):/workspace \
153+
-w /workspace \
154+
-e OPENAI_API_KEY \
155+
-e ANTHROPIC_API_KEY \
156+
-e GOOGLE_API_KEY \
157+
--entrypoint /bin/bash \
158+
$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ like the ability to analyze projects, run tests, find bugs, and perform code rev
3737
- Is fully customizable (like customizing system prompt)
3838
- Comes with a built-in retrieval-augmented generation (RAG) pipeline
3939
- Comes with a large set of built-in tools (like reading and writing files)
40-
- Can use external tools via Model Context Protocol (MCP)
40+
- Can use external tools via the Model Context Protocol (MCP)
4141
- Comes with built-in workflows for standard software development tasks (like debugging and code review)
4242

4343
See the [ROADMAP.md](ROADMAP.md) for the list of implemented and planned features.
@@ -58,7 +58,7 @@ You can follow the instructions below to install and use Binharic in your termin
5858
npm install -g @cogitator/binharic-cli
5959
```
6060

61-
#### Usage
61+
#### Running in the Terminal
6262

6363
```sh
6464
# Make sure API keys are available in the environment
@@ -77,11 +77,29 @@ binharic
7777
> 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
7878
> results.
7979
80+
#### Running in a Container
81+
82+
Alternatively, you can start Binharic in a container:
83+
84+
```sh
85+
# API keys should be available in the environment already
86+
docker run -it --rm \
87+
-v $(PWD):/workspace \
88+
-w /workspace \
89+
-e OPENAI_API_KEY \
90+
-e ANTHROPIC_API_KEY \
91+
-e GOOGLE_API_KEY \
92+
ghcr.io/cogitatortech/binharic-cli:<version>
93+
```
94+
95+
`<version>` should be replaced with the version of the Binharic (like `0.1.0-alpha.4`) or `latest`.
96+
Use `latest` if you want to use the latest (development) version of Binharic.
97+
8098
---
8199

82-
#### Documentation
100+
### Documentation
83101

84-
See the [docs](docs) for more information on how to use Binharic coding agent.
102+
See the [docs](docs) for more information on how to use the Binharic coding agent.
85103

86104
---
87105

ROADMAP.md

Lines changed: 2 additions & 2 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)
@@ -250,7 +250,7 @@ It includes planned features, improvements, and their current implementation sta
250250
- [x] Multi-step tool execution with automatic loop control
251251
- [x] Specialized agents with distinct personalities
252252
- [ ] onStepFinish callbacks for monitoring
253-
- [ ] prepareStep callbacks for dynamic configuration**
253+
- [ ] prepareStep callbacks for dynamic configuration\*\*
254254
- [ ] Multiple stopping conditions (step count, budget, errors, validation, completion)
255255
- [ ] Goal-oriented planning
256256
- [ ] Task decomposition
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
11
digraph AgenticWorkflow {
22
// --- Graph Settings (Updated Style) ---
33
graph [
4-
rankdir=LR,
5-
label="AI Agentic Workflow",
6-
fontsize=22,
7-
fontname="Helvetica-Bold,Arial-Bold,sans-serif",
8-
fontcolor="#333333",
9-
labelloc=t,
10-
compound=true,
11-
bgcolor="#F8F9FA",
12-
splines=ortho,
13-
nodesep=0.6,
14-
ranksep=1.2
4+
rankdir = LR,
5+
label = "AI Agentic Workflow",
6+
fontsize = 22,
7+
fontname = "Helvetica-Bold,Arial-Bold,sans-serif",
8+
fontcolor = "#333333",
9+
labelloc = t,
10+
compound = true,
11+
bgcolor = "#F8F9FA",
12+
splines = ortho,
13+
nodesep = 0.6,
14+
ranksep = 1.2
1515
];
1616

1717
// --- Default Node & Edge Styles (from example) ---
1818
node [
19-
fontname="Helvetica,Arial,sans-serif",
20-
shape=box,
21-
style="filled,rounded",
22-
color="lightblue", // Border color
23-
fillcolor="white", // Default fill color
24-
penwidth=2
19+
fontname = "Helvetica,Arial,sans-serif",
20+
shape = box,
21+
style = "filled,rounded",
22+
color = "lightblue", // Border color
23+
fillcolor = "white", // Default fill color
24+
penwidth = 2
2525
];
2626
edge [
27-
fontname="Helvetica,Arial,sans-serif",
28-
color="black",
29-
arrowhead=vee,
30-
fontsize=10
27+
fontname = "Helvetica,Arial,sans-serif",
28+
color = "black",
29+
arrowhead = vee,
30+
fontsize = 10
3131
];
3232

3333
// --- Node Definitions (with new colors) ---
3434
Start [
35-
shape=circle,
36-
label="Start",
37-
fontname="Helvetica-Bold,Arial-Bold,sans-serif"
35+
shape = circle,
36+
label = "Start",
37+
fontname = "Helvetica-Bold,Arial-Bold,sans-serif"
3838
];
3939
End [
40-
shape=doublecircle,
41-
label="End",
42-
fontname="Helvetica-Bold,Arial-Bold,sans-serif"
40+
shape = doublecircle,
41+
label = "End",
42+
fontname = "Helvetica-Bold,Arial-Bold,sans-serif"
4343
];
4444

4545
HumanLoop [
46-
label="User Feedback",
47-
fillcolor="lightgreen"
46+
label = "User Feedback",
47+
fillcolor = "lightgreen"
4848
];
4949
AIModel [
50-
label="AI Model",
51-
fillcolor="lightpink"
50+
label = "AI Model",
51+
fillcolor = "lightpink"
5252
];
5353

5454
// --- Agentic Loop Cluster (styled like example) ---
5555
subgraph cluster_agentic_loop {
5656
label = "Agentic Loop";
5757
style = "dashed";
5858
color = "lightgrey";
59-
fontname="Helvetica-Bold,Arial-Bold,sans-serif";
59+
fontname = "Helvetica-Bold,Arial-Bold,sans-serif";
6060

6161
// Nodes inside the cluster get a yellow fill
62-
node [fillcolor="lightyellow"];
62+
node [fillcolor = "lightyellow"];
6363

6464
Plan;
6565
Execute;
@@ -69,11 +69,11 @@ Plan -> Execute -> Check;
6969
}
7070

7171
// --- Layout and Workflow Connections ---
72-
HumanLoop -> Execute -> AIModel [style=invis, minlen=1];
72+
HumanLoop -> Execute -> AIModel [style = invis, minlen = 1];
7373

74-
Start -> Plan [lhead=cluster_agentic_loop];
75-
Check -> End [ltail=cluster_agentic_loop];
74+
Start -> Plan [lhead = cluster_agentic_loop];
75+
Check -> End [ltail = cluster_agentic_loop];
7676

77-
HumanLoop -> Plan [lhead=cluster_agentic_loop, constraint=false, xlabel=" Feedback "];
78-
Execute -> AIModel [ltail=cluster_agentic_loop, constraint=false, xlabel="Uses "];
77+
HumanLoop -> Plan [lhead = cluster_agentic_loop, constraint = false, xlabel = " Feedback "];
78+
Execute -> AIModel [ltail = cluster_agentic_loop, constraint = false, xlabel = "Uses "];
7979
}

0 commit comments

Comments
 (0)