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.
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 validateand 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 staystext, so nothingbreaks). 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=jsonenv var so CI can default to itwithout adding the flag everywhere.
Commands it should cover
config validate,config pack,orb validate,orb list,context list,and the
runnercommands.Why it matters
It turns
config validateinto a reliable CI gate and lets dashboards orChatOps surface line-level errors without brittle text parsing. Small change,
big quality-of-life win for anyone running the CLI in automation.
BR,
Arman.