Skip to content

Commit 746bec2

Browse files
committed
docs: commander prompt/context endpoints + self-updating hint
1 parent e2dd592 commit 746bec2

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

COMMANDER_CLAUDE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ The Command Registry provides semantic, self-documenting commands. **This is the
1616
curl -s http://localhost:4000/api/commander/capabilities | jq
1717
```
1818

19+
### Get Live Context (Recommended)
20+
```bash
21+
# See current UI/session context (selected queue item, sessions, workspace, etc.)
22+
curl -s http://localhost:4000/api/commander/context | jq
23+
```
24+
25+
### Get Runtime Help Prompt (Self-Updating)
26+
```bash
27+
# Plain-text prompt generated from the command registry + current context
28+
curl -s http://localhost:4000/api/commander/prompt
29+
```
30+
1931
### Execute Commands
2032
```bash
2133
# General syntax

server/commanderService.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,24 @@ class CommanderService {
148148
logger.info('Starting Claude in Commander', { mode, yolo, cmd });
149149
this.sendInput(cmd + '\n');
150150

151+
// Always provide a stable, self-updating control surface pointer so Commander
152+
// never needs manual prompt edits when new commands are added.
153+
setTimeout(() => {
154+
try {
155+
const port = process.env.ORCHESTRATOR_PORT || 3000;
156+
const baseUrl = `http://localhost:${port}`;
157+
this.sendInput(
158+
`\n# Orchestrator control (self-updating)\n` +
159+
`# - Commands: curl -s ${baseUrl}/api/commander/capabilities | jq\n` +
160+
`# - Execute: curl -s ${baseUrl}/api/commander/execute -H 'Content-Type: application/json' -d '{\"command\":\"...\",\"params\":{...}}'\n` +
161+
`# - Context: curl -s ${baseUrl}/api/commander/context | jq\n` +
162+
`# - Help: curl -s ${baseUrl}/api/commander/prompt\n\n`
163+
);
164+
} catch {
165+
// ignore
166+
}
167+
}, 1200);
168+
151169
// For fresh starts, send greeting after Claude initializes
152170
if (mode === 'fresh') {
153171
setTimeout(() => {

0 commit comments

Comments
 (0)