143 Unix Pipeline Style CLI Tools

143 Unix Pipeline Style CLI Tools

Good CLI tools are composable components in a data stream.

Pipeline Contract

stdin -> transform/filter -> stdout
          diagnostics -> stderr

Respecting this contract allows your tool to fit naturally into shell workflows.

Behavioral Expectations

  • Read from stdin when explicit files are not provided.
  • Emit data-only output on stdout.
  • Emit warnings/errors on stderr.
  • Return meaningful exit codes for automation.

Output Modes

Offer stable machine-readable output (JSON/TSV) and human-readable output separately. Mixing them breaks scriptability.

Why This Matters

Pipeline-compatible design turns one-off utilities into reusable operational building blocks.