From e981c391a26d51de749099ca844915ffc06976e2 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Tue, 23 Dec 2025 00:55:17 -0500 Subject: [PATCH] feat(cli): add config command hints to help and error messages Enhance discoverability of the 'ccs config' command by adding hints to the help menu, post-update/doctor messages, and relevant error states. --- src/commands/help-command.ts | 7 +++++-- src/commands/update-command.ts | 1 + src/management/doctor.ts | 6 +++++- src/utils/error-manager.ts | 8 +++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/commands/help-command.ts b/src/commands/help-command.ts index 2333c729..6261dc2a 100644 --- a/src/commands/help-command.ts +++ b/src/commands/help-command.ts @@ -89,14 +89,16 @@ export async function handleHelpCommand(): Promise { // Initialize UI (if not already) await initUI(); - // Hero box with ASCII art logo + // Hero box with ASCII art logo and config hint // Each letter: C=╔═╗/║ /╚═╝, C=╔═╗/║ /╚═╝, S=╔═╗/╚═╗/╚═╝ const logo = ` ╔═╗ ╔═╗ ╔═╗ ║ ║ ╚═╗ v${VERSION} ╚═╝ ╚═╝ ╚═╝ -Claude Code Profile & Model Switcher`.trim(); +Claude Code Profile & Model Switcher + +Run ${color('ccs config', 'command')} for web dashboard`.trim(); console.log( box(logo, { @@ -286,6 +288,7 @@ Claude Code Profile & Model Switcher`.trim(); ` $ ${color('ccs gemini', 'command')} ${dim('# OAuth (browser opens first time)')}` ); console.log(` $ ${color('ccs glm "implement API"', 'command')} ${dim('# API key model')}`); + console.log(` $ ${color('ccs config', 'command')} ${dim('# Open web dashboard')}`); console.log(''); // Update examples diff --git a/src/commands/update-command.ts b/src/commands/update-command.ts index a172e4da..3a025ff7 100644 --- a/src/commands/update-command.ts +++ b/src/commands/update-command.ts @@ -221,6 +221,7 @@ async function performNpmUpdate( console.log(ok(`${isReinstall ? 'Reinstall' : 'Update'} successful!`)); console.log(''); console.log(`Run ${color('ccs --version', 'command')} to verify`); + console.log(info(`Tip: Use ${color('ccs config', 'command')} for web-based configuration`)); console.log(''); } else { console.log(''); diff --git a/src/management/doctor.ts b/src/management/doctor.ts index b19dd4f4..1ec0abd3 100644 --- a/src/management/doctor.ts +++ b/src/management/doctor.ts @@ -2,7 +2,7 @@ * CCS Health Check and Diagnostics - Main Orchestrator */ -import { initUI, header, box, table, color, ok, fail, warn } from '../utils/ui'; +import { initUI, header, box, table, color, ok, fail, warn, info } from '../utils/ui'; import packageJson from '../../package.json'; import { HealthCheck, @@ -135,6 +135,8 @@ class Doctor { // Final status if (this.results.isHealthy() && !this.results.hasWarnings()) { console.log(ok('All checks passed! Installation is healthy.')); + console.log(''); + console.log(info(`Tip: Use ${color('ccs config', 'command')} for web-based configuration`)); } else if (this.results.hasErrors()) { console.log(fail('Installation has errors. Run suggested fixes above.')); } else { @@ -143,6 +145,8 @@ class Doctor { `Installation healthy (${this.results.warnings.length} warning${this.results.warnings.length !== 1 ? 's' : ''})` ) ); + console.log(''); + console.log(info(`Tip: Use ${color('ccs config', 'command')} for web-based configuration`)); } console.log(''); diff --git a/src/utils/error-manager.ts b/src/utils/error-manager.ts index 98bb4acf..65d364b8 100644 --- a/src/utils/error-manager.ts +++ b/src/utils/error-manager.ts @@ -1,4 +1,4 @@ -import { initUI, header, color, dim, errorBox } from './ui'; +import { initUI, header, color, dim, info, errorBox } from './ui'; import { ERROR_CODES, getErrorDocUrl, ErrorCode } from './error-codes'; import { getPortCheckCommand, getKillPidCommand } from './platform-commands'; @@ -155,6 +155,8 @@ export class ErrorManager { console.error(' Create a new account profile:'); console.error(` ${color('ccs auth create ', 'command')}`); console.error(''); + console.error(info(`Tip: Use ${color('ccs config', 'command')} for web-based configuration`)); + console.error(''); this.showErrorCode(ERROR_CODES.PROFILE_NOT_FOUND); } @@ -208,6 +210,8 @@ export class ErrorManager { console.error(''); console.error(dim('This displays manual authentication steps.')); console.error(''); + console.error(info(`Tip: Use ${color('ccs config', 'command')} for web-based configuration`)); + console.error(''); } /** @@ -283,5 +287,7 @@ export class ErrorManager { console.error(dim('This will open a browser for OAuth login.')); console.error(dim('After login, you can use the profile normally.')); console.error(''); + console.error(info(`Tip: Use ${color('ccs config', 'command')} for web-based configuration`)); + console.error(''); } }