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.
This commit is contained in:
kaitranntt
2025-12-23 00:55:17 -05:00
parent f62b48972d
commit e981c391a2
4 changed files with 18 additions and 4 deletions
+5 -2
View File
@@ -89,14 +89,16 @@ export async function handleHelpCommand(): Promise<void> {
// 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
+1
View File
@@ -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('');
+5 -1
View File
@@ -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('');
+7 -1
View File
@@ -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 <name>', '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('');
}
}