# Contract: Command-Line Interface **Feature**: 001-service-and-clients | **Version**: 1.0 | **Date**: 2026-09-20 The user-facing contract for the `midi-harbor` executable. Governed by FR-039 through FR-039h and FR-042. Every command here is a thin projection of the [IPC protocol](./ipc-protocol.md); the CLI holds no state of its own. --- ## 1. Invocation model One executable selects its role from its arguments (FR-039). There is no separate daemon binary. ``` midi-harbor # full build: launches the GUI # headless build: prints help and exits 0 (FR-039e) midi-harbor gui # launches the GUI explicitly; exits 2 on a headless build midi-harbor daemon # runs the engine in the foreground (FR-039a) ``` Running `daemon` registers nothing with the operating system, so it can be supervised externally or attached to a debugger. ### Global flags | Flag | Effect | |---|---| | `--json` | Machine-readable output on stdout (FR-039d) | | `--socket ` | Override the daemon socket path | | `-v`, `-vv` | Raise log verbosity to debug, then trace | | `--quiet` | Suppress non-error output | | `--no-color` | Disable styling; also honours `NO_COLOR` | `--json` emits a single JSON document per invocation on stdout. Diagnostics go to stderr, so `midi-harbor --json status | jq` is always safe. --- ## 2. Service management (FR-039f, FR-039g, FR-039h) ``` midi-harbor service install [--start] [--name