Interview Prep/Python for DevOps/OS, filesystem, subprocess & CLIs

What makes a CLI tool "pipeline-friendly"?

IntermediateConceptOS, filesystem, subprocess & CLIs
Answer
  • Data on stdout, logs and progress on stderr.
  • Meaningful exit codes: 0 ok, 1 error, 2 usage or "findings found" (documented).
  • Machine-readable output option (--format json) alongside human output.
  • Non-interactive by default: no prompts when stdin is not a TTY; --yes to confirm.
  • Configuration via flags and env vars, no hidden state files.
  • --dry-run for anything destructive, idempotent when re-run.
  • No colors when output is not a TTY (NO_COLOR respected).
All Python for DevOps questions Roadmap: Python for automation

More on OS, filesystem, subprocess & CLIs