Skip to content

feat(output): add global --output flag for JSON/table format#4

Merged
sirambrosio merged 1 commit into
mainfrom
feat/json-output
Apr 20, 2026
Merged

feat(output): add global --output flag for JSON/table format#4
sirambrosio merged 1 commit into
mainfrom
feat/json-output

Conversation

@sirambrosio
Copy link
Copy Markdown
Contributor

Summary

  • Adds --output <format> global option to the bsp program (values: table, json)
  • In json mode: table() emits JSON.stringify(data, null, 2); success, warn, info are silenced so stdout is clean JSON
  • beo resolve emits the full BEO object as JSON
  • ieo get emits the full IEO object as JSON
  • ieo list emits the IEO array as JSON
  • Implements setOutputFormat / getOutputFormat in output.ts — no global state leakage between tests

Usage

bsp --output json resolve andre.bsp
bsp --output json ieo get <ieoId>
bsp --output json ieo list --type LAB

Test plan

  • bsp resolve andre.bsp → formatted table output (unchanged default)
  • bsp --output json resolve andre.bsp → raw JSON to stdout, no ANSI decorators
  • bsp --output json ieo list → JSON array
  • bsp --output table resolve andre.bsp → same as default
  • Pipe: bsp --output json resolve andre.bsp | jq .beo_id

🤖 Generated with Claude Code

Adds a global --output flag to the bsp CLI. When set to json, commands
emit clean JSON to stdout — suitable for scripting and piping. Affected
commands: beo resolve, ieo get, ieo list. All human-readable decorators
(success, warn, info) are suppressed in json mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sirambrosio sirambrosio merged commit bf6069b into main Apr 20, 2026
3 checks passed
@sirambrosio sirambrosio deleted the feat/json-output branch April 20, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant