From a5feefe45a62044bbfede28edaaa175f20795399 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Mon, 22 Jun 2026 12:05:34 -0400 Subject: [PATCH] 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. --- src/commands/cliproxy/help-subcommand.ts | 10 +++++----- src/commands/cliproxy/index.ts | 2 +- .../cliproxy/proxy-lifecycle-subcommand.ts | 15 ++++++++++++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/commands/cliproxy/help-subcommand.ts b/src/commands/cliproxy/help-subcommand.ts index 27e61e14..4049a616 100644 --- a/src/commands/cliproxy/help-subcommand.ts +++ b/src/commands/cliproxy/help-subcommand.ts @@ -53,9 +53,9 @@ export async function showHelp(): Promise { [ 'Quota Management:', [ - ['default ', 'Set default account for rotation'], - ['pause ', 'Pause account (skip in rotation)'], - ['resume ', 'Resume paused account'], + ['default [--provider ]', 'Set default account for rotation'], + ['pause [--provider ]', 'Pause account (skip in rotation)'], + ['resume [--provider ]', '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 { [ ['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'], ], ], [ diff --git a/src/commands/cliproxy/index.ts b/src/commands/cliproxy/index.ts index b0595c62..e518f3ee 100644 --- a/src/commands/cliproxy/index.ts +++ b/src/commands/cliproxy/index.ts @@ -250,7 +250,7 @@ export async function handleCliproxyCommand(args: string[]): Promise { 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)), diff --git a/src/commands/cliproxy/proxy-lifecycle-subcommand.ts b/src/commands/cliproxy/proxy-lifecycle-subcommand.ts index 001e995f..7c4e4462 100644 --- a/src/commands/cliproxy/proxy-lifecycle-subcommand.ts +++ b/src/commands/cliproxy/proxy-lifecycle-subcommand.ts @@ -66,7 +66,7 @@ export async function handleRestart(verbose = false): Promise { console.log(''); } -export async function handleProxyStatus(): Promise { +export async function handleProxyStatus(verbose = false): Promise { await initUI(); console.log(header('CLIProxy Status')); console.log(''); @@ -80,7 +80,17 @@ export async function handleProxyStatus(): Promise { 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 { 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 {