Skip to content

Commit cd856e8

Browse files
Merge pull request #714 from corbitsdev/cl-7180-refresh-readme-to-match-the-shipping-product
Refresh the README to match the shipping product
2 parents e6c4299 + 96656ab commit cd856e8

1 file changed

Lines changed: 168 additions & 57 deletions

File tree

README.md

Lines changed: 168 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Corbits Code
22

3-
Corbits Code is a local-first coding agent. It lives in your terminal and works with whatever model you point it at — Anthropic, OpenAI, Google, a local Ollama, or any OpenAI-compatible endpoint. Your machine, your keys, your code.
3+
Corbits Code is a local agentic software factory: a single-process coding agent
4+
CLI that runs multi-agent fleets to implement, verify, and land software — with
5+
progress and cost always visible. Point it at Anthropic, OpenAI, Google, a local
6+
Ollama, or any OpenAI-compatible endpoint. Your machine, your keys, your code.
7+
8+
The product is the **harness** — the loop that dispatches work, watches it,
9+
decides what happens next, and reports to the operator. Agent personas and
10+
skills are content that run inside it.
411

512
## Quickstart
613

@@ -10,7 +17,8 @@ Corbits Code is a local-first coding agent. It lives in your terminal and works
1017
brew install corbitsdev/tap/corbits-code
1118
```
1219

13-
Upgrade later with `brew update && brew upgrade corbits-code`. The CLI binary is `corbits`.
20+
Upgrade later with `brew update && brew upgrade corbits-code`. The CLI binary is
21+
`corbits`.
1422

1523
### From source
1624

@@ -34,96 +42,199 @@ ln -s "$PWD/dist/corbits" ~/.local/bin/corbits
3442

3543
After pulling new changes, re-run `bun run build:bin` to refresh the binary.
3644

37-
## Contributing
45+
## Usage
3846

39-
Before your first commit: `git config core.hooksPath .githooks` and `./bin/check-env`.
47+
### TUI (default)
4048

41-
Every change must pass `bun run typecheck`, `bun run build`, and `bun run test`, and behavior changes come with tests. Coding conventions live in `AGENTS.md` (functional TypeScript, no classes, arktype at boundaries); commit, PR, and Linear/GitHub linking rules live in `CONTRIBUTING.md`. System design is documented in `docs/ARCHITECTURE.md` and `docs/IMPLEMENTATION.md`.
49+
```sh
50+
corbits "Add JWT auth to the API"
51+
```
4252

43-
## Stack
53+
Full-screen terminal UI (OpenTUI): event log, permission and operator prompts,
54+
diff and cost visibility, and a chat input for follow-ups. Press **Shift+Tab**
55+
to cycle reasoning effort for the current model; **Tab** toggles focus between
56+
the prompt and the transcript. See `docs/TUI.md`.
4457

45-
- **Runtime:** Bun + TypeScript
46-
- **Agent loop:** `@intx/agent` with event-driven reactor
47-
- **Inference:** `@intx/inference` with OpenAI-compatible SSE adapter
48-
- **Tools:** `@intx/tools-posix` with path-escape, authz, and verify plugins
49-
- **Persistence:** `@intx/storage-isogit` for git-backed resume
50-
- **Testing:** `@intx/inference-testing` for deterministic agent loop tests
51-
- **TUI:** Ink + React
58+
### Exec (non-TUI)
5259

53-
## Architecture
60+
```sh
61+
corbits exec "Add JWT auth to the API"
62+
# alias:
63+
corbits run "Add JWT auth to the API"
64+
```
5465

55-
Corbits Code is a single-process CLI built on Interchange primitives. The goal is raw feature implementation throughput that outperforms other coding agents through deterministic event-loop discipline, better prompts, and a custom reactor director.
66+
Same directors, tools, permissions, MCP, plugins, and hooks as the TUI — without
67+
the OpenTUI shell. Streams assistant text to stdout for scripts and CI.
5668

57-
```
58-
CLI (src/index.ts)
59-
→ load config, load skills
60-
→ createPosixTools({ cwd, plugins: [pathEscapePlugin, authzPlugin, verifyPlugin] })
61-
→ createAgent(agentDef, {
62-
sources, // built per active provider: Anthropic, OpenAI, Google, Ollama, or an OpenAI-compatible endpoint
63-
defaultSource,
64-
tools: posixTools,
65-
director: createChatDirector(systemPrompt, tools),
66-
})
67-
→ agent.send(task)
68-
→ for await (event of agent.stream()) { handle }
69-
→ agent.close()
69+
### Resume
70+
71+
```sh
72+
corbits resume
73+
# or:
74+
corbits resume <session-id>
7075
```
7176

72-
The chat director adds context management on top of the reactor:
77+
Plain `corbits` always starts a fresh conversation. `corbits resume` opens a
78+
picker of saved sessions for the working directory.
79+
80+
### Mid-run steering
81+
82+
While a run is in progress:
7383

74-
- **Threshold compaction:** As the context window fills, the conversation is compacted at the next safe point.
75-
- **Idle compaction:** A pending compaction also runs when a turn ends without more work, so a text-only conversation still compacts.
76-
- **Overflow recovery:** A context-overflow error triggers a bounded compact-and-retry instead of failing the turn.
77-
- **Workflow nudges:** When a workflow is active, the director keeps the run on the current step and surfaces a visible message if it stalls.
84+
- **Enter** — soft-steer while the parent is busy (in-flight tool / `wait_agents`); starts a new primary turn when the parent is idle with a fleet still running
85+
- **Alt+Enter** — queue a follow-up delivered when the whole session is idle
86+
- **Ctrl+C** — interrupt the run
87+
88+
Shortcuts are listed in `/help`. Details live in `docs/PRODUCT.md`.
7889

7990
## Permissions and auto mode
8091

81-
Corbits Code defaults to **auto mode** (`auto = true`). Workspace file writes/edits/deletes and unconstrained shell commands run without per-action prompts. Pass `--no-auto` to start in ask-on-every-consequential-action mode (there is currently no in-session key to toggle auto). Press **Shift+Tab** in the TUI to cycle reasoning effort for the current model. Enabling auto prints a one-line reminder of the envelope below.
92+
Corbits Code defaults to **auto mode** (`auto = true`). Workspace file
93+
writes/edits/deletes and unconstrained shell commands run without per-action
94+
prompts. Pass `--no-auto` to start in ask-on-every-consequential-action mode
95+
(there is currently no in-session key to toggle auto).
8296

8397
### What auto allows
8498

85-
- File tools inside the workspace: `write_file`, `edit_file`, `delete_file` (and other non-shell built-ins such as `manage_tasks`, `task`, …)
86-
- Unconstrained shell (builds, tests, git, one-off commands that match no deny/ask rule)
87-
- Read-only tools (`read_file`, `grep`, `search_files`, `list_dir`, `lsp`, …) always allow regardless of mode
99+
- File tools inside the workspace: `write_file`, `edit_file`, `delete_file` (and
100+
other non-shell built-ins such as `manage_tasks`, `task`, …)
101+
- Unconstrained shell (builds, tests, git, one-off commands that match no
102+
deny/ask rule)
103+
- Read-only tools (`read_file`, `grep`, `search_files`, `list_dir`, `lsp`, …)
104+
always allow regardless of mode
88105

89106
### What still asks (even in auto)
90107

91-
- Dependency installs and remote runners (`npm install` / `i` / `ci` / `add`, `pip install`, `cargo add`, `brew install`, `npx` / `bunx`, …)
108+
- Dependency installs and remote runners (`npm install` / `i` / `ci` / `add`,
109+
`pip install`, `cargo add`, `brew install`, `npx` / `bunx`, …)
92110
- Recursive `rm` (`-r` / `-R` / `--recursive`)
93-
- Force or uncontained git worktree add/remove/prune (contained non-force add/remove/prune and read-only `git worktree list` auto-allow)
94-
- Shell that references sensitive paths (`.env`, private keys, certs, credential files, …)
95-
- Opaque shell wrappers the policy cannot statically inspect (variable expansion or command substitution in a wrapper payload)
96-
- Paths outside the workspace, writes under the session state root, mutating MCP tools, and unknown built-ins
111+
- Force or uncontained git worktree add/remove/prune (contained non-force
112+
add/remove/prune and read-only `git worktree list` auto-allow)
113+
- Shell that references sensitive paths (`.env`, private keys, certs, credential
114+
files, …)
115+
- Opaque shell wrappers the policy cannot statically inspect (variable expansion
116+
or command substitution in a wrapper payload)
117+
- Paths outside the workspace, writes under the session state root, mutating MCP
118+
tools, and unknown built-ins
97119

98120
### What auto hard-denies (use the file tools instead)
99121

100-
- File creation or edits via shell: redirects (`>` / `>>`), `tee`, `sed -i` / `perl -i` / similar, interpreter inline programs or heredocs (`python -c`, `node -e`, …)
122+
- File creation or edits via shell: redirects (`>` / `>>`), `tee`, `sed -i` /
123+
`perl -i` / similar, interpreter inline programs or heredocs (`python -c`,
124+
`node -e`, …)
101125

102-
Wrappers such as `bash -c '…'`, `sh`/`zsh -c`, `xargs`, and transparent prefixes (`env`, `nice`, `timeout`) are peeled so the same rules apply to the inner command. Unparseable wrappers fall through to ask rather than auto-allow.
126+
Wrappers such as `bash -c '…'`, `sh`/`zsh -c`, `xargs`, and transparent prefixes
127+
(`env`, `nice`, `timeout`) are peeled so the same rules apply to the inner
128+
command. Unparseable wrappers fall through to ask rather than auto-allow.
103129

104-
Catastrophic patterns (`rm -rf /`, `sudo`, `curl | bash`, force-push, open-ended `find`/`rg`/`grep -r`, …) are always denied by authorization, independent of auto mode. `--dangerously-skip-permissions` still forces this process; `/yolo` persists as the user-global default. Both bypass the permission gate (not secret-guard path denies or authz hard blocks).
130+
Catastrophic patterns (`rm -rf /`, `sudo`, `curl | bash`, force-push, open-ended
131+
`find`/`rg`/`grep -r`, …) are always denied by authorization, independent of
132+
auto mode. `--dangerously-skip-permissions` still forces this process; `/yolo`
133+
persists as the user-global default. Both bypass the permission gate (not
134+
secret-guard path denies or authz hard blocks).
105135

106-
Details live in `docs/PRODUCT.md` (safety model) and `docs/ARCHITECTURE.md` (permission gate and auto-shell policy).
136+
Details live in `docs/PRODUCT.md` (safety model) and `docs/ARCHITECTURE.md`
137+
(permission gate and auto-shell policy).
107138

108-
## Development
139+
## Stack
140+
141+
- **Runtime:** Bun + TypeScript
142+
- **Agent loop:** `@intx/agent` with an event-driven reactor
143+
- **Inference:** `@intx/inference` (vendored) with OpenAI-compatible adapters
144+
- **Tools:** `@intx/tools-posix` and `@intx/tools-lsp`
145+
- **Authz:** `@intx/authz` for grant matching; Corbits owns the gate, store, and TUI ask
146+
- **Persistence:** `@intx/storage-isogit` for git-backed resume
147+
- **MCP:** Model Context Protocol SDK for external tool servers
148+
- **TUI:** OpenTUI (`@opentui/core`, `@opentui/solid`)
149+
150+
## Architecture
151+
152+
Corbits Code is a single-process CLI built on Interchange primitives. The primary
153+
session is always the **orchestrator** (Skywalker): it can act directly and
154+
delegates substantial work through a closed director fleet via `spawn_agent` /
155+
`wait_agents` / `search_agents` (`task` remains a fused spawn-plus-wait
156+
wrapper).
109157

110-
```bash
111-
bun install
112-
bun run typecheck
113-
bun run build
114-
bun run test
115158
```
159+
CLI (src/index.ts)
160+
→ load config / settings
161+
→ runTUI (default) or runExec (corbits exec | run)
162+
→ create agent with ChatDirector, posix tools, permission gate
163+
→ mount plugins, MCP, hooks, skills
164+
→ primary orchestrator turn
165+
↳ spawn_agent / wait_agents → closed directors (builder, explorer, …)
166+
→ event stream → OpenTUI host (TUI) or stdout (exec)
167+
```
168+
169+
The chat director adds context management on top of the reactor:
170+
171+
- **Threshold compaction:** As the context window fills, the conversation is
172+
compacted at the next safe point.
173+
- **Idle compaction:** A pending compaction also runs when a turn ends without
174+
more work, so a text-only conversation still compacts.
175+
- **Overflow recovery:** A context-overflow error triggers a bounded
176+
compact-and-retry instead of failing the turn.
177+
- **Workflow nudges:** When a workflow is active, the director keeps the run on
178+
the current step and surfaces a visible message if it stalls.
179+
180+
Deep design: `docs/ARCHITECTURE.md`, `docs/IMPLEMENTATION.md`, `docs/PRODUCT.md`.
116181

117-
## Agent Workspace
182+
## Extensibility
183+
184+
- **Plugins** — discovery and manifests: `docs/PLUGINS.md`
185+
- **MCP** — connect external tool servers: `docs/MCP.md`
186+
- **Hooks** — lifecycle hooks: `docs/HOOKS.md`
187+
- **Skills / slash commands** — first-party actions such as `/implement`,
188+
`/plan`, `/review`, `/create-issue` ship with the `corbits-skills` plugin (on
189+
by default; toggle in `/plugins`)
190+
191+
## Agent workspace
118192

119193
Corbits Code keeps repository guidance and the closed director fleet separate:
120194

121195
- `AGENTS.md` — shared startup instructions and project context
122-
- `CLAUDE.md` — Claude-specific workspace notes
123-
- `src/agent/directors/` — closed spawn catalog (`directorProfiles()`). Skywalker is the primary orchestrator; spawnable directors include builder, explorer, counsel, intern, critic, greybeard, and the rest of `DIRECTOR_IDS`. Closed ids cannot be overridden by plugins or local files.
124-
- `.agents/agents/` — optional local profile additions; this directory is not required and may be absent
196+
- `src/agent/directors/` — closed spawn catalog (`directorProfiles()`). Skywalker
197+
is the primary orchestrator; spawnable directors include builder, explorer,
198+
counsel, intern, critic, greybeard, neckbeard, bruckheimer, gaasbot, draper,
199+
emil, rand, shakespeare, testsmith, and tester. Closed ids cannot be
200+
overridden by plugins or local files.
201+
- `.agents/agents/` — optional local profile additions; this directory is not
202+
required and may be absent
203+
204+
Named workers resolve through `spawn_agent` / `task` (`resolveDirector`): closed
205+
directors first, then enabled agent plugins, then local
206+
`.agents/agents/*.json|*.yaml` profiles. Use `search_agents` to discover ids
207+
before dispatching.
208+
209+
## Contributing
210+
211+
Before your first commit: `git config core.hooksPath .githooks` and
212+
`./bin/check-env`.
213+
214+
Every change must pass `bun run check` (lint, typecheck, build, and test).
215+
Behavior changes come with tests. Coding conventions live in `AGENTS.md`
216+
(functional TypeScript, no classes, arktype at boundaries); commit, PR, and
217+
Linear/GitHub linking rules live in `CONTRIBUTING.md`.
218+
219+
```bash
220+
bun install
221+
bun run check
222+
```
125223

126-
Named workers resolve through `spawn_agent` / `task` (`resolveDirector`): closed directors first, then enabled agent plugins, then local `.agents/agents/*.json|*.yaml` profiles. Use `search_agents` to discover ids before dispatching.
224+
## Docs
225+
226+
| Doc | Covers |
227+
| ------------------------ | --------------------------------------- |
228+
| `docs/PRODUCT.md` | What we are building and why |
229+
| `docs/ARCHITECTURE.md` | Reactor, directors, permissions, exec |
230+
| `docs/IMPLEMENTATION.md` | Runtime, config, CLI flags, persistence |
231+
| `docs/TUI.md` | Terminal UI behavior |
232+
| `docs/PLUGINS.md` | Plugin manifests and discovery |
233+
| `docs/MCP.md` | MCP servers |
234+
| `docs/HOOKS.md` | Lifecycle hooks |
235+
| `docs/TELEMETRY.md` | Usage telemetry |
236+
| `docs/PERFTRACE.md` | Local PerfTrace / OTEL export |
237+
| `docs/VENDORING.md` | Vendored Interchange packages |
127238

128239
## License
129240

0 commit comments

Comments
 (0)