ADR-005: CLI Architecture — Manifest Error Guards and Output Streams

Status

Accepted

Date

2026-07-11

Context

As the stamp CLI grew beyond simple install/remove commands, several architectural decisions needed to be made consistently:

  1. How to handle TOML manifest parsing errors without crashing diagnostic commands
  2. Where to direct human-readable vs. machine-readable output
  3. How to structure flag vs. subcommand boundaries for actions
  4. How to detect and respond to TTY vs. non-TTY environments

Decision

Manifest Error Guards

When the manifest TOML file is corrupted on disk:

Output Streams

Actions as Subcommands (Not Flags)

Actions that change system state or perform operations MUST be subcommands, not flags:

TTY Detection

Use isTerminal() bool helper that checks os.ModeCharDevice on the input reader:

Flag Short Forms

Every flag SHOULD have a single-character short form:

Alternatives Considered

Returning Errors from newAppContext (Previous Behavior)

Sending TTY Output to Stderr (Previous Behavior)

Consequences