cli-dispatch-is-flat-dict-lookup
IN premise
CLI dispatch uses a flat `commands` dict mapping subcommand strings to `cmd_*` handler functions — no plugin system or subclass hierarchy.
Summary
The CLI routes commands through a simple dictionary that maps command names directly to handler functions. This means adding or changing commands is straightforward but there is no extension mechanism — all commands must be defined in one place, and there is no way for external code to register new ones.
Dependents
These beliefs depend on this one:
- cli-is-deterministic-and-stream-correct — The CLI achieves full scriptability through three deterministic properties: flat dict dispatch with no dynamic plugin resolution, binary exit codes (0 success, 1 error) with no ambiguous intermediate codes, and clean stream separation (diagnostics to stderr, results to stdout)
- cli-is-pure-delegation-layer — The CLI is a pure delegation layer: every handler dispatches through a flat dict lookup to API functions with no business logic, producing binary exit codes and correct stream separation — a complete separation of formatting from computation.
Details
| Source | entries/2026/04/29/reasons_lib-cli.md |