overlord-cli 0.2605201134.0 → 0.2605210944.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.
Files changed (43) hide show
  1. package/package.json +2 -1
  2. package/plugins/antigravity/scripts/overlord-mcp.mjs +4 -13
  3. package/plugins/claude/README.md +20 -4
  4. package/plugins/claude/commands/add-objectives.md +1 -0
  5. package/plugins/claude/commands/connect.md +3 -1
  6. package/plugins/claude/commands/create.md +3 -1
  7. package/plugins/claude/commands/load.md +4 -1
  8. package/plugins/claude/commands/prompt.md +19 -0
  9. package/plugins/claude/commands/record-work.md +2 -1
  10. package/plugins/claude/commands/spawn.md +7 -4
  11. package/plugins/claude/hooks/hooks.json +1 -0
  12. package/plugins/claude/skills/overlord-ticket/SKILL.md +30 -213
  13. package/plugins/claude/skills/overlord-ticket/reference/cli.md +127 -0
  14. package/plugins/claude/skills/overlord-ticket/reference/context.md +22 -0
  15. package/plugins/claude/skills/overlord-ticket/reference/devices.md +18 -0
  16. package/plugins/claude/skills/overlord-ticket/reference/mcp.md +9 -0
  17. package/plugins/claude/skills/overlord-ticket/reference/shell-escaping.md +16 -0
  18. package/plugins/cursor/.cursor-plugin/plugin.json +13 -1
  19. package/plugins/cursor/commands/add-objectives.md +1 -0
  20. package/plugins/cursor/commands/connect.md +9 -2
  21. package/plugins/cursor/commands/create.md +2 -1
  22. package/plugins/cursor/commands/load.md +10 -2
  23. package/plugins/cursor/commands/prompt.md +12 -0
  24. package/plugins/cursor/commands/record-work.md +12 -4
  25. package/plugins/cursor/commands/spawn.md +12 -2
  26. package/plugins/cursor/rules/overlord-local.mdc +3 -1
  27. package/plugins/cursor/scripts/overlord-mcp.mjs +1 -1
  28. package/plugins/cursor/skills/overlord-ticket/SKILL.md +33 -185
  29. package/plugins/cursor/skills/overlord-ticket/reference/cli.md +127 -0
  30. package/plugins/cursor/skills/overlord-ticket/reference/context.md +22 -0
  31. package/plugins/cursor/skills/overlord-ticket/reference/devices.md +18 -0
  32. package/plugins/cursor/skills/overlord-ticket/reference/mcp.md +9 -0
  33. package/plugins/cursor/skills/overlord-ticket/reference/shell-escaping.md +16 -0
  34. package/plugins/overlord/.codex-plugin/hooks.json +1 -0
  35. package/plugins/overlord/.codex-plugin/plugin.json +3 -3
  36. package/plugins/overlord/README.md +25 -4
  37. package/plugins/overlord/scripts/overlord-mcp.mjs +2 -3
  38. package/plugins/overlord/skills/overlord-ticket/SKILL.md +50 -187
  39. package/plugins/overlord/skills/overlord-ticket/reference/cli.md +127 -0
  40. package/plugins/overlord/skills/overlord-ticket/reference/context.md +22 -0
  41. package/plugins/overlord/skills/overlord-ticket/reference/devices.md +18 -0
  42. package/plugins/overlord/skills/overlord-ticket/reference/mcp.md +9 -0
  43. package/plugins/overlord/skills/overlord-ticket/reference/shell-escaping.md +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overlord-cli",
3
- "version": "0.2605201134.0",
3
+ "version": "0.2605210944.0",
4
4
  "description": "Overlord CLI — launch AI agents on tickets from anywhere",
5
5
  "homepage": "https://www.ovld.ai/docs/",
6
6
  "type": "module",
@@ -16,6 +16,7 @@
16
16
  "plugins/"
17
17
  ],
18
18
  "scripts": {
19
+ "prepack": "node ../../scripts/render-agent-plugins.mjs --check",
19
20
  "postinstall": "node bin/_cli/postinstall.mjs || true"
20
21
  },
21
22
  "engines": {
@@ -927,20 +927,11 @@ function parseMessages(chunk) {
927
927
  if (headerEnd === -1) break;
928
928
 
929
929
  const headerText = buffer.subarray(0, headerEnd).toString('utf8');
930
- const headers = Object.fromEntries(
931
- headerText.split('\r\n').map(line => {
932
- const separatorIndex = line.indexOf(':');
933
- return [
934
- line.slice(0, separatorIndex).trim().toLowerCase(),
935
- line.slice(separatorIndex + 1).trim()
936
- ];
937
- })
938
- );
939
-
940
- const contentLength = Number(headers['content-length']);
941
- if (!Number.isFinite(contentLength)) {
930
+ const lengthMatch = headerText.match(/Content-Length:\s*(\d+)/i);
931
+ if (!lengthMatch) {
942
932
  throw new Error('Missing Content-Length header');
943
933
  }
934
+ const contentLength = Number(lengthMatch[1]);
944
935
 
945
936
  const totalLength = headerEnd + 4 + contentLength;
946
937
  if (buffer.length < totalLength) break;
@@ -995,7 +986,7 @@ async function runProtocol(tool, args) {
995
986
  cwd: process.cwd(),
996
987
  env: {
997
988
  ...process.env,
998
- AGENT_IDENTIFIER: process.env.AGENT_IDENTIFIER ?? 'antigravity-overlord-plugin'
989
+ AGENT_IDENTIFIER: process.env.AGENT_IDENTIFIER ?? 'antigravity'
999
990
  },
1000
991
  maxBuffer: 20 * 1024 * 1024
1001
992
  },
@@ -4,17 +4,21 @@ Claude Code plugin that exposes the Overlord local ticket workflow to any Claude
4
4
 
5
5
  ## What ships
6
6
 
7
+
8
+
7
9
  - `skills/overlord-ticket/SKILL.md` — durable attach → update → ask → deliver workflow.
8
10
  - `commands/{connect,load,create,prompt}.md` — slash commands for session routing and ticket creation.
9
- - `hooks/hooks.json` + `scripts/permission-hook.sh` — PermissionRequest notifier that calls `ovld protocol permission-request`.
10
- - If `ovld` reports `OVERLORD_URL` is unreachable, the workflow tells agents to request permission escalation or network access before retrying.
11
- - `userConfig` for `overlord_url`. Current installs should authenticate with `ovld auth repair` first when a shared session already exists, then `ovld auth login` or Overlord Desktop; env vars remain optional overrides for remote shells, CI, and explicit OAuth token injection.
11
+ - `hooks/hooks.json` + `scripts/permission-hook.sh` — PermissionRequest notifier that posts to `/api/protocol/permission-request` on the Overlord platform.
12
+ - `userConfig` for `overlord_url`. Auth is expected to come from shared OAuth credentials or explicit `OVERLORD_ACCESS_TOKEN` + `OVERLORD_ORGANIZATION_ID` env vars.
13
+
14
+
12
15
 
13
16
  ## Requirements
14
17
 
15
18
  - Overlord CLI (`ovld`) on `PATH`. See the Overlord docs / Settings → Agents & MCP.
16
19
  - `TICKET_ID` is exported automatically when a Claude session is launched from Overlord; outside that launch, set it manually before calling the permission hook.
17
20
 
21
+
18
22
  ## Install (local dev)
19
23
 
20
24
  ```bash
@@ -23,14 +27,23 @@ claude --plugin-dir /absolute/path/to/overlord/plugins/claude
23
27
 
24
28
  ## Install (marketplace)
25
29
 
30
+
26
31
  Once published:
27
32
 
33
+
34
+
35
+
28
36
  ```bash
29
37
  claude plugin marketplace add cooperativ/overlord-marketplace
30
38
  claude plugin install overlord@cooperativ
31
39
  ```
32
40
 
33
- Older plugin versions prompted for `overlord_url` and a legacy token at install time. The current hook goes through `ovld protocol`, so the CLI resolves auth from env vars or the shared `~/.ovld` credentials written by CLI/Desktop login.
41
+
42
+ The plugin prompts for `overlord_url` at install time. Authentication should come from `ovld auth repair` first when a shared session already exists, then `ovld auth login`, Overlord Desktop, or explicit OAuth env vars in the launched shell.
43
+
44
+
45
+
46
+
34
47
 
35
48
  ## Namespaced components
36
49
 
@@ -40,3 +53,6 @@ Inside Claude Code the components are surfaced with the plugin prefix:
40
53
  - commands → `/overlord:connect`, `/overlord:load`, `/overlord:create`, `/overlord:prompt`
41
54
 
42
55
  Prompts generated by Overlord (see `lib/overlord/ticket-prompt.ts`) already reference these names in `bundle` instruction mode.
56
+
57
+
58
+
@@ -12,3 +12,4 @@ Run:
12
12
  `ovld protocol add-objectives --ticket-id <ticket_id> --objectives-json '[{"objective":"Step one"},{"objective":"Step two"}]'`
13
13
 
14
14
  Index 0 is the first newly added objective to execute; later indexes queue after it.
15
+
@@ -9,6 +9,7 @@ Connect this session to another Overlord ticket.
9
9
  Treat `$ARGUMENTS` as the target ticket ID.
10
10
  If no ticket ID was provided, ask the user for one and stop.
11
11
 
12
+
12
13
  Run:
13
14
  `ovld protocol connect --ticket-id <ticketId>`
14
15
 
@@ -16,4 +17,5 @@ Rules:
16
17
  - Use `connect`, not `attach`.
17
18
  - Do not load extra ticket context unless the user explicitly asks for it.
18
19
  - After the command succeeds, report the returned `SESSION_KEY` and confirm that future updates should use that ticket.
19
- - If `ovld` reports `OVERLORD_URL` is unreachable, stop and request permission escalation or network access before retrying.
20
+
21
+
@@ -6,6 +6,7 @@ disable-model-invocation: true
6
6
 
7
7
  Create a draft Overlord ticket from the user's request.
8
8
 
9
+
9
10
  Use `$ARGUMENTS` as the input.
10
11
  If it already contains flags such as `--title`, `--priority`, `--project-id`, or `--execution-target`, pass those flags through after `ovld protocol create --agent claude-code`.
11
12
  Otherwise, treat `$ARGUMENTS` as the objective text and run:
@@ -14,4 +15,5 @@ Otherwise, treat `$ARGUMENTS` as the objective text and run:
14
15
  If no objective was provided, ask the user for one and stop.
15
16
 
16
17
  After the command succeeds, report the new `TICKET_ID`.
17
- - If `ovld` reports `OVERLORD_URL` is unreachable, stop and request permission escalation or network access before retrying.
18
+
19
+
@@ -6,9 +6,11 @@ disable-model-invocation: true
6
6
 
7
7
  Load Overlord ticket context without attaching to the ticket.
8
8
 
9
+
9
10
  Treat `$ARGUMENTS` as the target ticket ID.
10
11
  If no ticket ID was provided, ask the user for one and stop.
11
12
 
13
+
12
14
  Run:
13
15
  `ovld protocol load-context --ticket-id <ticketId>`
14
16
 
@@ -16,4 +18,5 @@ Rules:
16
18
  - Use `load-context`, not `attach`.
17
19
  - Do not create or switch sessions.
18
20
  - Summarize the returned ticket details, history, artifacts, and shared context for the user.
19
- - If `ovld` reports `OVERLORD_URL` is unreachable, stop and request permission escalation or network access before retrying.
21
+
22
+
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Create a new Overlord ticket from the current conversation
3
+ argument-hint: <objective or raw flags>
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Create a new Overlord ticket from the user's request.
8
+
9
+
10
+ Use `$ARGUMENTS` as the input.
11
+ If it already contains flags such as `--title`, `--priority`, `--project-id`, or `--execution-target`, pass those flags through after `ovld protocol prompt --agent claude-code`.
12
+ Otherwise, treat `$ARGUMENTS` as the objective text and run:
13
+ `ovld protocol prompt --agent claude-code --objective "<objective>"`
14
+
15
+ If no objective was provided, ask the user for one and stop.
16
+
17
+ After the command succeeds, report the new `TICKET_ID` and `SESSION_KEY`.
18
+
19
+
@@ -25,4 +25,5 @@ Rules:
25
25
  - Do NOT use this for in-progress work. Use `/prompt` for that.
26
26
  - The CLI validates that every changed git-tracked file is represented in `changeRationales` unless `--skip-file-change-check` is passed.
27
27
  - If project resolution fails, re-run with `--project-id <id>` or `--personal`.
28
- - If `ovld` reports `OVERLORD_URL` is unreachable, stop and request permission escalation or network access before retrying.
28
+
29
+
@@ -1,17 +1,20 @@
1
1
  ---
2
- description: Create a new Overlord ticket from the current conversation
2
+ description: (Deprecated — use /prompt instead) Create a new Overlord ticket
3
3
  argument-hint: <objective or raw flags>
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
+ This command is deprecated. Use `/overlord:prompt` instead.
8
+
7
9
  Create a new Overlord ticket from the user's request.
8
10
 
9
11
  Use `$ARGUMENTS` as the input.
10
- If it already contains flags such as `--title`, `--priority`, `--project-id`, or `--execution-target`, pass those flags through after `ovld protocol spawn --agent claude-code`.
12
+ If it already contains flags such as `--title`, `--priority`, `--project-id`, or `--execution-target`, pass those flags through after `ovld protocol prompt --agent claude-code`.
11
13
  Otherwise, treat `$ARGUMENTS` as the objective text and run:
12
- `ovld protocol spawn --agent claude-code --objective "<objective>"`
14
+ `ovld protocol prompt --agent claude-code --objective "<objective>"`
13
15
 
14
16
  If no objective was provided, ask the user for one and stop.
15
17
 
16
18
  After the command succeeds, report the new `TICKET_ID` and `SESSION_KEY`.
17
- - If `ovld` reports `OVERLORD_URL` is unreachable, stop and request permission escalation or network access before retrying.
19
+
20
+
@@ -24,3 +24,4 @@
24
24
  ]
25
25
  }
26
26
  }
27
+
@@ -19,251 +19,68 @@ Use this mode when the prompt already contains a ticket ID or explicitly says th
19
19
  6. If blocked, call `ovld protocol ask` and stop.
20
20
  7. Deliver last with `ovld protocol deliver`, including `changeRationales` for each meaningful behavioral file change.
21
21
 
22
- ### Mode 1 Reference
22
+ For full command syntax, flags, phase values, and event types see [reference/cli.md](reference/cli.md).
23
23
 
24
- Attach:
24
+ ## Objective Submission vs Execution
25
25
 
26
- ```bash
27
- ovld protocol attach --ticket-id $TICKET_ID
28
- ```
26
+ Discussing or otherwise opening a ticket from within a chat should cause the draft objective to be marked **submitted** — this signals the ticket is in active discussion with an agent, but not yet being executed. Only an explicit order to execute (e.g. "execute this", "do this", "start working on it") should cause you to **attach** to the ticket and trigger execution.
29
27
 
30
- In a git workspace, `attach` automatically creates a local git checkpoint for each executing objective before work begins, stored under `refs/overlord/checkpoints/<objectiveId>`. Pass `--skip-checkpoint` only when intentionally bypassing local provenance.
28
+ - **Discussing / opening a ticket** → `ovld protocol discuss-objective --ticket-id $TICKET_ID` (draft → submitted, no session).
29
+ - **Creating a ticket** via `ovld protocol create` keeps the objective in `draft` state.
30
+ - **Explicitly ordered to execute** → `ovld protocol attach --ticket-id $TICKET_ID` (draft/submitted → executing, session begins).
31
31
 
32
- Update:
33
-
34
- ```bash
35
- ovld protocol update --session-key <sessionKey> --ticket-id $TICKET_ID --summary "What you did and why." --phase execute
36
- ```
37
-
38
- When the summary contains backticks, quotes, or other special shell characters, pipe it via stdin to prevent shell interpretation:
39
-
40
- ```bash
41
- ovld protocol update --session-key <sessionKey> --ticket-id $TICKET_ID --summary-file - --phase execute <<'EOF'
42
- What you did and why — including `backticks`, "quotes", and $variables are all safe here.
43
- EOF
44
- ```
45
-
46
- Supported `--phase` values:
47
-
48
- - `draft`
49
- - `execute`
50
- - `review`
51
- - `deliver`
52
- - `complete`
53
- - `blocked`
54
- - `cancelled`
55
-
56
- These are hardcoded CLI-supported values for the `--phase` flag. They are not user-defined phase types.
57
-
58
- Event types:
59
-
60
- - `update` for standard progress updates
61
- - `user_follow_up` for human follow-up messages after the initial ticket when the automatic hook is unavailable
62
- - `alert` for warnings or non-blocking issues
63
-
64
- Ask when blocked:
65
-
66
- ```bash
67
- ovld protocol ask --session-key <sessionKey> --ticket-id $TICKET_ID --question "Specific question for the PM."
68
- ```
69
-
70
- Deliver:
71
-
72
- ```bash
73
- ovld protocol deliver --session-key <sessionKey> \
74
- --ticket-id $TICKET_ID \
75
- --summary "Narrative: what you did, next steps." \
76
- --artifacts-json '[{"type":"next_steps","label":"Next steps","content":"..."}]' \
77
- --change-rationales-json '[{"label":"Short reviewer title","file_path":"path/to/file.ts","summary":"What changed.","why":"Why it changed.","impact":"Behavioral impact.","hunks":[{"header":"@@ -10,6 +10,14 @@"}]}]'
78
- ```
79
-
80
- Use `--payload-json` when the full delivery object fits comfortably inline. For larger delivery payloads, prefer `--payload-file -` and stream the full JSON on stdin so no scratch file needs to be created or removed. If the summary contains special characters, use `--summary-file -` and pipe via a single-quoted heredoc (`<<'EOF'`) to prevent shell expansion. If you use `--payload-file`, `--artifacts-file`, or `--change-rationales-file` with a real path, treat that file as ephemeral scratch data outside the repository and remove it after delivery.
81
-
82
- Revert an objective:
83
-
84
- ```bash
85
- ovld protocol revert --objective-id <objective-id>
86
- ```
87
-
88
- `revert` restores the local working tree to the recorded objective checkpoint and saves a safety ref under `refs/overlord/safety/` first.
32
+ Do not attach to a ticket just because it was mentioned or opened in conversation. Only attach when the user clearly asks you to execute the work.
89
33
 
90
34
  ## Mode 2: Asked From Chat To Use Overlord
91
35
 
92
36
  Use this mode when the conversation starts normally and the user asks Claude to create, inspect, connect to, or otherwise use Overlord.
93
37
 
94
- 1. If the user wants to create tickets (and does not ask to start execution), run `ovld protocol create --agent claude-code --objectives-json '[{"objective":"..."}]'`.
38
+ 1. If the user wants to create tickets (and does not ask to start execution), use `/overlord:create` or run `ovld protocol create --agent claude-code --objectives-json '[{"objective":"..."}]'`.
95
39
  - When `--session-key` and `--ticket-id` are provided, it creates a follow-up draft.
96
40
  - When session flags are omitted, it resolves the project by matching current working directory (or `--working-directory`) to Overlord `local_working_directory`, then creates a standalone draft.
97
41
  - Pass multiple items in `--objectives-json` when creating ordered steps for the same feature or goal.
98
- 2. Default to `create` for new draft tickets. Only use `/overlord:prompt` or `ovld protocol prompt --agent claude-code --objectives-json '[{"objective":"..."}]'` when the user explicitly asks to create and execute immediately. If the work is already complete in chat and just needs to be recorded, use `ovld protocol record-work` instead.`prompt` creates the ticket in `execute` status and attaches immediately.
42
+ 2. Default to `create` for new tickets. Only use `/overlord:prompt` or `ovld protocol prompt --agent claude-code --objectives-json '[{"objective":"..."}]'` when the user explicitly asks to create and execute immediately.
43
+ `prompt` creates the ticket in `execute` status and attaches immediately.
99
44
  3. If the user already has a ticket ID and only wants to inspect it, use `/overlord:load` or run `ovld protocol load-context --ticket-id <ticket_id>`.
45
+ When you open or discuss an existing ticket that has a draft objective, submit it with `ovld protocol discuss-objective --ticket-id <ticket_id>`.
100
46
  4. If the user wants to route the current session onto an existing ticket by ID, use `/overlord:connect` or run `ovld protocol connect --ticket-id <ticket_id>`.
101
47
  5. If the user wants to establish a persistent session with a ticket by ID, use `/overlord:attach` or run `ovld protocol attach --ticket-id <ticket_id>`.
102
- 6. If the user wants to find a ticket but does not know the ID, use `ovld attach` for interactive ticket search and agent launch, or run `ovld protocol search-tickets --query "..." --status next-up,execute` and ask the user to confirm.
103
- 7. If you need other lifecycle commands or flags, run `ovld protocol help` and use the real subcommand list instead of guessing.
104
- 8. Once you attach to a ticket, switch back to Mode 1 and follow the full ticket lifecycle.
48
+ 6. If the user wants to find a ticket but does not know the ID, run `ovld protocol search-tickets --query "..." --status next-up,execute` and ask the user to confirm. For interactive ticket search and agent launch, prefer `ovld attach`.
49
+ 7. If you need to understand project routing before prompting, use `ovld protocol discover-project`.
50
+ 8. If you need other lifecycle commands or flags, run `ovld protocol help` and use the real subcommand list instead of guessing.
51
+ 9. Once you attach to a ticket, switch back to Mode 1 and follow the full ticket lifecycle.
105
52
 
106
- ## Recording Completed Work From Chat
107
-
108
- Use this when the user has had a working conversation with the agent (no Overlord ticket attached) and now wants to record the outcome as a ticket — both for review and to publish a feed post about it. This is **distinct from `create` and from `deliver`**:
109
-
110
- - `create` makes a draft ticket for *future* work; nothing happens yet.
111
- - `prompt` creates a ticket and starts an execution session.
112
- - `deliver` concludes an *attached* session; the ticket already exists.
113
- - `record-work` creates the ticket *and* completes the objective *and* triggers the feed-post generator in a single call, with no session left open.
114
-
115
- Do NOT use `record-work` for in-progress work. Use it only when the work is already done in the chat.
116
-
117
- ```bash
118
- ovld protocol record-work \
119
- --objectives-json '[{"objective":"User asked me to X; I did Y by..."}]' \
120
- --summary "Narrative for the feed post and reviewer." \
121
- --change-rationales-file -
122
- ```
123
-
124
- Or stream the full payload via stdin to avoid quote escaping:
125
-
126
- ```bash
127
- ovld protocol record-work --payload-file - <<'EOF'
128
- {
129
- "objectives": [{"objective": "..."}],
130
- "summary": "...",
131
- "artifacts": [{"type": "next_steps", "label": "...", "content": "..."}],
132
- "changeRationales": [{"label": "...", "file_path": "...", "summary": "...", "why": "...", "impact": "...", "hunks": [{"header": "@@ ..."}]}]
133
- }
134
- EOF
135
- ```
136
-
137
- Project resolution mirrors `prompt`/`create`: cwd is matched against the caller's `project_user.local_working_directory`. If no match:
138
-
139
- 1. **Ask the user for a `--project-id`** if the work is project-related. Show them a brief description of what you're about to record so they can pick the right project.
140
- 2. If the user confirms the work is not tied to any project, pass `--personal` to create a private ticket.
141
-
142
- Validation: in a git workspace, `record-work` checks that uncommitted changes are represented by `changeRationales` and rejects if they aren't (same check as `deliver`). Pass `--skip-file-change-check` only when intentionally bypassing.
143
-
144
- The hosted MCP tool name is `record_work` (snake_case). It accepts the same fields as the CLI but in camelCase JSON. Use `record_work` over the `create_ticket` + `attach` + `deliver` sequence whenever the work is already done.
53
+ For ticket creation examples, project discovery, and `--objectives-json` format see [reference/cli.md](reference/cli.md).
145
54
 
146
55
  ## Change Rationales
147
56
 
148
57
  Always include `changeRationales` when delivering. Optionally include them on updates during long-running work.
149
58
 
150
- Before delivering, make sure every meaningful git-tracked file change is represented in `changeRationales`; do not send `file_changes` as an artifact.
151
-
152
- These are structured protocol payloads that Overlord stores as first-class rows in the `file_changes` table. Prefer inline JSON or the dedicated command below. Use `--payload-json` for compact full delivery payloads, or `--payload-file -` when the JSON is larger or quote-sensitive so summary, artifacts, and change rationales stay in one JSON document without creating a temporary file. Ordinary deliver artifacts should use `next_steps`, `test_results`, `migration`, `note`, `url`, or `decision`.
153
-
154
- ```bash
155
- ovld protocol record-change-rationales --session-key <sessionKey> --ticket-id $TICKET_ID \
156
- --summary "Recorded rationale details for the latest code changes." --phase execute \
157
- --change-rationales-json '[{"label":"Add backoff","file_path":"lib/api.ts","summary":"Added retry.","why":"Transient failures.","impact":"Retries 3x.","hunks":[{"header":"@@ -22,4 +22,18 @@"}]}]'
158
- ```
159
-
160
- ```bash
161
- ovld protocol update --session-key <sessionKey> --ticket-id $TICKET_ID \
162
- --summary "Added retry logic." --phase execute \
163
- --change-rationales-json '[{"label":"Add backoff","file_path":"lib/api.ts","summary":"Added retry.","why":"Transient failures.","impact":"Retries 3x.","hunks":[{"header":"@@ -22,4 +22,18 @@"}]}]'
164
- ```
165
-
166
- Record only meaningful behavioral changes. Skip formatting-only noise.
167
-
168
- ## Project Discovery And Ticket Creation
59
+ Before delivering, make sure every meaningful git-tracked file change is represented in `changeRationales`; do not send `file_changes` as an artifact. Record only meaningful behavioral changes. Skip formatting-only noise.
169
60
 
170
- When creating tickets from within a repository:
171
-
172
- - Prefer `create` by default for draft ticket creation.
173
- - Use `prompt` only when the user explicitly asks to start execution immediately.
174
- - Both commands can resolve the project from the current working directory; use `--working-directory` to override.
175
- - Create multiple tickets when each prompt represents a different feature or goal.
176
- - Add objectives to the same ticket when each prompt is a sequential step toward the same feature or goal; use `ovld protocol add-objectives --ticket-id <ticket_id> --objectives-json '[{"objective":"..."}]'`.
177
- - `create`, `prompt`, and `record-work` require `--objectives-json` or `--objectives-file` with an ordered array of `{ "objective": "...", "title": "...", "autoAdvance": true }` objects. A single objective is just an array with one item.
178
-
179
- ```bash
180
- ovld protocol create --agent claude-code --objectives-json '[{"objective":"Capture follow-up work from this repository"}]'
181
- ovld protocol prompt --agent claude-code --objectives-json '[{"objective":"Implement feature X"}]' --priority medium
182
- ```
183
-
184
- ```bash
185
- ovld protocol add-objectives --ticket-id 1:899 --objectives-json '[{"objective":"Implement the API"},{"objective":"Add CLI docs"}]'
186
- ```
187
-
188
- To inspect project resolution explicitly:
189
-
190
- ```bash
191
- ovld protocol discover-project
192
- ```
193
-
194
- You can override with `--project-id` or `--working-directory` if needed.
195
-
196
- ### Resolving the project ID when you don't have one
197
-
198
- When you need a project ID for a protocol command and the ticket prompt did not supply one, resolve it in this order.
199
-
200
- **Locally (CLI inside a shell on the user's machine):**
201
-
202
- 1. `--project-id` if explicitly provided.
203
- 2. Otherwise, let the CLI match the current working directory (the default behavior of `create`, `prompt`, `discover-project`).
204
- 3. If working-directory resolution returns nothing, read `overlord.json` from the cwd (or any ancestor you have access to) and pass its project id via `--project-id`.
205
-
206
- **Over MCP (web agents and hosted tools, where the server cannot see the agent's cwd):**
207
-
208
- 1. `--project-id` / `projectId` if explicitly provided.
209
- 2. Read `overlord.json` from the directory the user is accessing and pass its project id as `projectId`.
210
- 3. As a last resort, try `workingDirectory` resolution.
211
-
212
- If `overlord.json` contains more than one project, show the user the project **names** from that file and ask which one to use before calling any protocol command — never silently pick one.
213
-
214
- ### Choosing `--execution-target`
215
-
216
- Pass `--execution-target agent` or `--execution-target human` (default: `human`) when creating tickets.
217
-
218
- - **`agent`** — any task an AI agent can complete in a computer environment: coding, internet research, document editing, data analysis, automated testing, etc.
219
- - **`human`** — any task requiring human presence or judgment: setting credentials or tokens in a third-party UI (e.g. Vercel, AWS), sending physical mail, making a product or business decision, physical-world actions.
220
-
221
- When in doubt, ask yourself: _can this be done entirely inside a terminal or browser by an AI without human intervention?_ If yes → `agent`. If it requires a human to log in, decide, or act in the real world → `human`.
222
-
223
- ## Context And Artifacts
224
-
225
- ```bash
226
- ovld protocol read-context --session-key <sessionKey> --ticket-id $TICKET_ID
227
- ovld protocol write-context --session-key <sessionKey> --ticket-id $TICKET_ID --key "key" --value '"json-value"'
228
- ovld protocol attachment-list --session-key <sessionKey> --ticket-id $TICKET_ID
229
- ovld protocol attachment-upload-file --session-key <sessionKey> --ticket-id $TICKET_ID --objective-id <objective-id> --file ./spec.pdf --content-type application/pdf
230
- ovld protocol attachment-download-url --session-key <sessionKey> --ticket-id $TICKET_ID --attachment-id <attachment-id>
231
- ```
232
-
233
- The `attach` and `load-context` responses already include `attachments` and `objectives` arrays — use those for `<attachment-id>` and `<objective-id>` values. Run `attachment-list` mid-session if new files have been uploaded since attach.
234
-
235
- Objective attachment uploads also expose two-step variants — `attachment-prepare-upload` and `attachment-finalize-upload` — for callers that need a signed URL directly. Prefer `attachment-upload-file` for one-shot uploads.
236
-
237
- "Artifacts" in `deliver` are the structured records an agent submits at delivery time (next_steps, test_results, migration, decision, note, url) — not user-uploaded files.
238
-
239
- ## Large Artifacts
240
-
241
- For large artifacts such as planning documents, architecture decisions, research summaries, or design documents: **save the full content as a markdown file in the linked repository, then summarize it in the artifact returned to the ticket.**
242
-
243
- - Save to a meaningful path in the repository (e.g., `ai/feature-plans/my-feature.md` for feature plans, `docs/decisions/my-decision.md` for architecture decision records).
244
- - Commit the file as part of the ticket's work so it appears in `changeRationales`.
245
- - In the delivery, include a `note` or `decision` artifact with a concise summary and the repository file path — not the full document content.
246
-
247
- This keeps the ticket feed readable while preserving the full document in version control where it can be reviewed, diffed, and referenced later.
248
-
249
- ## Defaults And Notes
250
-
251
- - API requires `agentIdentifier` and `connectionMethod` on attach/connect/prompt. The CLI defaults them to `claude-code`/`cli`; the MCP tool defaults to `mcp`. Override with `--agent` / `--method` when calling from a different runtime.
252
- - Hosted Overlord MCP (`/functions/v1/mcp`) uses the same canonical tool names as any local MCP shim that shells into `ovld protocol` (`attach`, `update`, `deliver`, `record_work`, …). Hosted calls use camelCase JSON keys (`ticketId`, `sessionKey`) matching `POST /api/protocol/*` bodies; the local shim uses snake_case keys mapped to CLI flags (`ticket_id`, `session_key`).
253
- - `permission-request` is invoked by the Claude Code permission hook installed by the bundle. Agents do not normally call it directly.
254
- - `record_change_rationales` (MCP) and `ovld protocol record-change-rationales` (CLI) both write to the same `file_changes` table. The dedicated CLI route is `POST /api/protocol/record-change-rationales`.
61
+ For the `record-change-rationales` command and `--change-rationales-json` payload shape see [reference/cli.md](reference/cli.md).
255
62
 
256
63
  ## Rules
257
64
 
258
65
  - Always attach first and always deliver last once you are on a ticket.
259
66
  - Use `ovld protocol` commands and the plugin's slash commands instead of ad hoc scripts.
260
67
  - Do not invent protocol subcommands. Use `ovld protocol help` when unsure.
68
+ - Include at least one progress update before delivering.
261
69
  - The `summary` in deliver is what the PM reads first, so write it as a narrative, not a command list.
262
- - When a summary or question contains backticks, `$vars`, or other shell-special characters, always use `--summary-file -` (or `--question-file -`) with a single-quoted heredoc (`<<'EOF'`). Never retry by stripping or escaping content — pipe stdin instead.
70
+ - When a summary or question contains backticks, `$vars`, or other shell-special characters, always use `--summary-file -` (or `--question-file -`) with a single-quoted heredoc (`<<'EOF'`). Never retry by stripping or escaping content — pipe stdin instead. See [reference/shell-escaping.md](reference/shell-escaping.md).
263
71
  - Use `write-context` for facts a future agent session should know.
264
72
  - If a protocol or MCP call fails with auth/session errors, run `ovld auth repair` yourself before asking the user to log in again or proceed without Overlord updates.
265
73
  - If you must run `ovld auth login`, always include `--organization-id <id>` — use the organization ID from the ticket prompt context to select the organization non-interactively and avoid a blocking TTY prompt.
266
74
  - Do not add or commit changes unless the user explicitly asks you to commit.
267
75
  - Delivery is the concluding step. After delivering, stop unless the user follows up or the ticket is reopened.
268
76
 
269
- <!-- version: 0.4.12 -->
77
+ ## Reference
78
+
79
+ - [reference/cli.md](reference/cli.md) — Full protocol command syntax, flags, phases, ticket creation, and project discovery
80
+ - [reference/mcp.md](reference/mcp.md) — MCP tool naming, key casing, hosted vs local shim defaults
81
+ - [reference/devices.md](reference/devices.md) — Device fingerprints, project resources, and `--execution-target`
82
+ - [reference/context.md](reference/context.md) — Shared state, attachments, and large artifact policy
83
+ - [reference/shell-escaping.md](reference/shell-escaping.md) — Heredoc stdin piping for special characters in summaries and payloads
84
+
85
+ <!-- version: 0.5.3 -->
86
+
@@ -0,0 +1,127 @@
1
+ # CLI Command Reference
2
+
3
+ ## Attach
4
+
5
+ ```bash
6
+ ovld protocol attach --ticket-id $TICKET_ID
7
+ ```
8
+
9
+ In a git workspace, `attach` automatically creates a local git checkpoint for each executing objective before work begins, stored under `refs/overlord/checkpoints/<objectiveId>`. Pass `--skip-checkpoint` only when intentionally bypassing local provenance.
10
+
11
+ ## Update
12
+
13
+ ```bash
14
+ ovld protocol update --session-key <sessionKey> --ticket-id $TICKET_ID --summary "What you did and why." --phase execute
15
+ ```
16
+
17
+ Supported `--phase` values:
18
+
19
+ - `draft`
20
+ - `execute`
21
+ - `review`
22
+ - `deliver`
23
+ - `complete`
24
+ - `blocked`
25
+ - `cancelled`
26
+
27
+ These are hardcoded CLI-supported values for the `--phase` flag. They are not user-defined phase types.
28
+
29
+ Event types:
30
+
31
+ - `update` for standard progress updates
32
+ - `user_follow_up` — only when the `UserPromptSubmit` hook is unavailable; the hook normally posts follow-ups to the activity feed
33
+ - `alert` for warnings or non-blocking issues
34
+
35
+ ## Ask
36
+
37
+ ```bash
38
+ ovld protocol ask --session-key <sessionKey> --ticket-id $TICKET_ID --question "Specific question for the PM."
39
+ ```
40
+
41
+ ## Deliver
42
+
43
+ ```bash
44
+ ovld protocol deliver --session-key <sessionKey> \
45
+ --ticket-id $TICKET_ID \
46
+ --summary "Narrative: what you did, next steps." \
47
+ --artifacts-json '[{"type":"next_steps","label":"Next steps","content":"..."}]' \
48
+ --change-rationales-json '[{"label":"Short reviewer title","file_path":"path/to/file.ts","summary":"What changed.","why":"Why it changed.","impact":"Behavioral impact.","hunks":[{"header":"@@ -10,6 +10,14 @@"}]}]'
49
+ ```
50
+
51
+ Use `--payload-json` when the full delivery object fits comfortably inline. For larger delivery payloads, prefer `--payload-file -` and stream the full JSON on stdin so no scratch file needs to be created or removed. If you use `--payload-file`, `--artifacts-file`, or `--change-rationales-file` with a real path, treat that file as ephemeral scratch data outside the repository and remove it after delivery.
52
+
53
+ Ordinary deliver artifacts should use `next_steps`, `test_results`, `migration`, `note`, `url`, or `decision`.
54
+
55
+ ## Revert
56
+
57
+ ```bash
58
+ ovld protocol revert --objective-id <objective-id>
59
+ ```
60
+
61
+ `revert` restores the local working tree to the recorded objective checkpoint and saves a safety ref under `refs/overlord/safety/` first.
62
+
63
+ ## Record Change Rationales
64
+
65
+ These are structured protocol payloads that Overlord stores as first-class rows in the `file_changes` table. Prefer inline JSON or the dedicated command below. Use `--payload-json` for compact full delivery payloads, or `--payload-file -` when the JSON is larger or quote-sensitive so summary, artifacts, and change rationales stay in one JSON document without creating a temporary file.
66
+
67
+ ```bash
68
+ ovld protocol record-change-rationales --session-key <sessionKey> --ticket-id $TICKET_ID \
69
+ --summary "Recorded rationale details for the latest code changes." --phase execute \
70
+ --change-rationales-json '[{"label":"Add backoff","file_path":"lib/api.ts","summary":"Added retry.","why":"Transient failures.","impact":"Retries 3x.","hunks":[{"header":"@@ -22,4 +22,18 @@"}]}]'
71
+ ```
72
+
73
+ ```bash
74
+ ovld protocol update --session-key <sessionKey> --ticket-id $TICKET_ID \
75
+ --summary "Added retry logic." --phase execute \
76
+ --change-rationales-json '[{"label":"Add backoff","file_path":"lib/api.ts","summary":"Added retry.","why":"Transient failures.","impact":"Retries 3x.","hunks":[{"header":"@@ -22,4 +22,18 @@"}]}]'
77
+ ```
78
+
79
+ ## Project Discovery And Ticket Creation
80
+
81
+ When creating tickets from within a repository:
82
+
83
+ - Prefer `create` by default for draft ticket creation.
84
+ - Use `prompt` only when the user explicitly asks to start execution immediately.
85
+ - Both commands can resolve the project from the current working directory; use `--working-directory` to override or `--project-id` to be explicit.
86
+ - Create multiple tickets when each prompt represents a different feature or goal.
87
+ - Add objectives to the same ticket when each prompt is a sequential step toward the same feature or goal; use `ovld protocol add-objectives --ticket-id <ticket_id> --objectives-json '[{"objective":"..."}]'`.
88
+ - `create`, `prompt`, and `record-work` require `--objectives-json` or `--objectives-file` with an ordered array of `{ "objective": "...", "title": "...", "autoAdvance": true }` objects. A single objective is just an array with one item.
89
+
90
+ ```bash
91
+ ovld protocol create --agent claude-code --objectives-json '[{"objective":"Capture follow-up work from this repository"}]'
92
+ ```
93
+
94
+ ```bash
95
+ ovld protocol prompt --agent claude-code --objectives-json '[{"objective":"Implement feature X"}]' --priority medium
96
+ ```
97
+
98
+ ```bash
99
+ ovld protocol add-objectives --ticket-id 1:899 --objectives-json '[{"objective":"Implement the API"},{"objective":"Add CLI docs"}]'
100
+ ```
101
+
102
+ To inspect project resolution explicitly:
103
+
104
+ ```bash
105
+ ovld protocol discover-project
106
+ ```
107
+
108
+ You can override with `--project-id` or `--working-directory` if needed.
109
+
110
+ ### Resolving the project ID when you don't have one
111
+
112
+ When you need a project ID for a protocol command and the ticket prompt did not supply one, resolve it in this order.
113
+
114
+ **Locally (CLI inside a shell on the user's machine):**
115
+
116
+ 1. `--project-id` if explicitly provided.
117
+ 2. Otherwise, let the CLI match the current working directory (the default behavior of `create`, `prompt`, `discover-project`).
118
+ 3. If working-directory resolution returns nothing, read `overlord.json` from the cwd (or any ancestor you have access to) and pass its project id via `--project-id`.
119
+
120
+ **Over MCP (web agents and hosted tools, where the server cannot see the agent's cwd):**
121
+
122
+ 1. `--project-id` / `projectId` if explicitly provided.
123
+ 2. Read `overlord.json` from the directory the user is accessing and pass its project id as `projectId`.
124
+ 3. As a last resort, try `workingDirectory` resolution.
125
+
126
+ If `overlord.json` contains more than one project, show the user the project **names** from that file and ask which one to use before calling any protocol command — never silently pick one.
127
+