feat: added CLI settings command - #176
Open
manchuck wants to merge 1 commit into
Open
Conversation
manchuck
marked this pull request as ready for review
August 6, 2026 20:32
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds global/user-configurable UX preferences (color, emoji, redaction) and new vonage settings subcommands to view/update those preferences, then wires parts of the CLI to respect them.
Changes:
- Introduces settings commands (
settings show|set) and new CLI flags (--color,--emoji,--redact) - Updates UX helpers (
redact,printEmoji) and logging middleware to consider CLI/settings values - Exports additional settings utilities and adds a new output-preferences utility module
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ux/redact.js | Reads CLI/settings to decide whether to redact output |
| src/ux/printEmoji.js | Adds CLI/settings-based emoji enabling/disabling |
| src/utils/settings.js | Exposes settings mutators and improves settings load/save behavior |
| src/utils/outputPreferences.js | New module to centralize output preference resolution and apply color preference |
| src/middleware/log.js | Attempts to toggle winston colorization based on argv/settings |
| src/commands/settings/show.js | New command to display global settings |
| src/commands/settings/set.js | New command to write a global setting |
| src/commands/settings.js | New command group for settings |
| bin/vonage.js | Adds UX CLI flags for color/emoji/redact |
| tests/middleware/log.test.js | Adds a test around disabling colors |
| tests/middleware/config.test.js | Small formatting change in test helper |
| tests/commands/settings/settings.show.test.js | Adds tests for settings show |
| tests/commands/settings/settings.set.test.js | Adds tests for settings set |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+27
to
+32
| format: | ||
| format.combine( | ||
| color ? format.colorize() : undefined, | ||
| format.padLevels(), | ||
| format.simple(), | ||
| ), |
Comment on lines
+141
to
+144
| test('Will disable chalk colors when color output is turned off', async () => { | ||
| const originalArgv = process.argv; | ||
| const originalLevel = chalk.level; | ||
| process.argv = ['node', 'vonage', '--no-color']; |
Comment on lines
+152
to
+154
| setupLog({}); | ||
|
|
||
| assert.strictEqual(chalk.level, 0); |
Comment on lines
+33
to
+37
| return { | ||
| color: overrides.color ?? !settings.noColor, | ||
| emoji: overrides.emoji ?? !settings.noEmoji, | ||
| redact: overrides.redact ?? !settings.neverRedact, | ||
| }; |
| * @return { string } - The emoji or empty string | ||
| */ | ||
| export const printEmoji = (emoji) => isPlain ? '' : emoji + ' '; | ||
| export const printEmoji = (emoji) => showEmoji ? emoji + ' ' : ''; |
| @@ -0,0 +1,56 @@ | |||
| import chalk from 'chalk'; | |||
|
|
||
| const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key); | ||
|
|
||
| export const getCLIOutputOverrides = (argv = process.argv) => { |
| }; | ||
| }; | ||
|
|
||
| export const resolveOutputPreferences = ( |
| chalk.level = defaultChalkLevel; | ||
| }; | ||
|
|
||
| export const applyColorPreference = (preferences = getRuntimeOutputPreferences()) => { |
dragonmantank
previously approved these changes
Aug 11, 2026
manchuck
force-pushed
the
enhanced-settings
branch
3 times, most recently
from
August 18, 2026 20:34
9ebbe5c to
d6e55a2
Compare
manchuck
force-pushed
the
enhanced-settings
branch
from
August 18, 2026 20:36
d6e55a2 to
98645c5
Compare
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.
No description provided.