Add --silent flag to suppress non-error output#12
Conversation
Co-authored-by: fbosch <6979916+fbosch@users.noreply.github.com>
|
@coderabbitai full review |
📝 WalkthroughWalkthroughThe pull request introduces a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Actions performedFull review triggered. |
commit: |
There was a problem hiding this comment.
Pull request overview
Adds a --silent flag to the CLI to suppress non-error, human-oriented output while keeping JSON output and error messages unchanged.
Changes:
- Extended CLI parsing and options (
CliOptions,parseArgs) to support asilent: booleanflag, with tests verifying parsing and default behavior. - Introduced a module-level silent mode toggle in
src/cli/ui.tsand wired all UI components (line,header,item,step) to respect it. - Updated the main CLI entrypoint to expose
--silentin help text and activate silent mode early inmain(), while leaving--jsonand stderr error output unaffected.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cli-parse.test.js | Adds tests ensuring parseArgs correctly parses --silent and defaults silent to false when absent. |
| src/cli/ui.ts | Introduces _silentMode and setSilentMode, and gates all user-facing UI helpers on the silent flag. |
| src/cli/types.ts | Extends CliOptions with a non-optional silent: boolean flag. |
| src/cli/parse-args.ts | Registers the --silent CLI option and plumbs it into CliOptions.silent. |
| src/cli/index.ts | Documents --silent in help, calls setSilentMode(parsed.options.silent) early in main(), and leaves JSON and error output behavior unchanged. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds
--silentflag to suppress informational output while preserving error messages on stderr.Implementation
src/cli/ui.ts): Introduced module-level_silentModeflag checked by all output functions (line,header,item,step)silent: booleantoCliOptions, parsed inparse-args.ts, activated early inmain()viasetSilentMode()--jsonoutput unaffected by--silent(explicit structured output request honored)Usage
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Summary by CodeRabbit
Release Notes
New Features
--silentCLI flag to suppress output when running commands.Tests