CircleCI-Public / CircleCI-Public/circleci-cli
No global machine-readable output flag
- Dominant language
- Go
- Stars
- 459
- Forks
- 255
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 59
Description
## 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:
```json
{
"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.
Contributor guide
Research direction
Start by locating the CLI's global option handling and the implementations of config validate, config pack, orb validate, orb list, context list, and runner commands. Compare their current text output and error handling, then define the shared JSON response behavior; done means the flag works across the listed commands while text remains the default and the requested status, errors, and warnings shape is returned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100