cli

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 31 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

View Source
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

func Main(args []string, stdout, stderr io.Writer) int

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL