Skip to content

Add TOON output format for token-efficient agent consumption#10

Open
quinnmil wants to merge 2 commits intomainfrom
9-toon-output
Open

Add TOON output format for token-efficient agent consumption#10
quinnmil wants to merge 2 commits intomainfrom
9-toon-output

Conversation

@quinnmil
Copy link
Contributor

@quinnmil quinnmil commented Mar 25, 2026

Summary

  • Adds --toon flag for TOON output (spec) using the official toon-go encoder
  • Auto-enables TOON (instead of JSON) when stdout is piped — zero-config for LLM agents
  • Introduces structuredOutput() helper replacing per-command if jsonOutput checks
  • --json still works and takes precedence when explicitly set

Test plan

  • scout apps list — human-readable table in terminal
  • scout apps list --toon — TOON output in terminal
  • scout apps list --json — JSON output (unchanged)
  • scout apps list | cat — TOON output (auto-enabled)
  • scout apps list --json | cat — JSON output (explicit override)
  • go test ./... passes

Closes #9

🤖 Generated with Claude Code

Add --toon flag and auto-enable TOON (instead of JSON) when stdout is
piped, making CLI output more token-efficient for LLM agents by default.
Uses the official toon-go encoder. All commands updated to use a unified
structuredOutput() helper that handles both --json and --toon paths.

Closes #9

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@quinnmil quinnmil linked an issue Mar 25, 2026 that may be closed by this pull request
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Add TOON output format for token-efficient agent consumption

1 participant