Skip to content

feat: added CLI settings command - #176

Open
manchuck wants to merge 1 commit into
mainfrom
enhanced-settings
Open

feat: added CLI settings command#176
manchuck wants to merge 1 commit into
mainfrom
enhanced-settings

Conversation

@manchuck

@manchuck manchuck commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@manchuck
manchuck marked this pull request as ready for review August 6, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 thread src/middleware/log.js
Comment thread src/middleware/log.js
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,
};
Comment thread src/ux/printEmoji.js
* @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
dragonmantank previously approved these changes Aug 11, 2026
@manchuck
manchuck force-pushed the enhanced-settings branch 3 times, most recently from 9ebbe5c to d6e55a2 Compare August 18, 2026 20:34
@manchuck
manchuck requested a lite review from Copilot August 18, 2026 20:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@manchuck
manchuck requested a lite review from Copilot August 18, 2026 20:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants