Skip to content

Commit 0b0b33e

Browse files
authored
feat(cli): support --create-with-session-id and UUID session validation (#11859)
feat(cli): add create-with-session-id support rename public task id flag to --create-with-session-id validate session ids as UUIDs for create/resume and stdin start.taskId add integration coverage for create+resume loading correct session
1 parent 0db51d8 commit 0b0b33e

File tree

12 files changed

+548
-31
lines changed

12 files changed

+548
-31
lines changed

apps/cli/README.md

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,21 @@ Use `--print` for non-interactive execution and machine-readable output:
113113
```bash
114114
# Prompt is required
115115
roo --print "Summarize this repository"
116+
117+
# Create a new task with a specific session ID (UUID)
118+
roo --print --create-with-session-id 018f7fc8-7c96-7f7c-98aa-2ec4ff7f6d87 "Summarize this repository"
116119
```
117120

118121
### Stdin Stream Mode (`--stdin-prompt-stream`)
119122

120123
For programmatic control (one process, multiple prompts), use `--stdin-prompt-stream` with `--print`.
121-
Send one prompt per line via stdin:
124+
Send NDJSON commands via stdin:
122125

123126
```bash
124-
printf '1+1=?\n10!=?\n' | roo --print --stdin-prompt-stream --output-format stream-json
127+
printf '{"command":"start","requestId":"1","prompt":"1+1=?"}\n' | roo --print --stdin-prompt-stream --output-format stream-json
128+
129+
# Optional: provide taskId per start command
130+
printf '{"command":"start","requestId":"1","taskId":"018f7fc8-7c96-7f7c-98aa-2ec4ff7f6d87","prompt":"1+1=?"}\n' | roo --print --stdin-prompt-stream --output-format stream-json
125131
```
126132

127133
### Roo Code Cloud Authentication
@@ -170,26 +176,27 @@ Tokens are valid for 90 days. The CLI will prompt you to re-authenticate when yo
170176

171177
## Options
172178

173-
| Option | Description | Default |
174-
| --------------------------------- | --------------------------------------------------------------------------------------- | ---------------------------------------- |
175-
| `[prompt]` | Your prompt (positional argument, optional) | None |
176-
| `--prompt-file <path>` | Read prompt from a file instead of command line argument | None |
177-
| `-w, --workspace <path>` | Workspace path to operate in | Current directory |
178-
| `-p, --print` | Print response and exit (non-interactive mode) | `false` |
179-
| `--stdin-prompt-stream` | Read prompts from stdin (one prompt per line, requires `--print`) | `false` |
180-
| `-e, --extension <path>` | Path to the extension bundle directory | Auto-detected |
181-
| `-d, --debug` | Enable debug output (includes detailed debug information, prompts, paths, etc) | `false` |
182-
| `-a, --require-approval` | Require manual approval before actions execute | `false` |
183-
| `-k, --api-key <key>` | API key for the LLM provider | From env var |
184-
| `--provider <provider>` | API provider (roo, anthropic, openai, openrouter, etc.) | `openrouter` (or `roo` if authenticated) |
185-
| `-m, --model <model>` | Model to use | `anthropic/claude-opus-4.6` |
186-
| `--mode <mode>` | Mode to start in (code, architect, ask, debug, etc.) | `code` |
187-
| `--terminal-shell <path>` | Absolute shell path for inline terminal command execution | Auto-detected shell |
188-
| `-r, --reasoning-effort <effort>` | Reasoning effort level (unspecified, disabled, none, minimal, low, medium, high, xhigh) | `medium` |
189-
| `--consecutive-mistake-limit <n>` | Consecutive error/repetition limit before guidance prompt (`0` disables the limit) | `10` |
190-
| `--ephemeral` | Run without persisting state (uses temporary storage) | `false` |
191-
| `--oneshot` | Exit upon task completion | `false` |
192-
| `--output-format <format>` | Output format with `--print`: `text`, `json`, or `stream-json` | `text` |
179+
| Option | Description | Default |
180+
| --------------------------------------- | --------------------------------------------------------------------------------------- | ---------------------------------------- |
181+
| `[prompt]` | Your prompt (positional argument, optional) | None |
182+
| `--prompt-file <path>` | Read prompt from a file instead of command line argument | None |
183+
| `--create-with-session-id <session-id>` | Create a new task using the provided session ID (UUID) | None |
184+
| `-w, --workspace <path>` | Workspace path to operate in | Current directory |
185+
| `-p, --print` | Print response and exit (non-interactive mode) | `false` |
186+
| `--stdin-prompt-stream` | Read NDJSON control commands from stdin (requires `--print`) | `false` |
187+
| `-e, --extension <path>` | Path to the extension bundle directory | Auto-detected |
188+
| `-d, --debug` | Enable debug output (includes detailed debug information, prompts, paths, etc) | `false` |
189+
| `-a, --require-approval` | Require manual approval before actions execute | `false` |
190+
| `-k, --api-key <key>` | API key for the LLM provider | From env var |
191+
| `--provider <provider>` | API provider (roo, anthropic, openai, openrouter, etc.) | `openrouter` (or `roo` if authenticated) |
192+
| `-m, --model <model>` | Model to use | `anthropic/claude-opus-4.6` |
193+
| `--mode <mode>` | Mode to start in (code, architect, ask, debug, etc.) | `code` |
194+
| `--terminal-shell <path>` | Absolute shell path for inline terminal command execution | Auto-detected shell |
195+
| `-r, --reasoning-effort <effort>` | Reasoning effort level (unspecified, disabled, none, minimal, low, medium, high, xhigh) | `medium` |
196+
| `--consecutive-mistake-limit <n>` | Consecutive error/repetition limit before guidance prompt (`0` disables the limit) | `10` |
197+
| `--ephemeral` | Run without persisting state (uses temporary storage) | `false` |
198+
| `--oneshot` | Exit upon task completion | `false` |
199+
| `--output-format <format>` | Output format with `--print`: `text`, `json`, or `stream-json` | `text` |
193200

194201
## Auth Commands
195202

0 commit comments

Comments
 (0)