codeburn icon indicating copy to clipboard operation
codeburn copied to clipboard

Add --format json support to optimize and yield subcommands

Open marksebj opened this issue 6 months ago • 1 comments

Hi! Loving codeburn — wired it into my personal builder dashboard (launchctrl) and replaced a hand-rolled JSONL walker for daily / 7d / 30d cost numbers. The LiteLLM pricing accuracy + the multi-provider support are a real upgrade over what I had.

One thing blocking going further with the integration: optimize and yield don't currently support --format json, so I can't pipe their output into a static dashboard tile.

report and status both work great with --format json. Would it be possible to get the same flag on optimize and yield?

Specifically:

  • From optimize: the A-F grade + the list of waste findings (each with title, severity, the copy-paste fix) as a "Setup Health" tile next to the existing Burn Rate tile.
  • From yield: the productive-vs-reverted spend ratio as a small indicator on the dashboard.

Happy to PR this if you can point me at the right place — would just be threading the data structures the TUI already builds through a JSON serializer.

Thanks for the excellent tool.

marksebj avatar May 31 '26 09:05 marksebj

I can take this. Plan: add --format json to optimize and yield while keeping the existing terminal output as the default. For optimize, I’ll serialize the existing scan result/health grade/findings/actions rather than inventing a separate analysis path. For yield, I’ll expose the existing YieldSummary with the selected period label/range. I’ll add focused tests around the JSON shape and keep the schema conservative so dashboard integrations can depend on stable primitive fields.

barry166 avatar Jun 14 '26 15:06 barry166