Documentation
¶
Overview ¶
Package cli implements the acd-ctx command line (spec §18.7, §19.8). Every command is a function of its arguments, its streams and its environment, so tests drive it without a process. cmd/acd-ctx calls Run.
Index ¶
Constants ¶
const ( ExitOK = 0 ExitFail = 1 ExitUsage = 2 )
Exit codes. ExitUsage is for malformed command lines.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IO ¶
type IO struct {
// Ctx stops long-running commands (mcp). Nil means context.Background.
Ctx context.Context
// Stdin is read by confirmations and by the MCP server.
Stdin io.Reader
// Stdout carries command output and the MCP protocol.
Stdout io.Writer
// Stderr carries diagnostics, warnings, prompts and client logs.
Stderr io.Writer
// LookupEnv reads environment variables (ACD_CTX_*, XDG_*, HOME). Nil
// means os.LookupEnv.
LookupEnv func(key string) (string, bool)
// Cwd is the working directory used for project detection. Empty means
// the process working directory.
Cwd string
// Version is reported to the proxy and to MCP clients.
Version string
}
IO carries the streams and environment of one invocation. Zero fields take the process defaults; Stdin, Stdout and Stderr default to empty or discarded streams, so pass os.Stdin and friends from main.