Documentation
¶
Overview ¶
Package cli parses commands, chooses human or JSON presentation, and maps typed errors to exit codes. It contains no orchestration logic.
Index ¶
Constants ¶
const ( ExitOK = 0 ExitError = 1 // unexpected or I/O failure ExitUsage = 2 ExitAmbiguous = 3 // a workspace name matched more than one repository ExitUnknownWorkspace = 4 ExitInvalidConfig = 5 ExitRefused = 6 // the plan refused: conflict or uncertainty, do not blindly retry )
Exit codes. Automation branches on them, so they should not churn without a reason — but they are not frozen below 1.0. See docs/design.md §12.
const OutputSchemaVersion = 2
OutputSchemaVersion versions the JSON envelope. Below 1.0 nothing ProjectMux emits is a compatibility contract, this included; the field exists so that a break is expressible when there is something to break. Bump it only for a breaking change to the structure below.
Version 2 is the first such break: it renamed the workspace's path field from "worktree" to "repo_root", dropped "is_primary", and added "session". The rename is deliberate: a consumer that breaks loudly on a missing field is better than one that silently reads a repository root as a worktree path.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
Main runs one command and returns the process exit code. A failing single-operation command writes nothing to stdout, so callers can pipe stdout without filtering diagnostics out of it. The deliberate exception (stop/autostart spec §5): commands whose structured report IS the output — autostart's batch and a partially succeeding stop — write that report to stdout and then return a reportedError carrying only a one-line summary for stderr; nothing further reaches stdout.
Types ¶
This section is empty.