@antondanv/brainyard 0.1.0
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/CHANGELOG.md +28 -0
- package/LICENSE +21 -0
- package/README.md +323 -0
- package/README.ru.md +334 -0
- package/dist/ask.d.ts +17 -0
- package/dist/ask.d.ts.map +1 -0
- package/dist/ask.js +84 -0
- package/dist/ask.js.map +1 -0
- package/dist/brains/adapter.d.ts +80 -0
- package/dist/brains/adapter.d.ts.map +1 -0
- package/dist/brains/adapter.js +20 -0
- package/dist/brains/adapter.js.map +1 -0
- package/dist/brains/antigravity.d.ts +9 -0
- package/dist/brains/antigravity.d.ts.map +1 -0
- package/dist/brains/antigravity.js +294 -0
- package/dist/brains/antigravity.js.map +1 -0
- package/dist/brains/claude.d.ts +11 -0
- package/dist/brains/claude.d.ts.map +1 -0
- package/dist/brains/claude.js +368 -0
- package/dist/brains/claude.js.map +1 -0
- package/dist/brains/codex.d.ts +11 -0
- package/dist/brains/codex.d.ts.map +1 -0
- package/dist/brains/codex.js +319 -0
- package/dist/brains/codex.js.map +1 -0
- package/dist/brains/index.d.ts +6 -0
- package/dist/brains/index.d.ts.map +1 -0
- package/dist/brains/index.js +6 -0
- package/dist/brains/index.js.map +1 -0
- package/dist/brains/info.d.ts +37 -0
- package/dist/brains/info.d.ts.map +1 -0
- package/dist/brains/info.js +84 -0
- package/dist/brains/info.js.map +1 -0
- package/dist/catalog.d.ts +66 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +332 -0
- package/dist/catalog.js.map +1 -0
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +520 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/term.d.ts +20 -0
- package/dist/cli/term.d.ts.map +1 -0
- package/dist/cli/term.js +87 -0
- package/dist/cli/term.js.map +1 -0
- package/dist/cost.d.ts +7 -0
- package/dist/cost.d.ts.map +1 -0
- package/dist/cost.js +20 -0
- package/dist/cost.js.map +1 -0
- package/dist/errors.d.ts +31 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +122 -0
- package/dist/errors.js.map +1 -0
- package/dist/flags.d.ts +10 -0
- package/dist/flags.d.ts.map +1 -0
- package/dist/flags.js +29 -0
- package/dist/flags.js.map +1 -0
- package/dist/humanize.d.ts +24 -0
- package/dist/humanize.d.ts.map +1 -0
- package/dist/humanize.js +184 -0
- package/dist/humanize.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/options.d.ts +20 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +135 -0
- package/dist/options.js.map +1 -0
- package/dist/process.d.ts +48 -0
- package/dist/process.d.ts.map +1 -0
- package/dist/process.js +232 -0
- package/dist/process.js.map +1 -0
- package/dist/redact.d.ts +14 -0
- package/dist/redact.d.ts.map +1 -0
- package/dist/redact.js +52 -0
- package/dist/redact.js.map +1 -0
- package/dist/run.d.ts +32 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +424 -0
- package/dist/run.js.map +1 -0
- package/dist/status.d.ts +77 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +285 -0
- package/dist/status.js.map +1 -0
- package/dist/stream.d.ts +17 -0
- package/dist/stream.d.ts.map +1 -0
- package/dist/stream.js +68 -0
- package/dist/stream.js.map +1 -0
- package/dist/types.d.ts +214 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/dashboard.html +693 -0
- package/dist/ui/page.d.ts +9 -0
- package/dist/ui/page.d.ts.map +1 -0
- package/dist/ui/page.js +12 -0
- package/dist/ui/page.js.map +1 -0
- package/dist/ui/server.d.ts +20 -0
- package/dist/ui/server.d.ts.map +1 -0
- package/dist/ui/server.js +409 -0
- package/dist/ui/server.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +13 -0
- package/dist/version.js.map +1 -0
- package/package.json +68 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [0.1.0] - 2026-09-30
|
|
8
|
+
|
|
9
|
+
First public release.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- One API over Claude Code, Codex and Antigravity: `status()`, `ask()`, `askAll()`,
|
|
14
|
+
`start()` / `run()`, `models()`, `ping()`.
|
|
15
|
+
- A closed list of events with human-readable summaries, secrets masked.
|
|
16
|
+
- Steering a working agent with `hint()` (Claude Code, Antigravity) and stopping it with
|
|
17
|
+
`stop()`, an `AbortSignal` or a timeout.
|
|
18
|
+
- Session resume, model and effort checked against each CLI's own catalog, MCP servers per run.
|
|
19
|
+
- Access levels `full`, `workspace` and `readonly`, mapped to each CLI's permission and sandbox
|
|
20
|
+
flags and verified with real runs.
|
|
21
|
+
- Typed failures: `usage_limit` with the reset time, `rate_limited`, `not_logged_in`,
|
|
22
|
+
`network`, `timeout`, `stopped`, `empty_answer`, `failed`.
|
|
23
|
+
- The `brainyard` command: `status`, `models`, `ask`, `run`, `ui`.
|
|
24
|
+
- A local dashboard that looks like a terminal, with status cards and a playground, over a
|
|
25
|
+
token-guarded HTTP API with server-sent events.
|
|
26
|
+
- Tests against fake CLIs, and `npm run live` for checks against the real ones.
|
|
27
|
+
|
|
28
|
+
[0.1.0]: https://github.com/antondanv/brainyard/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Anton Danilov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="docs/assets/logo.svg" width="72" height="72" alt="">
|
|
4
|
+
|
|
5
|
+
# Brainyard
|
|
6
|
+
|
|
7
|
+
**One interface to the coding agents you already have: Claude Code, Codex and Antigravity.**
|
|
8
|
+
|
|
9
|
+
See which are installed and signed in, ask them one-shot questions, or run an agent in a folder
|
|
10
|
+
and watch a live, human-readable feed of what it does. From the terminal, from TypeScript, or
|
|
11
|
+
from a local dashboard.
|
|
12
|
+
|
|
13
|
+
[](https://github.com/antondanv/brainyard/actions/workflows/ci.yml)
|
|
14
|
+
[](https://www.npmjs.com/package/@antondanv/brainyard)
|
|
15
|
+

|
|
16
|
+

|
|
17
|
+
[](LICENSE)
|
|
18
|
+
|
|
19
|
+
**English** · [Русский](README.ru.md)
|
|
20
|
+
|
|
21
|
+
<img src="docs/assets/dashboard.png" width="860" alt="The Brainyard dashboard: three status cards, and a Claude Code run that wrote fib.py, ran it and reported the output">
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
|
|
27
|
+
Claude Code, Codex and Antigravity are all excellent headless agents, and all three speak a
|
|
28
|
+
different dialect: different flags, different stream formats, different ways to resume a
|
|
29
|
+
session, pass an MCP server, pick an effort level or report a usage limit. Each also has quirks
|
|
30
|
+
that only show up in real runs: a prompt starting with `---` read as a command-line option, a
|
|
31
|
+
CLI that never exits because its stdin is still open, a turn that ends silently after a refused
|
|
32
|
+
tool.
|
|
33
|
+
|
|
34
|
+
Brainyard gives them one API. The same options, the same events and the same errors for all
|
|
35
|
+
three, with the workarounds built in. It drives the CLIs you installed with your own accounts.
|
|
36
|
+
It runs no service, calls no model API and holds no keys.
|
|
37
|
+
|
|
38
|
+
It was extracted from a production system that runs all three CLIs every day. Most of the
|
|
39
|
+
behaviour below exists because a real run failed without it ([battle-tested quirks](docs/gotchas.md)).
|
|
40
|
+
|
|
41
|
+
## Features
|
|
42
|
+
|
|
43
|
+
- **Status in one command.** Installed? Which version? Signed in, and how? Which models and
|
|
44
|
+
reasoning efforts? All of it free where the CLI allows. `--live` proves each CLI with a
|
|
45
|
+
one-word call; for Claude Code it also shows how much of your 5-hour and 7-day windows is used.
|
|
46
|
+
- **`ask()`.** One prompt, one answer, isolated from your project: no `CLAUDE.md`, hooks or
|
|
47
|
+
MCP servers leaking into the prompt.
|
|
48
|
+
- **`start()` / `run()`.** An agent in a folder, streaming one closed list of events
|
|
49
|
+
(`message`, `command`, `file_write`, `tool_call`…) with a human-readable line for each.
|
|
50
|
+
- **Steering.** `hint()` sends a message to an agent while it works (Claude Code,
|
|
51
|
+
Antigravity). `stop()` stops it and everything it started.
|
|
52
|
+
- **Sessions.** Every run returns a `sessionId`; pass it as `resume` to continue.
|
|
53
|
+
- **Models and effort.** Asked from each CLI itself and checked before a run: Claude Code
|
|
54
|
+
silently ignores an effort it does not know, so you would pay for something you did not pick.
|
|
55
|
+
- **Access levels.** `full`, `workspace` and `readonly`, mapped to each CLI's own permission and
|
|
56
|
+
sandbox flags. Verified live, including "nothing outside the folder gets written".
|
|
57
|
+
- **MCP servers per run.** One config shape, delivered the way each CLI needs it, with no
|
|
58
|
+
global config touched.
|
|
59
|
+
- **Typed failures.** `usage_limit` (with the reset time), `rate_limited`, `not_logged_in`,
|
|
60
|
+
`network`… so you know whether to wait a minute, wait until 6:50pm or sign in.
|
|
61
|
+
- **Dashboard.** `brainyard ui` opens status cards and a playground over a local, token-guarded
|
|
62
|
+
HTTP API that other languages can use too.
|
|
63
|
+
- **No runtime dependencies.**
|
|
64
|
+
|
|
65
|
+
## Install
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
npm install -g @antondanv/brainyard # the `brainyard` command
|
|
69
|
+
npm install @antondanv/brainyard # the library
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
You need Node.js 22+ and at least one agent CLI:
|
|
73
|
+
|
|
74
|
+
| CLI | Install | Sign in |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| Claude Code | `npm install -g @anthropic-ai/claude-code` | run `claude` once |
|
|
77
|
+
| Codex | `npm install -g @openai/codex` | `codex login` |
|
|
78
|
+
| Antigravity | `curl -fsSL https://antigravity.google/cli/install.sh \| bash` | run `agy` once |
|
|
79
|
+
|
|
80
|
+
## Command line
|
|
81
|
+
|
|
82
|
+
```console
|
|
83
|
+
$ brainyard
|
|
84
|
+
Brainyard 0.1.0
|
|
85
|
+
|
|
86
|
+
● Claude Code 2.1.280 ready signed in with claude.ai, pro
|
|
87
|
+
● Codex 0.153.4 ready signed in with ChatGPT · default model gpt-6-astra
|
|
88
|
+
● Antigravity 1.2.13 ready signed in · model list fetched with your account
|
|
89
|
+
|
|
90
|
+
3 of 3 ready · 3.6s · prove each with a real call: brainyard status --live
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Ask.** The answer goes to stdout and the details to stderr, so pipes work as they look:
|
|
94
|
+
|
|
95
|
+
```console
|
|
96
|
+
$ git diff | brainyard ask claude --model haiku "Review this diff in three bullets"
|
|
97
|
+
$ brainyard ask codex --effort high "Explain CRDTs in two sentences" > crdt.md
|
|
98
|
+
$ brainyard ask all "In one short sentence: what is a monad?"
|
|
99
|
+
── Claude Code claude-opus-5-5 · 4.8s · $0.0079
|
|
100
|
+
A monad is a type that wraps values in a context, like optionality, lists, I/O, or state, …
|
|
101
|
+
|
|
102
|
+
── Codex gpt-6-astra · 9.1s
|
|
103
|
+
A monad is a programming abstraction that chains computations while managing context, …
|
|
104
|
+
|
|
105
|
+
── Antigravity 13.9s
|
|
106
|
+
A monad is a design pattern that wraps values in a computational context and enables …
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Run an agent.** The feed streams to stderr. While it works, type a message and press Enter
|
|
110
|
+
to steer it; Ctrl+C stops it and keeps whatever it already wrote.
|
|
111
|
+
|
|
112
|
+
```console
|
|
113
|
+
$ brainyard run claude --model haiku --cwd ./sandbox "Write fib.py, run it, tell me the output"
|
|
114
|
+
Claude Code is working · type a message + Enter to steer, Ctrl+C to stop
|
|
115
|
+
00:01 ◆ Claude Code started · claude-haiku-4-5-20251001
|
|
116
|
+
00:05 › I'll create a Fibonacci script and run it for you.
|
|
117
|
+
00:06 ✎ wrote fib.py
|
|
118
|
+
00:09 $ ran: python3 fib.py
|
|
119
|
+
00:11 › Done! The output is: 0 1 1 2 3 5 8 13 21 34
|
|
120
|
+
00:11 ✓ done in 11.6s · 2 actions · $0.0306
|
|
121
|
+
|
|
122
|
+
session 32a4caae-… · continue: brainyard run claude --resume 32a4caae-… "…"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`--json` prints every event as a JSON line; `--quiet` prints only the answer. Like `codex exec`,
|
|
126
|
+
`ask` and `run` read piped stdin and append it to the prompt; that waits for end of input, so a
|
|
127
|
+
script that leaves stdin open should pass `--no-stdin`.
|
|
128
|
+
|
|
129
|
+
| Command | What it does |
|
|
130
|
+
|---|---|
|
|
131
|
+
| `brainyard [status]` | Which CLIs are installed, signed in and ready (`--live`, `--models`, `--json`) |
|
|
132
|
+
| `brainyard models [brain…]` | Models and efforts each CLI offers |
|
|
133
|
+
| `brainyard ask <brain\|all> <prompt>` | One prompt, one answer (`--model`, `--effort`, `--system`, `--web`) |
|
|
134
|
+
| `brainyard run <brain> <prompt>` | An agent with a live feed (`--cwd`, `--resume`, `--access`, `--mcp`, `--no-web`, `--json`) |
|
|
135
|
+
| `brainyard ui` | The dashboard on `http://127.0.0.1:4747` |
|
|
136
|
+
|
|
137
|
+
Brains are `claude`, `codex` and `antigravity` (alias `agy`). `brainyard help` lists every flag.
|
|
138
|
+
|
|
139
|
+
## Library
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
import { ask, run, start, status } from '@antondanv/brainyard';
|
|
143
|
+
|
|
144
|
+
// Who is ready? Free checks; `live: true` adds a one-word call to each.
|
|
145
|
+
const { ready } = await status(); // ['claude', 'codex', 'antigravity']
|
|
146
|
+
|
|
147
|
+
// One prompt, one answer.
|
|
148
|
+
const { text, costUsd } = await ask('codex', 'One-line summary of RFC 9110?', { effort: 'low' });
|
|
149
|
+
|
|
150
|
+
// An agent in a folder, event by event.
|
|
151
|
+
const agent = start({
|
|
152
|
+
brain: 'claude',
|
|
153
|
+
cwd: './app',
|
|
154
|
+
prompt: 'Add a unit test for src/math.ts and make it pass',
|
|
155
|
+
access: 'workspace', // edits and commands inside ./app only
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
for await (const event of agent) {
|
|
159
|
+
if (event.feed) console.log(event.summary); // "wrote test/math.test.ts", "ran: npm test", …
|
|
160
|
+
if (event.kind === 'command' && event.summary.includes('npm test')) {
|
|
161
|
+
agent.hint('Use vitest, not jest.'); // reaches the agent while it works
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const result = await agent.result;
|
|
166
|
+
if (!result.ok) console.error(result.error); // { kind: 'usage_limit', resetsAt: '6:50pm', … }
|
|
167
|
+
|
|
168
|
+
// Continue the same conversation later.
|
|
169
|
+
await run({ brain: 'claude', cwd: './app', resume: result.sessionId, prompt: 'Now add a benchmark' });
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
MCP servers for one run:
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
await run({
|
|
176
|
+
brain: 'codex',
|
|
177
|
+
prompt: 'Which markdown file in the docs is the longest? Summarise it.',
|
|
178
|
+
mcpServers: {
|
|
179
|
+
files: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem', './docs'] },
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
`result` rejects only when the run never started (bad options, CLI not installed). Once the CLI
|
|
185
|
+
has started, it resolves: check `result.ok`. `ask()` throws a `BrainyardError` with a `kind` on
|
|
186
|
+
any failure. More in [`examples/`](examples).
|
|
187
|
+
|
|
188
|
+
### Options
|
|
189
|
+
|
|
190
|
+
| Option | Default | |
|
|
191
|
+
|---|---|---|
|
|
192
|
+
| `brain` | | `claude`, `codex` or `antigravity` |
|
|
193
|
+
| `prompt` | | Sent on stdin, never as an argument |
|
|
194
|
+
| `cwd` | `process.cwd()` | Where the agent works (`ask()`: a fresh temporary folder) |
|
|
195
|
+
| `model`, `effort` | the CLI's | Checked against the CLI's catalog before the run |
|
|
196
|
+
| `resume` | | A `sessionId` from an earlier result |
|
|
197
|
+
| `access` | `full` (`ask()`: `readonly`) | See below |
|
|
198
|
+
| `web`, `shell` | `true` (`ask()`: no web) | Switches, where the CLI has them |
|
|
199
|
+
| `mcpServers` | | `{ name: { command, args?, env? } }` |
|
|
200
|
+
| `steerable` | where supported | Keep stdin open for `hint()` |
|
|
201
|
+
| `nudge` | `true` | A turn that ends without text gets one follow-up in the same conversation |
|
|
202
|
+
| `timeoutMs` | none | A run killed halfway is paid for in full, so there is no default limit |
|
|
203
|
+
| `signal`, `onEvent`, `env`, `extraArgs`, `command`, `prices`, `includeRaw` | | |
|
|
204
|
+
|
|
205
|
+
### Access levels
|
|
206
|
+
|
|
207
|
+
A headless agent has nobody to ask for permission, so a tool that needs approval is simply
|
|
208
|
+
refused. Pick the level up front:
|
|
209
|
+
|
|
210
|
+
| `access` | Claude Code | Codex | Antigravity |
|
|
211
|
+
|---|---|---|---|
|
|
212
|
+
| `full` | every tool, no prompts | every tool, no sandbox | every tool, no prompts |
|
|
213
|
+
| `workspace` | edits and commands in its sandbox, confined to `cwd` | `workspace-write` sandbox | edits; its sandbox refuses most commands |
|
|
214
|
+
| `readonly` | reads and searches only | `read-only` sandbox | plan mode: writes refused |
|
|
215
|
+
|
|
216
|
+
Checked with real runs on every CLI: in `workspace`, a file inside `cwd` gets written and a
|
|
217
|
+
write to the home directory fails. In `readonly`, nothing gets written. See
|
|
218
|
+
[`scripts/live-check.ts`](scripts/live-check.ts).
|
|
219
|
+
|
|
220
|
+
### Events
|
|
221
|
+
|
|
222
|
+
Every CLI's stream becomes the same closed list. Each event has a `summary`: one line for
|
|
223
|
+
humans, with paths shortened and secrets masked. `feed: false` marks ceremony that is true but
|
|
224
|
+
not news (a reasoning block, a successful tool result).
|
|
225
|
+
|
|
226
|
+
| kind | |
|
|
227
|
+
|---|---|
|
|
228
|
+
| `init` | The CLI started: model, session id |
|
|
229
|
+
| `message` / `thinking` | The agent said something / reasoned |
|
|
230
|
+
| `tool_call` / `command` / `file_write` | The agent did something |
|
|
231
|
+
| `tool_result` | What a tool returned (in the feed only when it failed) |
|
|
232
|
+
| `hint` | Your message reached the agent |
|
|
233
|
+
| `denied` | The CLI refused a tool |
|
|
234
|
+
| `warning` | An option this CLI cannot enforce, a failed MCP server, a usage window near its limit |
|
|
235
|
+
| `error` / `stopped` | Something broke / the run was stopped |
|
|
236
|
+
| `done` | Always last |
|
|
237
|
+
|
|
238
|
+
### What each CLI can do
|
|
239
|
+
|
|
240
|
+
| | Claude Code | Codex | Antigravity |
|
|
241
|
+
|---|:-:|:-:|:-:|
|
|
242
|
+
| Messages while it works (`hint`) | ✓ | — | ✓ |
|
|
243
|
+
| Resume a session | ✓ | ✓ | ✓ |
|
|
244
|
+
| MCP servers per run | ✓ | ✓ | ✓ |
|
|
245
|
+
| Reports dollar cost | ✓ | tokens only | tokens only |
|
|
246
|
+
| Lists its models | aliases | ✓ | ✓ |
|
|
247
|
+
| Web can be switched off | ✓ | ✓ | — (warns) |
|
|
248
|
+
| Shell can be switched off | ✓ | sandboxed instead | — (warns) |
|
|
249
|
+
| Subscription window usage | ✓ | — | — |
|
|
250
|
+
|
|
251
|
+
An option a CLI cannot honour is never dropped silently: it comes back as a `warning` event and
|
|
252
|
+
in `result.warnings`.
|
|
253
|
+
|
|
254
|
+
## Dashboard and HTTP API
|
|
255
|
+
|
|
256
|
+
`brainyard ui` serves the dashboard shown at the top: status cards and a playground to ask
|
|
257
|
+
questions or run agents with a live feed, hints, stop and "continue this session". **Live
|
|
258
|
+
check** sends each CLI a one-word prompt and shows how much of Claude Code's subscription
|
|
259
|
+
windows is used, or why a CLI did not answer:
|
|
260
|
+
|
|
261
|
+
<img src="docs/assets/live-check.png" width="860" alt="Live check: Claude Code and Antigravity answered pong, Codex shows the error for a model its ChatGPT account cannot use; Claude Code also shows its 5-hour and 7-day subscription windows">
|
|
262
|
+
|
|
263
|
+
The dashboard uses a small HTTP API you can call from any language:
|
|
264
|
+
[`docs/http-api.md`](docs/http-api.md).
|
|
265
|
+
|
|
266
|
+
The API can start agents on your machine, so it is guarded like it: it listens on `127.0.0.1`,
|
|
267
|
+
every call needs the token printed at start, the `Host` header must name the server (against
|
|
268
|
+
DNS rebinding), and writes are accepted only as same-origin JSON.
|
|
269
|
+
|
|
270
|
+
## Battle-tested quirks
|
|
271
|
+
|
|
272
|
+
A few of the things Brainyard handles so you don't have to. The full list, with symptoms and
|
|
273
|
+
fixes, is in [`docs/gotchas.md`](docs/gotchas.md).
|
|
274
|
+
|
|
275
|
+
- **Prompts never go on the command line.** Claude Code's `-p` is a boolean flag, so a prompt
|
|
276
|
+
starting with `---` becomes `error: unknown option`. All three get the prompt on stdin.
|
|
277
|
+
- **stdin is closed exactly when the turn ends.** With stream-json input the CLI treats stdin
|
|
278
|
+
as a conversation and waits for the next message forever. The finished work would hang until
|
|
279
|
+
killed.
|
|
280
|
+
- **Claude Code folds a mid-turn message into the running turn; Antigravity queues it as a new
|
|
281
|
+
turn with its own result.** Closing stdin at the wrong result loses the hint.
|
|
282
|
+
- **Exit code 0 is not success.** Antigravity used to end print mode after five minutes with
|
|
283
|
+
exit code 0 in the middle of work. No final result means a cut-off turn.
|
|
284
|
+
- **A silent turn gets one follow-up, in the same conversation.** Antigravity ends a turn
|
|
285
|
+
without a word after a refused tool. A new process would not remember what it tripped over.
|
|
286
|
+
- **A usage limit is not a 429.** One is retried in seconds, the other resets in hours, and
|
|
287
|
+
the CLI says when. Brainyard keeps that time for you.
|
|
288
|
+
|
|
289
|
+
## How it is tested
|
|
290
|
+
|
|
291
|
+
- **144 tests** run the real code against fake `claude`, `codex` and `agy` executables that
|
|
292
|
+
speak each dialect. Like the real CLIs, the fakes never exit while stdin is open, so a runner
|
|
293
|
+
that forgets to close it hangs the test instead of passing it.
|
|
294
|
+
- **`npm run live`** runs every check against the real CLIs with the cheapest models: ask, a
|
|
295
|
+
prompt starting with dashes, an agent run, a hint, resume, MCP, and the access matrix. Last
|
|
296
|
+
run: Claude Code 2.1.280, Codex 0.153.4, Antigravity 1.2.13, all 21 checks passed for about $0.20.
|
|
297
|
+
|
|
298
|
+
## FAQ
|
|
299
|
+
|
|
300
|
+
**Does it call model APIs or need API keys?** No. It runs the CLIs you installed, signed in with
|
|
301
|
+
your own subscriptions or keys. Nothing leaves your machine that the CLI would not send anyway.
|
|
302
|
+
|
|
303
|
+
**Is `full` access dangerous?** It is what `--dangerously-skip-permissions` is in Claude Code:
|
|
304
|
+
the agent can run any command. Use `workspace` or `readonly` for untrusted prompts, or run
|
|
305
|
+
inside a container.
|
|
306
|
+
|
|
307
|
+
**Why no default timeout?** A run killed halfway is paid for in full and returns nothing. Set
|
|
308
|
+
`timeoutMs` when you want a limit; `stop()` and an `AbortSignal` always work.
|
|
309
|
+
|
|
310
|
+
**Windows?** Not tested yet. Batch shims (`claude.cmd`) are handled, but the CI runs on Linux
|
|
311
|
+
and macOS.
|
|
312
|
+
|
|
313
|
+
**What about Gemini CLI, Cursor, opencode…?** Not yet. Adding a CLI means an adapter plus a
|
|
314
|
+
live check, and a CLI goes in once it passes one.
|
|
315
|
+
|
|
316
|
+
## Contributing
|
|
317
|
+
|
|
318
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Bug reports that include `brainyard status --json` and
|
|
319
|
+
the CLI version help most.
|
|
320
|
+
|
|
321
|
+
## License
|
|
322
|
+
|
|
323
|
+
[MIT](LICENSE)
|