Problem Statement
specify workflow run, workflow resume, and workflow status emit only human-formatted (Rich) output. Terminal states — completed, paused, failed, aborted — and the run id are not available in any machine-readable form. External tooling and automation that drive workflows non-interactively currently have to scrape prose (e.g. parse a Status: line) or read the internal .specify/workflows/runs/<id>/state.json files, neither of which is a stable public contract.
Proposed Solution
Add an additive, opt-in --json flag to workflow run, workflow resume, and workflow status that prints a single machine-readable object to stdout, for example:
{ "run_id": "bb05423f", "workflow_id": "probe-clar", "status": "paused", "current_step_id": "ask" }
Design intent:
- General-purpose workflow reporting — not specific to any agent, orchestrator, or use case.
- Default human output is unchanged; JSON is emitted only when
--json is passed.
- No change to semantic exit codes.
- Does not expose internal state-file layout as a public contract; the JSON is a defined output surface.
This adds a new CLI argument, so per CONTRIBUTING.md ("introducing new ... arguments ... make sure that it was discussed and agreed upon by the project maintainers") I'm opening this as a discussion issue first and intentionally not attaching a PR until there's agreement on whether this is wanted and on the exact shape.
Alternatives Considered
- Parsing the human
Status: line from stdout — fragile and unversioned.
- Reading
.specify/workflows/runs/<id>/state.json directly — couples callers to internal layout.
Component
Specify CLI (initialization, commands)
AI Agent (if applicable)
None — engine/CLI feature, agent-independent.
Use Cases
- A non-interactive runner needs to detect that a run paused vs. completed vs. failed and react accordingly.
- CI capturing a run id for later
workflow resume/status without scraping prose.
Acceptance Criteria
--json on run/resume/status prints one parseable object including at least run_id, workflow_id, and status.
- Without
--json, output is byte-identical to today.
- Exit codes unchanged.
Additional Context
AI disclosure: this issue was drafted with AI assistance (Claude); the current output behaviour was verified against main before filing.
Problem Statement
specify workflow run,workflow resume, andworkflow statusemit only human-formatted (Rich) output. Terminal states —completed,paused,failed,aborted— and the run id are not available in any machine-readable form. External tooling and automation that drive workflows non-interactively currently have to scrape prose (e.g. parse aStatus:line) or read the internal.specify/workflows/runs/<id>/state.jsonfiles, neither of which is a stable public contract.Proposed Solution
Add an additive, opt-in
--jsonflag toworkflow run,workflow resume, andworkflow statusthat prints a single machine-readable object to stdout, for example:{ "run_id": "bb05423f", "workflow_id": "probe-clar", "status": "paused", "current_step_id": "ask" }Design intent:
--jsonis passed.This adds a new CLI argument, so per CONTRIBUTING.md ("introducing new ... arguments ... make sure that it was discussed and agreed upon by the project maintainers") I'm opening this as a discussion issue first and intentionally not attaching a PR until there's agreement on whether this is wanted and on the exact shape.
Alternatives Considered
Status:line from stdout — fragile and unversioned..specify/workflows/runs/<id>/state.jsondirectly — couples callers to internal layout.Component
Specify CLI (initialization, commands)
AI Agent (if applicable)
None — engine/CLI feature, agent-independent.
Use Cases
workflow resume/statuswithout scraping prose.Acceptance Criteria
--jsonon run/resume/status prints one parseable object including at leastrun_id,workflow_id, andstatus.--json, output is byte-identical to today.Additional Context
AI disclosure: this issue was drafted with AI assistance (Claude); the current output behaviour was verified against
mainbefore filing.