|
| 1 | +# CLI Conventions (`openab`) |
| 2 | + |
| 3 | +One rule governs the `openab` command surface: |
| 4 | + |
| 5 | +> **Top-level verbs act on the bot itself; noun namespaces act on |
| 6 | +> subsystems.** |
| 7 | +
|
| 8 | +## Top-level verbs — the bot's own lifecycle and control |
| 9 | + |
| 10 | +``` |
| 11 | +openab run [-c config] # run the bot (default command) |
| 12 | +openab setup # interactive config wizard |
| 13 | +openab set <key> <value> # ctl-socket write to the running bot (e.g. thread.name) |
| 14 | +openab get <key> # ctl-socket read from the running bot |
| 15 | +``` |
| 16 | + |
| 17 | +These are frozen. New top-level verbs require the same justification: the |
| 18 | +action must target the bot process itself, not a component of it. |
| 19 | + |
| 20 | +## Noun namespaces — subsystems and add-ons |
| 21 | + |
| 22 | +``` |
| 23 | +openab mcp <addon> <action> [flags] |
| 24 | +# e.g. |
| 25 | +openab mcp gmail-native login |
| 26 | +openab mcp gmail-native serve --listen 127.0.0.1:8850 |
| 27 | +``` |
| 28 | + |
| 29 | +Everything that operates on a subsystem (MCP add-ons today; future |
| 30 | +subsystems follow the same shape) lives under a noun namespace. Namespace |
| 31 | +subcommands are for **interactive and operational actions** (logins, |
| 32 | +standalone/dev serving, diagnostics). |
| 33 | + |
| 34 | +## Long-running serving is config-driven, not CLI-driven |
| 35 | + |
| 36 | +Production serving belongs to `openab run` + `config.toml` — presence of a |
| 37 | +section enables the component (e.g. `[mcp]` starts the OAB MCP Facade |
| 38 | +listener). CLI `serve` actions under a namespace exist for development and |
| 39 | +standalone hosts, never as the production path (see #1451 for the |
| 40 | +facade-only run mode). |
| 41 | + |
| 42 | +## Precedent |
| 43 | + |
| 44 | +This mirrors how mature CLIs converged: `docker` keeps top-level lifecycle |
| 45 | +shortcuts (`docker run`) alongside management namespaces |
| 46 | +(`docker image ls`); `gh` scopes everything by noun (`gh pr create`, |
| 47 | +`gh auth login`). Mixed is fine — undocumented mixed is not. |
| 48 | + |
| 49 | +## Notes |
| 50 | + |
| 51 | +- `set`/`get` are semantically ctl-client operations; a purist rename |
| 52 | + (`openab ctl set`) is deliberately not pursued — they are shipped and |
| 53 | + scripted against. If purity is ever wanted, add aliases, never rename. |
| 54 | +- `openab-agent` is the coding agent + MCP *client* toolchain |
| 55 | + (`openab-agent mcp list|status|doctor|connect|login`); serving surfaces |
| 56 | + do not belong on it (#1451). |
0 commit comments