Skip to content

fix(cli): -q suppresses the --output "Wrote N bytes" status line - #2702

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2614-quiet-output-status-line
Oct 12, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2614-quiet-output-status-line

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2614

Problem

mcp-inspector --cli -q … --output <file> still printed Wrote N bytes (json) to <path> on stderr. -q is documented to suppress status lines, but the text-mode --output branch of emitResult never checked args.quiet.

Change

  • clients/cli/src/handlers/emit-result.ts: the confirmation line is only written when args.quiet is not set. The file is still written. --format json is unchanged: it reports the write through the stdout {"output": …} envelope.
  • clients/cli/__tests__/emit-result.test.ts: two tests. Without -q the line is printed. With -q stderr is empty and the file is still written.
  • clients/cli/README.md: notes that -q suppresses the confirmation.

Verification

npm run local:gate passes.

🤖 Generated with Claude Code

…2614)

In text mode, `--output` confirms the write with a status line on stderr.
`-q` is documented to suppress status lines, but this branch never checked
`args.quiet`. Gate it, and cover both paths in emit-result.test.ts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation matches the issue requirements and includes focused regression coverage.

0 open findings

What changed in this PR

Ensures CLI quiet mode suppresses the text-mode output-file status line without affecting file writes or JSON envelopes.

Changes:

  • Guards the stderr confirmation with !args.quiet.
  • Adds coverage for quiet and normal output behavior.
  • Documents the quiet-mode behavior.
File Description
clients/​cli/​src/​handlers/​emit-result.ts Suppresses the status line under -q.
clients/​cli/​__tests__/​emit-result.test.ts Tests status suppression and file persistence.
clients/​cli/​README.md Documents -q behavior with --output.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 1 was clean (0 inline comments, nothing in the headline, no suppressed comments).

@cliffhall
cliffhall merged commit 3d4511c into v2/main Oct 12, 2026
8 checks passed
@cliffhall
cliffhall deleted the v2/fix/2614-quiet-output-status-line branch October 12, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: -q does not suppress the "Wrote N bytes … to <path>" status line when --output is used

2 participants