cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 29 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 worktree
	ExitUnknownWorkspace = 4
	ExitInvalidConfig    = 5
	ExitRefused          = 6 // the plan refused: conflict or uncertainty, do not blindly retry
)

Exit codes. They are part of the command contract: automation branches on them, so they must stay stable as commands are added.

View Source
const OutputSchemaVersion = 1

OutputSchemaVersion versions the JSON envelope. Human output is not a compatibility contract; this is. Bump it only for a breaking change to the structure below.

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