mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-11 03:13:12 +00:00
fix(cliproxy): honor status --verbose and document --provider/diag in help
handleProxyStatus now respects --verbose (was parsed but ignored). Document the existing --provider option on default/pause/resume and the 'diag' alias for doctor in the cliproxy help text.
This commit is contained in:
1 parent
016c47ec9a
commit
a5feefe45a
3 files changed
+20
-7
No files matched your search
@@ -53,9 +53,9 @@ export async function showHelp(): Promise<void> {
|
||||
[
|
||||
'Quota Management:',
|
||||
[
|
||||
['default <account>', 'Set default account for rotation'],
|
||||
['pause <account>', 'Pause account (skip in rotation)'],
|
||||
['resume <account>', 'Resume paused account'],
|
||||
['default <account> [--provider <name>]', 'Set default account for rotation'],
|
||||
['pause <account> [--provider <name>]', 'Pause account (skip in rotation)'],
|
||||
['resume <account> [--provider <name>]', 'Resume paused account'],
|
||||
[
|
||||
'quota',
|
||||
'Show quota status + pool context (drain order, per-account available/cooling/paused)',
|
||||
@@ -89,9 +89,9 @@ export async function showHelp(): Promise<void> {
|
||||
[
|
||||
['start', 'Start CLIProxy instance in background'],
|
||||
['restart', 'Restart CLIProxy instance'],
|
||||
['status', 'Show running CLIProxy status'],
|
||||
['status [--verbose]', 'Show running CLIProxy status (--verbose adds uptime)'],
|
||||
['stop', 'Stop running CLIProxy instance'],
|
||||
['doctor', 'Quota diagnostics and shared project detection'],
|
||||
['doctor | diag', 'Quota diagnostics and shared project detection'],
|
||||
],
|
||||
],
|
||||
[
|
||||
|
||||
@@ -250,7 +250,7 @@ export async function handleCliproxyCommand(args: string[]): Promise<void> {
|
||||
start: async () => handleStart(verbose),
|
||||
stop: async () => handleStop(),
|
||||
restart: async () => handleRestart(verbose),
|
||||
status: async () => handleProxyStatus(),
|
||||
status: async () => handleProxyStatus(verbose),
|
||||
doctor: async () => handleDoctor(verbose),
|
||||
diag: async () => handleDoctor(verbose),
|
||||
default: async () => handleSetDefault(remainingArgs.slice(1)),
|
||||
|
||||
@@ -66,7 +66,7 @@ export async function handleRestart(verbose = false): Promise<void> {
|
||||
console.log('');
|
||||
}
|
||||
|
||||
export async function handleProxyStatus(): Promise<void> {
|
||||
export async function handleProxyStatus(verbose = false): Promise<void> {
|
||||
await initUI();
|
||||
console.log(header('CLIProxy Status'));
|
||||
console.log('');
|
||||
@@ -80,7 +80,17 @@ export async function handleProxyStatus(): Promise<void> {
|
||||
console.log(` Sessions: ${status.sessionCount || 0} active`);
|
||||
if (status.startedAt) {
|
||||
console.log(` Started: ${new Date(status.startedAt).toLocaleString()}`);
|
||||
if (verbose) {
|
||||
const uptimeMs = Date.now() - new Date(status.startedAt).getTime();
|
||||
const uptimeSec = Math.floor(uptimeMs / 1000);
|
||||
const h = Math.floor(uptimeSec / 3600);
|
||||
const m = Math.floor((uptimeSec % 3600) / 60);
|
||||
const s = uptimeSec % 60;
|
||||
const uptimeStr = h > 0 ? `${h}h ${m}m ${s}s` : m > 0 ? `${m}m ${s}s` : `${s}s`;
|
||||
console.log(` Uptime: ${uptimeStr}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('');
|
||||
console.log(dim('To stop: ccs cliproxy stop'));
|
||||
} else {
|
||||
@@ -94,6 +104,9 @@ export async function handleProxyStatus(): Promise<void> {
|
||||
if (!detected.sessionCount) {
|
||||
console.log(dim(' Note: Detected running proxy without local session lock'));
|
||||
}
|
||||
if (verbose) {
|
||||
console.log(dim(' Note: Process detected via port scan; no local lock file present'));
|
||||
}
|
||||
console.log('');
|
||||
console.log(dim('To stop: ccs cliproxy stop'));
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user