Skip to content

Add --quiet/-q flag to suppress non-data output#168

Open
titouanmathis wants to merge 1 commit into
mainfrom
cli-quiet-flag
Open

Add --quiet/-q flag to suppress non-data output#168
titouanmathis wants to merge 1 commit into
mainfrom
cli-quiet-flag

Conversation

@titouanmathis

Copy link
Copy Markdown
Contributor

Closes #162

Adds a global --quiet / -q flag that suppresses spinners, status messages, and decorative output. Only data goes to stdout, errors to stderr.

  • Spinners become no-ops when quiet
  • success(), warning(), info() become no-ops
  • output() still works (data flows through)
  • error() still writes to stderr (without emoji)
  • Documented in global --help

All tests pass (1603 tests across 97 files).

Implements global --quiet/-q flag that:
- Suppresses spinners, status messages, and decorative output
- Only allows data to go to stdout, errors to stderr
- For JSON + quiet: outputs just resource data without status wrapper
- Error messages still appear but without emoji in quiet mode

Changes:
- Add quiet/q fields to CommandOptions interface
- Update OutputFormatter to accept quiet parameter and suppress messages
- Add successWithData method for proper JSON quiet mode handling
- Update createSpinner to return no-op spinner when quiet
- Add --quiet/-q to CLI help text
- Update time command handlers to use new successWithData method
- Add comprehensive tests for quiet behavior

Closes #162

Co-authored-by: Claude <claude@anthropic.com>
@titouanmathis titouanmathis added the enhancement New feature or request label Mar 25, 2026
@codecov

codecov Bot commented Mar 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.42%. Comparing base (bab1669) to head (17d520b).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/cli/src/output.ts 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
+ Coverage   97.40%   97.42%   +0.01%     
==========================================
  Files         237      237              
  Lines        8008     8031      +23     
  Branches     2563     2582      +19     
==========================================
+ Hits         7800     7824      +24     
+ Misses        203      202       -1     
  Partials        5        5              
Flag Coverage Δ
unittests 97.42% <96.77%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: Add --quiet flag to suppress non-data output

1 participant