Commit 221b6f6
authored
feat: redesign CLI session modes and add session management commands (#105)
## Summary
- **Default CLI behavior changed**: `ox "task"` now creates an async
session, prints the session ID to stdout, and exits immediately.
Progress output goes to stderr for scriptability (`SESSION=$(ox
"task")`).
- **New flags**: `--follow`/`-f` (stream agent output),
`--interactive`/`-i` (launch TUI), `--agent-mode`/`-M`
(async/interactive/plan)
- **New `session` command** (alias: `container`) with subcommands: `rm`,
`stop`, `attach`, `ps`, `logs`, `info`, `clean`
- **Internal rename**: `submitMode` → `agentMode` throughout codebase
for consistency with `--agent-mode` flag
## CLI Examples
```bash
ox "some task" # detached: print session ID, exit
ox -f "some task" # follow: stream output, exit with agent code
ox -i "some task" # interactive: launch TUI with auto-submit
ox -M plan "some task" # start plan-mode agent, print ID, exit
ox session ps # list sessions
ox session info <name> # show session details
ox session logs -f <name> # follow session logs
ox session stop <name> # stop a session
ox session rm <name> # remove a session
```
## Flag Compatibility Matrix
| Terminal Mode | Agent Mode | Valid? |
|---|---|---|
| detached (default) | async (default) | Yes |
| detached | interactive | Yes |
| detached | plan | Yes |
| `--follow` | async | Yes |
| `--follow` | interactive | **Error** |
| `--follow` | plan | **Error** |
| `--interactive` | interactive (implied) | Yes |
| `--interactive` | async | Yes |
| `--interactive` | plan | Yes |
| `-f` + `-i` | — | **Error** |
## Changes
- Rename `SubmitMode`/`submitMode` to `AgentMode`/`agentMode` across 11
files
- Replace `--print`/`-p` with `--follow`/`-f`, add `--agent-mode`/`-M`
- Gate PR instructions on `agentMode === 'async'` (not `detach` flag)
- Add `resolveSession()` helper for session lookup by name/ID
- Add `session` command with 7 subcommands sharing infrastructure with
`sessions`
- Export shared utilities from `sessions.tsx` (`sessionsAction`,
`cleanAction`, `printTable`)1 parent c47c808 commit 221b6f6
File tree
23 files changed
+1090
-369
lines changed- patches
- src
- commands
- components
- services
- sandbox
- stores
23 files changed
+1090
-369
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| |||
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
88 | | - | |
| 94 | + | |
89 | 95 | | |
90 | | - | |
| 96 | + | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
| 100 | + | |
94 | 101 | | |
95 | 102 | | |
96 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
97 | 119 | | |
98 | 120 | | |
99 | 121 | | |
100 | | - | |
| 122 | + | |
101 | 123 | | |
102 | 124 | | |
103 | | - | |
| 125 | + | |
104 | 126 | | |
105 | 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 | + | |
106 | 160 | | |
107 | 161 | | |
108 | 162 | | |
| |||
229 | 283 | | |
230 | 284 | | |
231 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
232 | 290 | | |
233 | 291 | | |
234 | 292 | | |
235 | | - | |
236 | | - | |
| 293 | + | |
| 294 | + | |
237 | 295 | | |
238 | | - | |
239 | | - | |
| 296 | + | |
| 297 | + | |
240 | 298 | | |
241 | 299 | | |
242 | | - | |
| 300 | + | |
243 | 301 | | |
244 | | - | |
245 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
246 | 362 | | |
247 | 363 | | |
248 | 364 | | |
| |||
258 | 374 | | |
259 | 375 | | |
260 | 376 | | |
261 | | - | |
| 377 | + | |
262 | 378 | | |
263 | 379 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | 380 | | |
271 | 381 | | |
272 | 382 | | |
273 | 383 | | |
274 | 384 | | |
275 | 385 | | |
| 386 | + | |
| 387 | + | |
276 | 388 | | |
277 | 389 | | |
278 | | - | |
279 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
280 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
281 | 414 | | |
282 | 415 | | |
283 | 416 | | |
| |||
286 | 419 | | |
287 | 420 | | |
288 | 421 | | |
| 422 | + | |
289 | 423 | | |
| 424 | + | |
290 | 425 | | |
291 | 426 | | |
292 | 427 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
0 commit comments