@ucsandman/legcli 0.8.0 → 0.9.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 +45 -0
- package/NOTICE +8 -0
- package/README.md +601 -560
- package/bin/fake-agent.mjs +4 -4
- package/bin/leg.mjs +21 -12
- package/docs/DECISIONS.md +20 -2
- package/docs/ERRORS.md +71 -0
- package/docs/README.md +2 -0
- package/docs/REUSE.md +1 -1
- package/docs/VOCABULARY.md +21 -0
- package/docs/board-guide.md +13 -0
- package/docs/cli-contracts.md +22 -1
- package/docs/concepts.md +42 -3
- package/docs/configuration.md +22 -1
- package/docs/faq.md +19 -0
- package/docs/getting-started.md +272 -251
- package/docs/harness.md +319 -0
- package/fixtures/verified.json +1 -1
- package/package.json +7 -3
- package/scripts/build-docs-site.mjs +11 -4
- package/scripts/check-branding.mjs +118 -0
- package/scripts/check-claims.mjs +1 -1
- package/scripts/license-sign.mjs +1 -1
- package/scripts/limits-table.mjs +1 -1
- package/scripts/live-limits.mjs +1 -1
- package/scripts/npm-publish-gate.mjs +114 -0
- package/scripts/probe.mjs +4 -3
- package/scripts/seed-fake-cards.mjs +4 -3
- package/scripts/seed-floor-board.mjs +5 -4
- package/scripts/seed-wes-board.mjs +5 -4
- package/scripts/stripe-setup.mjs +1 -1
- package/scripts/sync-harness-engine.mjs +159 -0
- package/scripts/sync-leg-agents.mjs +127 -0
- package/src/accounts.mjs +1 -2
- package/src/adapters/codex.mjs +1 -1
- package/src/attach.mjs +75 -19
- package/src/auth.mjs +2 -2
- package/src/board/board.js +3 -3
- package/src/board/sessions.js +77 -3
- package/src/bundle.mjs +54 -8
- package/src/chain.mjs +1 -1
- package/src/contract.mjs +4 -3
- package/src/fsx.mjs +5 -2
- package/src/handoff.mjs +6 -6
- package/src/harness/cli.mjs +281 -0
- package/src/harness/fingerprint.mjs +68 -0
- package/src/harness/index.mjs +407 -0
- package/src/harness/registry.mjs +124 -0
- package/src/harness/vendor/agnostic-ai/LICENSE +21 -0
- package/src/harness/vendor/agnostic-ai/UPSTREAM.json +30 -0
- package/src/harness/vendor/agnostic-ai/core/safety/guards.json +96 -0
- package/src/harness/vendor/agnostic-ai/core/templates/targets.json +252 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/README.md +199 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/apply.cjs +247 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/bundle.cjs +243 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/capture.cjs +119 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/common.cjs +375 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/index.cjs +55 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/sources/claude.cjs +330 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/sources/codex.cjs +314 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/status.cjs +171 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/targets/agy.cjs +113 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/targets/claude.cjs +158 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/targets/codex.cjs +832 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/targets/cursor.cjs +87 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/targets/gemini.cjs +128 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/targets/generic.cjs +424 -0
- package/src/harness/vendor/agnostic-ai/engine/harness/toml.cjs +149 -0
- package/src/harness/vendor/agnostic-ai/engine/hooks/shim.cjs +431 -0
- package/src/hook.mjs +49 -49
- package/src/land.mjs +7 -35
- package/src/launcher.mjs +38 -26
- package/src/ledger.mjs +6 -6
- package/src/license.mjs +10 -9
- package/src/live-capture.mjs +1 -1
- package/src/mergequeue.mjs +5 -5
- package/src/orchestrator.mjs +28 -4
- package/src/preferences.mjs +37 -3
- package/src/redact.mjs +1 -1
- package/src/resume.mjs +17 -15
- package/src/runner.mjs +2 -2
- package/src/scheduler.mjs +1 -1
- package/src/server.mjs +38 -10
- package/src/session-detail.mjs +15 -1
- package/src/sessions.mjs +6 -3
- package/src/share.mjs +2 -2
- package/src/stations/agent.mjs +1 -1
- package/src/sync/dashclaw.mjs +4 -4
- package/src/synthesis.mjs +165 -0
- package/src/taps/agy.mjs +2 -2
- package/src/taps/claude-usage.mjs +1 -1
- package/src/taps/claude.mjs +170 -170
- package/src/taps/codex.mjs +286 -286
- package/src/taps/grok.mjs +2 -2
- package/src/trust.mjs +205 -36
- package/src/usage.mjs +5 -1
- package/src/worktree.mjs +5 -4
- package/fixtures/live/agy/attempt-1-scratch-workspace.out.log +0 -1
- package/fixtures/live/agy/err.log +0 -0
- package/fixtures/live/agy/out.log +0 -1
- package/fixtures/live/agy/supervisor.log +0 -2
- package/fixtures/live/claude/err.log +0 -0
- package/fixtures/live/claude/out.log +0 -1
- package/fixtures/live/claude/supervisor.log +0 -2
- package/fixtures/live/codex/err.log +0 -1
- package/fixtures/live/codex/out.log +0 -8
- package/fixtures/live/codex/supervisor.log +0 -2
- package/fixtures/live/grok/err.log +0 -32
- package/fixtures/live/grok/out.log +0 -7
- package/fixtures/live/grok/supervisor.log +0 -2
package/docs/getting-started.md
CHANGED
|
@@ -1,251 +1,272 @@
|
|
|
1
|
-
# Getting started
|
|
2
|
-
|
|
3
|
-
For a developer setting up Leg for the first time on their own machine. The
|
|
4
|
-
first four sections get an interactive agent running with the board alongside
|
|
5
|
-
it. The v0.1 pipeline flow is section 7 onward.
|
|
6
|
-
|
|
7
|
-
## 1. Prerequisites
|
|
8
|
-
|
|
9
|
-
- Node 22 or newer (`package.json` sets `"engines": {"node": ">=22"}`).
|
|
10
|
-
- git.
|
|
11
|
-
- Python 3 with pip, for the `context-handoff-bundle` CLI. This is what writes
|
|
12
|
-
and reads the handoff bundles.
|
|
13
|
-
- At least one coding-agent CLI, logged in: `claude`, `codex`, `agy` or
|
|
14
|
-
`grok`. You do not need all four. With one installed you get the board
|
|
15
|
-
and the usage tracking; with two or more you also get the hand-off.
|
|
16
|
-
|
|
17
|
-
## 2. Install
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
npm install -g @ucsandman/legcli
|
|
21
|
-
pip install -U context-handoff-bundle
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`
|
|
51
|
-
|
|
52
|
-
`
|
|
53
|
-
`
|
|
54
|
-
`
|
|
55
|
-
`
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
`.leg/
|
|
76
|
-
the
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
leg
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
leg sessions
|
|
107
|
-
leg sessions
|
|
108
|
-
leg
|
|
109
|
-
leg
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
`
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
1
|
+
# Getting started
|
|
2
|
+
|
|
3
|
+
For a developer setting up Leg for the first time on their own machine. The
|
|
4
|
+
first four sections get an interactive agent running with the board alongside
|
|
5
|
+
it. The v0.1 pipeline flow is section 7 onward.
|
|
6
|
+
|
|
7
|
+
## 1. Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node 22 or newer (`package.json` sets `"engines": {"node": ">=22"}`).
|
|
10
|
+
- git.
|
|
11
|
+
- Python 3 with pip, for the `context-handoff-bundle` CLI. This is what writes
|
|
12
|
+
and reads the handoff bundles.
|
|
13
|
+
- At least one coding-agent CLI, logged in: `claude`, `codex`, `agy` or
|
|
14
|
+
`grok`. You do not need all four. With one installed you get the board
|
|
15
|
+
and the usage tracking; with two or more you also get the hand-off.
|
|
16
|
+
|
|
17
|
+
## 2. Install
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
npm install -g @ucsandman/legcli
|
|
21
|
+
pip install -U context-handoff-bundle
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`npm install -g leg-agents` is the same release: it pins this version of
|
|
25
|
+
`@ucsandman/legcli` and exposes the same `leg` binary.
|
|
26
|
+
|
|
27
|
+
The source repository is private, so there is no clone to install from. The
|
|
28
|
+
source you run ships in the package: `$(npm root -g)/legcli/src`, plain
|
|
29
|
+
`.mjs`, nothing bundled. Read it before you trust it.
|
|
30
|
+
|
|
31
|
+
## 3. Run an agent
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
cd <any repo>
|
|
35
|
+
leg claude
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
That is the whole setup. `leg claude` runs the real Claude Code in this
|
|
39
|
+
terminal with your own settings, hooks and skills. Anything after the agent
|
|
40
|
+
name passes straight through:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
leg claude --model haiku
|
|
44
|
+
leg codex -m gpt-5.3-codex-spark
|
|
45
|
+
leg agy
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The first `leg <agent>` starts the board on http://127.0.0.1:4747 and opens
|
|
49
|
+
it once in your browser. Later sessions reuse the same board. Set
|
|
50
|
+
`LEG_NO_OPEN=1` to skip the browser.
|
|
51
|
+
|
|
52
|
+
Leg strips `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`,
|
|
53
|
+
`ANTHROPIC_BASE_URL`, `ANTHROPIC_CUSTOM_HEADERS`, `OPENAI_API_KEY`,
|
|
54
|
+
`OPENAI_BASE_URL`, `OPENAI_API_BASE`, `GEMINI_API_KEY`, `GOOGLE_API_KEY`,
|
|
55
|
+
`GOOGLE_GEMINI_BASE_URL`, `GOOGLE_GENAI_USE_VERTEXAI`,
|
|
56
|
+
`GOOGLE_GENAI_USE_ENTERPRISE`, `GOOGLE_CLOUD_PROJECT`,
|
|
57
|
+
`GOOGLE_CLOUD_LOCATION`, `GOOGLE_APPLICATION_CREDENTIALS`, `CLAUDECODE`,
|
|
58
|
+
`CLAUDE_CODE_*`, `CLAUDE_EFFORT`, and `CLAUDE_PLUGIN_DATA` from the agent's
|
|
59
|
+
environment, then sets `CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS=0` for a detached
|
|
60
|
+
Claude print session. The subscription login is always what runs. Nothing in
|
|
61
|
+
`~/.claude`, `~/.codex` or agy's home is edited.
|
|
62
|
+
|
|
63
|
+
## 4. What you get while it runs
|
|
64
|
+
|
|
65
|
+
- A card on the board for this terminal: agent, account, repo@branch, the first
|
|
66
|
+
prompt, turns, the files being touched, 5h and 7d usage.
|
|
67
|
+
- A warning at 85 % of either window (`LEG_WARN_PCT`): amber card, an event,
|
|
68
|
+
one terminal bell.
|
|
69
|
+
- For Codex, the board and active attach poll the read-only app-server
|
|
70
|
+
`account/rateLimits/read` response every 60 seconds. Leg maps the returned
|
|
71
|
+
300- and 10080-minute durations to 5h and 7d, shows `<n>% used`, and labels
|
|
72
|
+
old readings stale. Only an explicit backend available answer clears a prior
|
|
73
|
+
wall; no model turn or hardcoded quota is used.
|
|
74
|
+
- A `context-handoff-bundle` for this session, refreshed every two minutes and
|
|
75
|
+
at every warning, limit and hand-off. If `.leg/SYNTHESIS-<session-id>.md` is
|
|
76
|
+
maintained by the agent, it is inlined into `.leg/RESUME.md` as a `## Synthesis`
|
|
77
|
+
section before the raw bundle dump.
|
|
78
|
+
- At the limit: the bundle is saved, the agent is stopped, and the next option
|
|
79
|
+
starts in the same terminal from `.leg/RESUME-<session-id>.md`, copied to
|
|
80
|
+
`.leg/RESUME.md`. Order is other logins of
|
|
81
|
+
the same agent first, then the remaining agents (claude, codex, agy). When
|
|
82
|
+
every option is out, Leg prints each reset time, soonest first, waits with
|
|
83
|
+
a countdown, and starts the first one back from the bundle. Ctrl-C quits.
|
|
84
|
+
|
|
85
|
+
Force a hand-off at any time with the **Hand off now** button on the card, or
|
|
86
|
+
`leg sessions handoff <id>`.
|
|
87
|
+
|
|
88
|
+
## Is the resume file still true?
|
|
89
|
+
|
|
90
|
+
```powershell
|
|
91
|
+
leg resume --check # exit 0 current, 1 stale or unstamped, 3 none here
|
|
92
|
+
leg resume # the same verdict, then the pointer itself
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Leg stamps every resume file with the commit, the working tree and the
|
|
96
|
+
terminals it was written against, and recomputes freshness from git when you
|
|
97
|
+
read it. A commit landing, the tree moving, or the terminal it described going
|
|
98
|
+
away all make it stale; the terminal card's drawer shows the same verdict under
|
|
99
|
+
"What happens next". A session ending rewrites `RESUME.md` to say nothing is in
|
|
100
|
+
flight, and the board does the same at start for a terminal that crashed, so
|
|
101
|
+
nothing is left describing work that has moved on.
|
|
102
|
+
|
|
103
|
+
## 5. Watching and steering from the CLI
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
leg sessions ls every session and its usage
|
|
107
|
+
leg sessions show <id>
|
|
108
|
+
leg sessions events <id>
|
|
109
|
+
leg sessions handoff <id> same as the board button
|
|
110
|
+
leg sessions end <id>
|
|
111
|
+
leg sessions rm <id> forget an ended session
|
|
112
|
+
leg sessions simulate-limit <id> drive the real limit path without a real wall (claude, agy)
|
|
113
|
+
leg accounts ls logins and their 5h/7d usage
|
|
114
|
+
leg open | down | status the board
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
On the board, **Remove** safely prunes an ended session only when its worktree
|
|
118
|
+
is clean and its branch is already merged into the base. For a session that
|
|
119
|
+
needs to be removed from the board while preserving its work, use the visible
|
|
120
|
+
**Remove record** button, read its confirmation, and keep the worktree, branch,
|
|
121
|
+
unmerged commits, and dirty files intact.
|
|
122
|
+
|
|
123
|
+
## 6. Where files live
|
|
124
|
+
|
|
125
|
+
Everything Leg writes goes under `LEG_HOME` (default `~/.leg`):
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
~/.leg/
|
|
129
|
+
sessions/<session-id>/
|
|
130
|
+
session.json the live record the board renders
|
|
131
|
+
events.jsonl the timeline
|
|
132
|
+
control.json board to runner requests
|
|
133
|
+
hook.log what Claude Code's hooks sent
|
|
134
|
+
claude-settings.json the per-session --settings file
|
|
135
|
+
agy.log agy's --log-file, agy sessions only
|
|
136
|
+
usage/<agent>--<account>.json
|
|
137
|
+
accounts/<agent>/<name>/ extra logins (see configuration.md)
|
|
138
|
+
landings.jsonl every Land, for the landed-on-trunk list
|
|
139
|
+
board.log the board server's output
|
|
140
|
+
harness/ the portable harness (only after leg harness enable):
|
|
141
|
+
bundle/, harness-state.json, backups/, history.jsonl
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
In the repo you run in, Leg writes `.leg/` (session notes, `RESUME.md` and
|
|
145
|
+
one `RESUME-<session-id>.md` per hand-off) and `.context-handoffs/` (the
|
|
146
|
+
bundles). Both are added to `.git/info/exclude`, so they never show up in
|
|
147
|
+
`git status`.
|
|
148
|
+
|
|
149
|
+
`leg uninstall --yes` removes `~/.leg` and nothing else.
|
|
150
|
+
|
|
151
|
+
## Carry your working environment too (optional)
|
|
152
|
+
|
|
153
|
+
By default a hand-off carries the task. `leg harness enable` makes it carry
|
|
154
|
+
the working environment as well: the rules, identity, hooks, skills,
|
|
155
|
+
subagents, slash commands, MCP servers and permissions of the client you
|
|
156
|
+
configure, rendered into the client the hand-off lands on. The first run
|
|
157
|
+
detects your clients, captures the source, prints what each client will
|
|
158
|
+
receive and what it cannot, and writes only after you say yes (or `--yes`).
|
|
159
|
+
Then `leg harness status` shows the state per client, and every hand-off
|
|
160
|
+
prepares the destination under the policy you chose. Read
|
|
161
|
+
[harness.md](harness.md) before enabling it: it says exactly which files are
|
|
162
|
+
written and how they are protected.
|
|
163
|
+
|
|
164
|
+
## 7. Pipelines (extras)
|
|
165
|
+
|
|
166
|
+
Version 0.1 worked the other way round: you dropped a task card on the board
|
|
167
|
+
and Leg ran the agents headless in a git worktree, one per card, with a
|
|
168
|
+
fallback chain, path leases, a scheduler and a merge queue. All of that still
|
|
169
|
+
works and lives below the Terminals lane. It is no longer the way in.
|
|
170
|
+
|
|
171
|
+
### Preflight
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
leg up --dry
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
One row per dependency (node, git, `context-handoff-bundle`, each registered
|
|
178
|
+
adapter) with `ok` or `missing`, then exit without spawning anything. A
|
|
179
|
+
`missing` adapter only matters if a card's chain names it.
|
|
180
|
+
|
|
181
|
+
### Start the board with the scheduler
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
npm start
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
`npm start` runs the same preflight, boots the board server on
|
|
188
|
+
`http://127.0.0.1:4747`, opens it, and streams prefixed, redacted logs. Ctrl-C
|
|
189
|
+
stops the server and any agent it started. From another terminal: `npm run
|
|
190
|
+
stop` (which runs `leg down`).
|
|
191
|
+
|
|
192
|
+
### A card from the board
|
|
193
|
+
|
|
194
|
+
Click **New card**. The form asks for:
|
|
195
|
+
|
|
196
|
+
- **Repo path**: an absolute path to a local git repository (at least one
|
|
197
|
+
commit).
|
|
198
|
+
- **Task**: the text prompt every agent leg gets.
|
|
199
|
+
- **Pipeline**: `factory`, `build`, `build-land`, or `custom JSON`.
|
|
200
|
+
- **Chain**: one row per adapter, in fallback order.
|
|
201
|
+
- **Leases** (comma separated path globs), **Trunk branch** (default `main`),
|
|
202
|
+
**Land mode** (`ff` or `pr`), **Test command**, **Title**.
|
|
203
|
+
- **Queue immediately**: leave it checked to start the card right away.
|
|
204
|
+
|
|
205
|
+
### A card from the CLI
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
leg card add --repo <path-to-a-git-repo> --task "Add a LICENSE file" --chain claude --queue
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Other flags `card add` accepts: `--pipeline <preset|file>`, `--mode
|
|
212
|
+
<adapter>=<mode>`, `--max-turns <adapter>=<n>`, `--leases <glob,glob>`,
|
|
213
|
+
`--trunk <branch>`, `--land-mode ff|pr`, `--test-command "<cmd>"`, `--title
|
|
214
|
+
"<text>"`, `--slug <id>`, `--approve <adapter,...>`.
|
|
215
|
+
|
|
216
|
+
The command prints the new card id. Show it, or run it directly:
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
leg card show <card-id>
|
|
220
|
+
leg card run <card-id>
|
|
221
|
+
leg card events <card-id>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Try a pipeline with no real agent
|
|
225
|
+
|
|
226
|
+
The `fake` adapter drives `bin/fake-agent.mjs`, a stand-in CLI, so you can see
|
|
227
|
+
a full run without a subscription login:
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
leg card add --repo <path-to-a-git-repo> --task "demo" --chain fake --fake-mode fake=limit --queue
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
`FAKE_MODE` (set per adapter with `--fake-mode <adapter>=<mode>`) picks its
|
|
234
|
+
behaviour: `success`, `incomplete`, `limit`, `stall`, `auth`, `crash`,
|
|
235
|
+
`no_progress`, and the land-demo modes `break-test` / `fix-test` /
|
|
236
|
+
`resolve-rebase`. A chain of two fake adapters (`--chain
|
|
237
|
+
fake-claude,fake-codex --fake-mode "fake-claude=limit,fake-codex=success"`)
|
|
238
|
+
shows a full handoff; see [DEMO.md](DEMO.md) for the walkthrough with
|
|
239
|
+
screenshots.
|
|
240
|
+
|
|
241
|
+
### Where a card's files live
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
~/.leg/
|
|
245
|
+
cards/<card-id>/
|
|
246
|
+
card.json the card's current state
|
|
247
|
+
events-<actor-key>.jsonl one append-only file per writer
|
|
248
|
+
driver.lock the process driving the card, only while it runs
|
|
249
|
+
unsynced.jsonl DashClaw records to retry (`ledger sync`), if any
|
|
250
|
+
runs/<n>/
|
|
251
|
+
run.json this run's status, outcome, exit code
|
|
252
|
+
prompt.txt the exact prompt sent to the adapter
|
|
253
|
+
out.log the adapter's stdout
|
|
254
|
+
err.log the adapter's stderr
|
|
255
|
+
supervisor.log the runner's own log for this run
|
|
256
|
+
locks/land-<hash>.json the merge queue's turn, one per repo root, while a land runs
|
|
257
|
+
ACTIVE.md generated summary of open cards
|
|
258
|
+
leg.pid written by `leg up`, removed on stop
|
|
259
|
+
scheduler.pid written by `leg scheduler start`
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
A card's own git worktree lives in the repo it targets, not under
|
|
263
|
+
`LEG_HOME`: `<repo>/.leg-worktrees/<card-id>` on branch `leg/<card-id>`.
|
|
264
|
+
|
|
265
|
+
## Next
|
|
266
|
+
|
|
267
|
+
- [concepts.md](concepts.md): sessions, accounts, usage windows, the
|
|
268
|
+
interactive hand-off, then cards, stations, chains, leases and the land
|
|
269
|
+
station.
|
|
270
|
+
- [board-guide.md](board-guide.md): every element of the board.
|
|
271
|
+
- [configuration.md](configuration.md): every environment variable.
|
|
272
|
+
- [harness.md](harness.md): the portable harness, what moves between agents and what does not.
|