ADR-002: CLI I/O Separation, Exit Codes, and Flag Constraints

Status

Accepted

Date

2026-07-03

Context

For a CLI tool to be considered a “good UNIX citizen” and be highly scriptable, automated, and composable, it must adhere strictly to established POSIX and GNU command-line conventions.

Specifically, we must define:

  1. How output streams (stdout vs stderr) are handled.
  2. How exit codes map to specific operational and runtime conditions.
  3. How flag naming collisions (like --via vs -v for verbose) are avoided.
  4. How ambiguous package installation commands are resolved cleanly without forcing interactive prompts in headless script environments.

Decision

We will implement the following strict CLI conventions across the entire application:

1. I/O Separation & Redirection

2. Auto-Accept Flag (--yes / -y)

3. CLI Verbose & Version Flags

4. Package Manager Resolution Engine (3-Tier)

When a package or repository command is executed without the --manager flag, the engine resolves ambiguity in three sequential tiers:

5. Repository Aliases & Operations

To ensure interface consistency, the exact same aliases will apply to both packages and repositories:


Alternatives Considered

Relying on Shell Interception

Requiring --manager on All Write Commands


Consequences