Kimmy's Skills

relay — CLI Requirements

Source: ../cli.html · Surface: CLI · Mode: Greenfield · Case 02 Purpose: treat output as the interface: data, diagnostics, color, width, and exit codes are the product.

1. Problem and context

Who: developers deploying services from a laptop, a CI runner, or a pipe into another tool.

Jobs: deploy, check status, read failures, and script the same operations.

Constraints: the terminal may be interactive or a pipe; ANSI may be disabled; the width is unknown until runtime. The CLI controls the colors it sets only when it is allowed to set them.

2. Principles

Rule Rationale
stdout is data, stderr is commentary Piped output stays parseable; progress and warnings never corrupt the data stream.
Color is a runtime decision TTY, NO_COLOR, CI, and dumb terminals each change what is honest to emit; meaning never depends on color.
Width is read, not assumed Wrapping and truncation follow the real terminal; 80 columns is a guess, not a contract.
An error ends with the next command Recovery is part of the interface; “what happened / why / next” is one block.
Exit codes are a public API Scripts branch on them; they are specified and tested like any other contract.

3. Experience requirements

Sessions

Render whole transcripts for three real scenarios: success, failure, and a pipe. These are the CLI’s scenes, not isolated snippets.

Rendering modes

The same transcripts must adapt to:

Width

Errors

Exit codes

Code Meaning Typical cause
0 success operation completed
1 usage error unknown flag or missing argument
2 preflight failed environment refused the deploy
3 runtime failure remote system failed mid-operation
4 timeout operation exceeded --timeout

Machine mode

--json is a documented contract, not a debug dump:

4. Visual and content requirements

Color

Showcase tokens: background #12121a, foreground #d9d9e3, dim #8a8a9c, accent #a78bfa, ok #5dd47e, warn #e3b341, bad #f4807c.

Typography

5. Components and states

Every state must be reachable through the mode matrix.

6. Motion and accessibility

7. Verification requirements

8. Non-goals

9. Open questions