You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of the Agentic UX spec series. See sibling issues for related buckets.
Motivation
When the CLI is driven by an LLM agent (Claude Code, Cursor, Kiro, etc.), every byte of output is a token the agent pays for and a token that competes with the rest of its context window. Internal reports show engineer API spend jumping from ~$125/mo subscription to ~$1000/mo on raw API once agentic workflows take over (ai-token-economics channel, 2026-05-27). Our default JSON shapes were designed for humans + scripts, not for agents.
Spec
Make the default agent-facing output as compact as possible without losing fidelity.
Output format
Support --output toon (TOON — Token-Oriented Object Notation) alongside today's json/yaml/table. TOON reports ~40% token savings vs JSON for list-shaped data.
Minimal default schemas: list operations return ≤4 fields per item (e.g. id, name, severity, updated). Full record only on get or with --full.
Terse, stable field names: e.g. cost not totalAggregatedCostUsd. Stability is part of the contract — renames are breaking changes.
Projection: --fields a,b,c to pick exact fields, and --exclude for the inverse.
Content truncation with size hints: long text fields (descriptions, queries, error messages) truncate to N chars with a marker like {"value": "...", "_truncated": 4821}. Escape hatch: --full or --no-truncate.
Defaults
Lower default --limit in agent mode (e.g. 25 vs the current default).
Motivation
When the CLI is driven by an LLM agent (Claude Code, Cursor, Kiro, etc.), every byte of output is a token the agent pays for and a token that competes with the rest of its context window. Internal reports show engineer API spend jumping from ~$125/mo subscription to ~$1000/mo on raw API once agentic workflows take over (ai-token-economics channel, 2026-05-27). Our default JSON shapes were designed for humans + scripts, not for agents.
Spec
Make the default agent-facing output as compact as possible without losing fidelity.
Output format
--output toon(TOON — Token-Oriented Object Notation) alongside today'sjson/yaml/table. TOON reports ~40% token savings vs JSON for list-shaped data.tableas the human default; promote a compact format (TOON or minified JSON) as the agent-mode default (see sibling Agent-mode detection and behavior split #10).Schema
id, name, severity, updated). Full record only ongetor with--full.costnottotalAggregatedCostUsd. Stability is part of the contract — renames are breaking changes.--fields a,b,cto pick exact fields, and--excludefor the inverse.{"value": "...", "_truncated": 4821}. Escape hatch:--fullor--no-truncate.Defaults
--limitin agent mode (e.g. 25 vs the current default).References
--output json|yamlwith stable field names: https://grafana.com/blog/get-observability-in-the-terminal-for-you-and-your-agents-with-the-gcx-cli-tool/Open questions
jsonminified as the agent default?Acceptance criteria
--outputaccepts a compact format and emits documented stable shapes--fullreturns the wide record--fieldsand--excludework on every list/get operation--fulldisables truncation--limit