Skip to content

No global machine-readable output flag #1670

Description

@armamini

The issue

Right now the CLI only prints human-friendly text. That's great when you're
reading it in a terminal, but painful the moment you try to automate anything.

If I want a pipeline to fail on a bad config, I run circleci config validate
and get a paragraph of text back. To act on it in a script, I have to grep the
output and hope the wording never changes. It does change, and then my
automation quietly breaks. The exit code tells me pass or fail, but not what
went wrong in a way a machine can read.

What I'd like

A single global flag: -o, --output json (default stays text, so nothing
breaks). In JSON mode, commands return a predictable shape like:

{
  "status": "error",
  "errors": [
    { "code": "invalid_key", "message": "unexpected key 'jobz'", "path": ".jobz", "line": 4 }
  ],
  "warnings": []
}

Nice-to-have: honor a CIRCLECI_CLI_OUTPUT=json env var so CI can default to it
without adding the flag everywhere.

Commands it should cover

config validate, config pack, orb validate, orb list, context list,
and the runner commands.

Why it matters

It turns config validate into a reliable CI gate and lets dashboards or
ChatOps surface line-level errors without brittle text parsing. Small change,
big quality-of-life win for anyone running the CLI in automation.

BR,
Arman.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions