magi-code 0.80.2

Repository-aware CLI coding agent for terminal work
Documentation
# CLI guide

Parses Clap arguments, validates launch modes, and hands work to runtime owners.

## Where to look

| Task | Path |
| --- | --- |
| Arguments, subcommands, startup routing | `mod.rs` |
| Cross-flag/mode validation | `validation.rs` |
| Session operations | `sessions.rs` |
| MCP commands | `mcp.rs` |
| Unix daemon start/status/stop/foreground | `mod.rs` (`DaemonCommand`), `../service/unix.rs` |

## Local rules

- Invalid usage is `AppError::Usage` (exit 2); runtime failure is `AppError::Runtime` (exit 1).
- `--update` runs standalone maintenance before TTY/config/provider/session initialization. TUI handoffs hold restart data only; update/restart follows terminal cleanup, app drop, writer-lease release and Herdr release.
- Validate combinations before session/worker/provider side effects. Service mode rejects normal-startup prompt, provider/model/auth, appearance, session-selection and subcommand inputs.
- Keep parsing in Clap types and cross-mode rules in `validation.rs`; runtime modules must not parse alternate argument grammars.
- Send overrides to configuration resolution rather than recreating provider/auth precedence in handlers.
- Default launch requires TTY stdin/stdout and hands off to worker-backed Mission Control. `--prompt` queues initial input; `--app service` provides non-interactive conversation.
- Session/MCP handlers delegate to their owners; errors must not expose credentials or raw sensitive responses.