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
Many cloud-CLI invocations return a top-level JSON array of uniform flat objects: gh pr list --json …, kubectl get pods -o json, aws ec2 describe-instances --output json, gcloud compute instances list --format=json. JSON repeats every field name on every row. Today CloudHandler only strips noise; the heavy redundant field repetition stays in context.
Token-Oriented Object Notation (TOON, https://github.com/toon-format/toon) is a schema-aware JSON replacement that declares the schema once in a header and lists rows CSV-style. Independent benchmarks report ~40% fewer tokens on this exact shape — typically more.
Concrete example, raw gh pr list --json number,title,state:
Strictly lossless-or-reject: returns None for any non-uniform / nested / out-of-order / unsmaller input.
CloudHandler calls it when the command requests JSON (--json, -o json, -ojson, --output json, --output=json, --format json, --format=json, -f json); otherwise pipes through to the existing pipeline unchanged.
Tradeoff
Slightly more code on the cloud handler path (~340 LoC including tests).
Zero new runtime deps.
Never makes a scenario worse: if the TOON output isn't smaller than the input, we return None and fall back.
Out of scope
NDJSON streams from docker ps --format '{{json .}}' — follow-up.
cargo metadata --format-version 1 — nested by design, not worth TOON.
Area
Handler (src/commands/*)
Compression pipeline (src/strategies/)
Confirmations
I've searched existing issues and this isn't a duplicate.
This respects the zero-runtime-dependency rule (only libc allowed in Cargo.toml).
Activity
feat(cloud): TOON re-encoder for JSON-array outputs (gh, kubectl, aws…
feat(cloud): TOON re-encoder for JSON-array outputs (gh, kubectl, aws…
feat(cloud): TOON re-encoder for JSON-array outputs (gh, kubectl, aws…
feat(cloud): TOON re-encoder for JSON-array outputs (gh, kubectl, aws…