feat(output): default to json instead of toon for non-TTY stdout (DX-5867)#44
Merged
johnpmitsch merged 1 commit intoJun 24, 2026
Conversation
…5867) When stdout is not a terminal (piped / scripted / agent invocations), the default output format is now JSON instead of TOON. JSON is understood by virtually every downstream tool and parses cleanly, making it the safer universal default for the piped path; TOON is newer and not as widely supported, so it's a poor fit as the implicit default. TOON remains fully supported via `--format toon` and the config file. Only the default-when-unset changes; the CLI flag > config > built-in default ordering is unchanged, and the TTY default stays `table`. Syncs the module docs, `--format` help, the embedded `qn agent context` guide, and the README (intro example, formats table, config defaults) to describe JSON as the non-TTY default.
ErikTech
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes JSON the default output format when stdout is not a terminal (piped / scripted / agent invocations), replacing TOON. JSON is understood by virtually every downstream tool and parses cleanly, so it's the safer universal default for the piped path. TOON is newer and not as widely supported, so it's a poor implicit default.
TOON stays fully supported via
--format toonand the config file. Only the default-when-unset changes: the CLI flag > config > built-in default ordering is unchanged, and the TTY default staystable.The only behavioral edit is one branch in
resolve_output_inner(src/context.rs). Everything else syncs docs to the new state: module docs,--formathelp, the embeddedqn agent contextguide, and the README (intro example, formats table, config defaults).Test plan
cargo test— all pass (117+ tests), including the updateddefault_is_json_when_stdout_is_not_a_ttyand a newconfig_toon_overrides_non_tty_defaultcargo clippy --all-targets -- -D warnings— cleancargo fmt --check— cleancargo build --release— cleanqn agent contextandqn --helpboth report JSON as the non-TTY defaultCloses DX-5867