Documentation
¶
Overview ¶
Package cli implements the agentmod command dispatcher: flag parsing, help text, and exit codes. Subcommands register here as they land.
Index ¶
Constants ¶
const ( ExitOK = 0 // success ExitError = 1 // generic error ExitNotInProject = 2 // not inside an agentmod project where one is required ExitValidation = 3 // validation/verification failure (doctor, snapshot verify) )
Exit codes (IMPLEMENTATION_PLAN §3).
Variables ¶
var Version = devVersion
Functions ¶
Types ¶
type Env ¶
type Env struct {
Getwd func() (string, error)
LookupEnv func(key string) (string, bool)
GOOS string
Stdin io.Reader
Executable func() (string, error)
Now func() time.Time
}
Env carries the parts of the process environment the CLI reads, so tests can substitute fakes without touching real process state. GOOS is the runtime.GOOS value, injected so platform-specific findings (the macOS Keychain note) are testable on any host; fakes leave it "" (treated as not-darwin) unless a test sets it explicitly. Stdin is the process stdin (consumed by `guard claude-bash`); fakes leave it nil (treated as empty) unless a test sets it. Executable resolves the running agentmod binary's absolute path (consumed by init's guard wiring); fakes return a fixed fake path so wiring is exercised without a real binary. Now is the clock (consumed by handoff create for the manifest timestamp and default snapshot name); fakes return a fixed instant so output is deterministic.