bonecode 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +145 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,27 +11,90 @@
|
|
|
11
11
|
npm install -g bonecode
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Then
|
|
14
|
+
Then run it from any project directory:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
bonecode
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Interfaces
|
|
23
|
+
|
|
24
|
+
BoneCode ships three ways to interact with the agent.
|
|
25
|
+
|
|
26
|
+
### Terminal UI (default)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bonecode
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Opens an interactive terminal session in the current directory. Type `/` to see all available commands.
|
|
33
|
+
|
|
34
|
+
| Key | Action |
|
|
35
|
+
|-----|--------|
|
|
36
|
+
| `/` | Show command menu (arrow keys to navigate, Enter/Tab to select) |
|
|
37
|
+
| `Ctrl+C` | Interrupt the current agent request |
|
|
38
|
+
| `Ctrl+D` | Exit |
|
|
39
|
+
| `↑ / ↓` | Scroll through prompt history |
|
|
40
|
+
| `@<path>` | Attach a file (Tab to autocomplete) |
|
|
41
|
+
|
|
42
|
+
### Web UI
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
bonecode web
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Starts the server and opens the web interface in your browser at `http://localhost:3000/ui`.
|
|
49
|
+
|
|
50
|
+
If you already have the server running separately (`bonecode serve`), just navigate to:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
http://localhost:3000/ui
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Build the web UI for production** (optional — the server serves it automatically after building):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cd web && npm install && npm run build
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The built assets are served from `/ui`. Without a build, the server serves the raw source files in dev mode — functional but without bundling.
|
|
63
|
+
|
|
64
|
+
**Run the web UI in hot-reload dev mode** (separate terminal):
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
cd web && npm install && npm run dev
|
|
68
|
+
# Opens at http://localhost:5173 with proxy to the BoneCode server
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Headless server
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
bonecode serve
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Starts the API server only (no TUI, no browser). Useful for CI, Docker, or connecting your own client.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
20
81
|
## Database modes
|
|
21
82
|
|
|
22
|
-
BoneCode automatically detects what's available
|
|
83
|
+
BoneCode automatically detects what's available:
|
|
23
84
|
|
|
24
85
|
| Mode | Setup required | Features |
|
|
25
86
|
|------|---------------|----------|
|
|
26
87
|
| **PostgreSQL** (full) | Docker | Sessions + agents + **pgvector RAG** + hybrid search + durable events |
|
|
27
88
|
| **SQLite** (basic) | Nothing | Sessions + agents only — no RAG, no vector search |
|
|
28
89
|
|
|
29
|
-
|
|
90
|
+
No Docker? BoneCode falls back to SQLite automatically — fully working agent, just without codebase indexing.
|
|
30
91
|
|
|
31
|
-
|
|
92
|
+
Want the full experience? Install Docker and run `bonecode` — it starts Postgres automatically on first run.
|
|
32
93
|
|
|
33
94
|
> Install Docker: https://docs.docker.com/get-docker/
|
|
34
95
|
|
|
96
|
+
---
|
|
97
|
+
|
|
35
98
|
## Configuration
|
|
36
99
|
|
|
37
100
|
Copy `.env.example` to `.env` and set your LLM provider:
|
|
@@ -50,14 +113,77 @@ OPENAI_API_KEY=not-needed
|
|
|
50
113
|
MODEL_SUPPORTS_TOOLS=false
|
|
51
114
|
```
|
|
52
115
|
|
|
53
|
-
For cloud providers
|
|
116
|
+
For cloud providers just set the API key — no base URL needed:
|
|
117
|
+
|
|
118
|
+
```env
|
|
119
|
+
# Anthropic
|
|
120
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
121
|
+
DEFAULT_PROVIDER=anthropic
|
|
122
|
+
DEFAULT_MODEL=claude-sonnet-4-5
|
|
123
|
+
|
|
124
|
+
# OpenAI
|
|
125
|
+
OPENAI_API_KEY=sk-...
|
|
126
|
+
DEFAULT_PROVIDER=openai
|
|
127
|
+
DEFAULT_MODEL=gpt-4o
|
|
128
|
+
|
|
129
|
+
# Google
|
|
130
|
+
GOOGLE_API_KEY=...
|
|
131
|
+
DEFAULT_PROVIDER=google
|
|
132
|
+
DEFAULT_MODEL=gemini-2.0-flash
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## CLI commands
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
bonecode Start server + open TUI
|
|
141
|
+
bonecode serve Start headless server only
|
|
142
|
+
bonecode web Start server + open web UI in browser
|
|
143
|
+
bonecode run "fix the bug" Send a one-shot prompt
|
|
144
|
+
bonecode run -i Interactive terminal mode (no TUI)
|
|
145
|
+
bonecode stats Show token usage and cost statistics
|
|
146
|
+
bonecode export [id] Export a session as JSON
|
|
147
|
+
bonecode pr <number> Checkout a GitHub PR branch
|
|
148
|
+
bonecode github install Show GitHub Actions agent setup
|
|
149
|
+
bonecode compile Recompile .bone domain models
|
|
150
|
+
bonecode migrate Run database migrations
|
|
151
|
+
bonecode status Check if server is running
|
|
152
|
+
bonecode --version Show version
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Stats
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
bonecode stats # all-time usage
|
|
159
|
+
bonecode stats --days 7 # last 7 days
|
|
160
|
+
bonecode stats --models 5 # show top 5 models
|
|
161
|
+
bonecode stats --tools # show tool usage breakdown
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Export
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
bonecode export # export most recent session
|
|
168
|
+
bonecode export <session-id> # export specific session
|
|
169
|
+
bonecode export --sanitize # redact file paths, tool outputs, etc.
|
|
170
|
+
bonecode export > session.json # pipe to file
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
54
174
|
|
|
55
175
|
## What's different from OpenCode
|
|
56
176
|
|
|
57
|
-
- **BoneScript backend** —
|
|
58
|
-
- **pgvector RAG** —
|
|
59
|
-
- **
|
|
60
|
-
- **
|
|
177
|
+
- **BoneScript backend** — domain models declared in `.bone` files, compiled to Express + state machines + saga flows + durable events
|
|
178
|
+
- **pgvector RAG** — hybrid search (vector + BM25 + RRF fusion), works without an embedding model using structural context
|
|
179
|
+
- **Web UI** — browser interface at `/ui` in addition to the TUI
|
|
180
|
+
- **mDNS discovery** — server announces itself as `bonecode.local` on the local network
|
|
181
|
+
- **Cursor pagination** — v2 session and message APIs support bidirectional keyset pagination
|
|
182
|
+
- **Subagent spawning** — `POST /v2/session/:id/subagent` creates and runs a child session
|
|
183
|
+
- **Single command** — `bonecode` starts everything in one process
|
|
184
|
+
- **SQLite fallback** — works out of the box without Docker
|
|
185
|
+
|
|
186
|
+
---
|
|
61
187
|
|
|
62
188
|
## Architecture
|
|
63
189
|
|
|
@@ -77,8 +203,18 @@ BoneCode/
|
|
|
77
203
|
│ ├── cli.ts # bonecode CLI entry point
|
|
78
204
|
│ ├── tui.ts # Interactive terminal UI
|
|
79
205
|
│ ├── server.ts # Express server (auto Postgres/SQLite)
|
|
206
|
+
│ ├── mdns.ts # mDNS/Bonjour local network discovery
|
|
207
|
+
│ ├── stats.ts # Token/cost statistics
|
|
208
|
+
│ ├── export.ts # Session export with PII redaction
|
|
80
209
|
│ ├── db_adapter.ts # Database detection + SQLite shim
|
|
81
210
|
│ └── engine/ # Agent loop, tools, context builder
|
|
211
|
+
├── web/ # Web UI (vanilla TypeScript + Vite)
|
|
212
|
+
│ ├── index.html
|
|
213
|
+
│ ├── src/
|
|
214
|
+
│ │ ├── main.ts # Entry point
|
|
215
|
+
│ │ ├── app.ts # Main app class
|
|
216
|
+
│ │ └── api.ts # API client
|
|
217
|
+
│ └── vite.config.ts # Dev server with proxy to :3000
|
|
82
218
|
├── compat/
|
|
83
219
|
│ └── opencode_adapter.ts # OpenCode v2 API compatibility layer
|
|
84
220
|
└── extensions/ # Custom extension points (embeddings, chunking, etc.)
|