mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-08 06:17:06 +00:00
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:
@@ -89,14 +89,16 @@ export async function handleHelpCommand(): Promise<void> {
|
|||||||
// Initialize UI (if not already)
|
// Initialize UI (if not already)
|
||||||
await initUI();
|
await initUI();
|
||||||
|
|
||||||
// Hero box with ASCII art logo
|
// Hero box with ASCII art logo and config hint
|
||||||
// Each letter: C=╔═╗/║ /╚═╝, C=╔═╗/║ /╚═╝, S=╔═╗/╚═╗/╚═╝
|
// Each letter: C=╔═╗/║ /╚═╝, C=╔═╗/║ /╚═╝, S=╔═╗/╚═╗/╚═╝
|
||||||
const logo = `
|
const logo = `
|
||||||
╔═╗ ╔═╗ ╔═╗
|
╔═╗ ╔═╗ ╔═╗
|
||||||
║ ║ ╚═╗ v${VERSION}
|
║ ║ ╚═╗ v${VERSION}
|
||||||
╚═╝ ╚═╝ ╚═╝
|
╚═╝ ╚═╝ ╚═╝
|
||||||
|
|
||||||
Claude Code Profile & Model Switcher`.trim();
|
Claude Code Profile & Model Switcher
|
||||||
|
|
||||||
|
Run ${color('ccs config', 'command')} for web dashboard`.trim();
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
box(logo, {
|
box(logo, {
|
||||||
@@ -286,6 +288,7 @@ Claude Code Profile & Model Switcher`.trim();
|
|||||||
` $ ${color('ccs gemini', 'command')} ${dim('# OAuth (browser opens first time)')}`
|
` $ ${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 glm "implement API"', 'command')} ${dim('# API key model')}`);
|
||||||
|
console.log(` $ ${color('ccs config', 'command')} ${dim('# Open web dashboard')}`);
|
||||||
console.log('');
|
console.log('');
|
||||||
|
|
||||||
// Update examples
|
// Update examples
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ async function performNpmUpdate(
|
|||||||
console.log(ok(`${isReinstall ? 'Reinstall' : 'Update'} successful!`));
|
console.log(ok(`${isReinstall ? 'Reinstall' : 'Update'} successful!`));
|
||||||
console.log('');
|
console.log('');
|
||||||
console.log(`Run ${color('ccs --version', 'command')} to verify`);
|
console.log(`Run ${color('ccs --version', 'command')} to verify`);
|
||||||
|
console.log(info(`Tip: Use ${color('ccs config', 'command')} for web-based configuration`));
|
||||||
console.log('');
|
console.log('');
|
||||||
} else {
|
} else {
|
||||||
console.log('');
|
console.log('');
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* CCS Health Check and Diagnostics - Main Orchestrator
|
* 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 packageJson from '../../package.json';
|
||||||
import {
|
import {
|
||||||
HealthCheck,
|
HealthCheck,
|
||||||
@@ -135,6 +135,8 @@ class Doctor {
|
|||||||
// Final status
|
// Final status
|
||||||
if (this.results.isHealthy() && !this.results.hasWarnings()) {
|
if (this.results.isHealthy() && !this.results.hasWarnings()) {
|
||||||
console.log(ok('All checks passed! Installation is healthy.'));
|
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()) {
|
} else if (this.results.hasErrors()) {
|
||||||
console.log(fail('Installation has errors. Run suggested fixes above.'));
|
console.log(fail('Installation has errors. Run suggested fixes above.'));
|
||||||
} else {
|
} else {
|
||||||
@@ -143,6 +145,8 @@ class Doctor {
|
|||||||
`Installation healthy (${this.results.warnings.length} warning${this.results.warnings.length !== 1 ? 's' : ''})`
|
`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('');
|
console.log('');
|
||||||
|
|||||||
@@ -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 { ERROR_CODES, getErrorDocUrl, ErrorCode } from './error-codes';
|
||||||
import { getPortCheckCommand, getKillPidCommand } from './platform-commands';
|
import { getPortCheckCommand, getKillPidCommand } from './platform-commands';
|
||||||
|
|
||||||
@@ -155,6 +155,8 @@ export class ErrorManager {
|
|||||||
console.error(' Create a new account profile:');
|
console.error(' Create a new account profile:');
|
||||||
console.error(` ${color('ccs auth create <name>', 'command')}`);
|
console.error(` ${color('ccs auth create <name>', 'command')}`);
|
||||||
console.error('');
|
console.error('');
|
||||||
|
console.error(info(`Tip: Use ${color('ccs config', 'command')} for web-based configuration`));
|
||||||
|
console.error('');
|
||||||
|
|
||||||
this.showErrorCode(ERROR_CODES.PROFILE_NOT_FOUND);
|
this.showErrorCode(ERROR_CODES.PROFILE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
@@ -208,6 +210,8 @@ export class ErrorManager {
|
|||||||
console.error('');
|
console.error('');
|
||||||
console.error(dim('This displays manual authentication steps.'));
|
console.error(dim('This displays manual authentication steps.'));
|
||||||
console.error('');
|
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('This will open a browser for OAuth login.'));
|
||||||
console.error(dim('After login, you can use the profile normally.'));
|
console.error(dim('After login, you can use the profile normally.'));
|
||||||
console.error('');
|
console.error('');
|
||||||
|
console.error(info(`Tip: Use ${color('ccs config', 'command')} for web-based configuration`));
|
||||||
|
console.error('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user