Files
ccs/src/commands/help-command.ts
T
7fc281fcec chore: promote beta to main (v5.2.0) (#32)
* fix(cliproxy): use double-dash flags for cliproxyapi auth (#24)

CLIProxyAPI updated from single-dash to double-dash CLI flags.
Changed -login to --login, -codex-login to --codex-login,
-antigravity-login to --antigravity-login, -config to --config,
and -no-browser to --no-browser.

* chore(release): 5.1.1-beta.1 [skip ci]

## [5.1.1-beta.1](https://github.com/kaitranntt/ccs/compare/v5.1.0...v5.1.1-beta.1) (2025-12-01)

### Bug Fixes

* **cliproxy:** use double-dash flags for cliproxyapi auth ([#24](https://github.com/kaitranntt/ccs/issues/24)) ([4c81f28](https://github.com/kaitranntt/ccs/commit/4c81f28f0b67ef92cf74d0f5c13a5943ff0a7f00))

* chore(release): 5.1.1-beta.2 [skip ci]

## [5.1.1-beta.2](https://github.com/kaitranntt/ccs/compare/v5.1.1-beta.1...v5.1.1-beta.2) (2025-12-01)

### Bug Fixes

* **cliproxy:** use double-dash flags for cliproxyapi auth ([9489884](https://github.com/kaitranntt/ccs/commit/94898848ea4533dcfc142e1b6c9bf939ba655537))

* fix(glmt): handle 401 errors and headers-already-sent exception (#30)

- add res.headersSent check before writing error headers
- write error as SSE event when headers already sent (streaming mode)
- add parseUpstreamError() for user-friendly error messages
- return proper HTTP status codes (401, 403, 429, 502, 504)
- clear auth error: check ANTHROPIC_AUTH_TOKEN in config

Fixes #26

* chore(release): 5.1.1-beta.3 [skip ci]

## [5.1.1-beta.3](https://github.com/kaitranntt/ccs/compare/v5.1.1-beta.2...v5.1.1-beta.3) (2025-12-01)

### Bug Fixes

* **glmt:** handle 401 errors and headers-already-sent exception ([#30](https://github.com/kaitranntt/ccs/issues/30)) ([c953382](https://github.com/kaitranntt/ccs/commit/c95338232a37981b95b785b47185ce18d6d94b7a)), closes [#26](https://github.com/kaitranntt/ccs/issues/26)

* chore(release): enable success comments and released labels in semantic-release

* feat(cliproxy): add qwen code oauth provider support (#31)

Add 'qwen' as new CLIProxy OAuth provider with --qwen-login flag.
Support qwen3-coder model with base config at config/base-qwen.settings.json.
Register qwen OAuth endpoints and token prefix handling.
Update help documentation across all CLI entry points.

Implements issue #29

* chore(release): 5.2.0-beta.1 [skip ci]

# [5.2.0-beta.1](https://github.com/kaitranntt/ccs/compare/v5.1.1-beta.3...v5.2.0-beta.1) (2025-12-01)

### Features

* **cliproxy:** add qwen code oauth provider support ([#31](https://github.com/kaitranntt/ccs/issues/31)) ([a3f1e52](https://github.com/kaitranntt/ccs/commit/a3f1e52ac68600ba0806d67aacceb6477ffa3543)), closes [#29](https://github.com/kaitranntt/ccs/issues/29)

* feat(cliproxy): auto-update cliproxyapi to latest release on startup

- add github api integration to fetch latest release version
- check for updates on every startup (cached for 1 hour)
- auto-download newer versions when available
- rename CLIPROXY_VERSION to CLIPROXY_FALLBACK_VERSION (safety net)
- add version tracking (.version file) and caching (.version-cache.json)
- non-blocking: startup continues if update check fails

* chore(release): 5.2.0-beta.2 [skip ci]

# [5.2.0-beta.2](https://github.com/kaitranntt/ccs/compare/v5.2.0-beta.1...v5.2.0-beta.2) (2025-12-01)

### Features

* **cliproxy:** auto-update cliproxyapi to latest release on startup ([8873ccd](https://github.com/kaitranntt/ccs/commit/8873ccd981679e8acff8965accdc22215c6e4aa2))

---------

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
2025-12-01 04:11:14 -05:00

140 lines
7.4 KiB
TypeScript

import { colored } from '../utils/helpers';
/**
* Display comprehensive help information for CCS (Claude Code Switch)
*/
export function handleHelpCommand(): void {
console.log(colored('CCS (Claude Code Switch) - Profile switching for Claude CLI', 'bold'));
console.log('');
console.log(colored('Usage:', 'cyan'));
console.log(` ${colored('ccs', 'yellow')} [profile] [claude-args...]`);
console.log(` ${colored('ccs', 'yellow')} [flags]`);
console.log('');
// ═══════════════════════════════════════════════════════════════════════════
// SECTION 1: API KEY MODELS
// ═══════════════════════════════════════════════════════════════════════════
console.log(colored('═══ API Key Models ═══', 'cyanBold'));
console.log(' Configure API keys in ~/.ccs/*.settings.json');
console.log('');
console.log(` ${colored('ccs', 'yellow')} Use default Claude account`);
console.log(` ${colored('ccs glm', 'yellow')} GLM 4.6 (API key required)`);
console.log(` ${colored('ccs glmt', 'yellow')} GLM with thinking mode`);
console.log(` ${colored('ccs kimi', 'yellow')} Kimi for Coding (API key)`);
console.log('');
// ═══════════════════════════════════════════════════════════════════════════
// SECTION 2: ACCOUNT MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════
console.log(colored('═══ Account Management ═══', 'cyanBold'));
console.log(' Run multiple Claude accounts concurrently');
console.log('');
console.log(
` ${colored('ccs auth --help', 'yellow')} Show account management commands`
);
console.log(` ${colored('ccs auth create <name>', 'yellow')} Create new account profile`);
console.log(` ${colored('ccs auth list', 'yellow')} List all account profiles`);
console.log('');
// ═══════════════════════════════════════════════════════════════════════════
// SECTION 3: CLI PROXY (OAUTH PROVIDERS)
// ═══════════════════════════════════════════════════════════════════════════
console.log(colored('═══ CLI Proxy (OAuth Providers) ═══', 'cyanBold'));
console.log(' Zero-config OAuth authentication via CLIProxyAPI');
console.log(' First run: Browser opens for authentication');
console.log(' Settings: ~/.ccs/{provider}.settings.json (created after auth)');
console.log('');
console.log(
` ${colored('ccs gemini', 'yellow')} Google Gemini (gemini-2.5-pro)`
);
console.log(
` ${colored('ccs codex', 'yellow')} OpenAI Codex (gpt-5.1-codex-max)`
);
console.log(
` ${colored('ccs agy', 'yellow')} Antigravity (gemini-3-pro-preview)`
);
console.log(` ${colored('ccs qwen', 'yellow')} Qwen Code (qwen3-coder)`);
console.log('');
console.log(` ${colored('ccs <provider> --auth', 'yellow')} Authenticate only`);
console.log(` ${colored('ccs <provider> --logout', 'yellow')} Clear authentication`);
console.log(` ${colored('ccs <provider> --headless', 'yellow')} Headless auth (for SSH)`);
console.log(` ${colored('ccs codex "explain code"', 'yellow')} Use with prompt`);
console.log('');
// ═══════════════════════════════════════════════════════════════════════════
// DELEGATION
// ═══════════════════════════════════════════════════════════════════════════
console.log(colored('Delegation (inside Claude Code CLI):', 'cyan'));
console.log(
` ${colored('/ccs "task"', 'yellow')} Delegate task (auto-selects profile)`
);
console.log(
` ${colored('/ccs --glm "task"', 'yellow')} Force GLM-4.6 for simple tasks`
);
console.log(` ${colored('/ccs --kimi "task"', 'yellow')} Force Kimi for long context`);
console.log(
` ${colored('/ccs:continue "follow-up"', 'yellow')} Continue last delegation session`
);
console.log('');
console.log(colored('Diagnostics:', 'cyan'));
console.log(
` ${colored('ccs doctor', 'yellow')} Run health check and diagnostics`
);
console.log(
` ${colored('ccs sync', 'yellow')} Sync delegation commands and skills`
);
console.log(` ${colored('ccs update', 'yellow')} Update CCS to latest version`);
console.log('');
console.log(colored('Flags:', 'cyan'));
console.log(` ${colored('-h, --help', 'yellow')} Show this help message`);
console.log(
` ${colored('-v, --version', 'yellow')} Show version and installation info`
);
console.log(
` ${colored('-sc, --shell-completion', 'yellow')} Install shell auto-completion`
);
console.log('');
console.log(colored('Configuration:', 'cyan'));
console.log(' Config File: ~/.ccs/config.json');
console.log(' Profiles: ~/.ccs/profiles.json');
console.log(' Instances: ~/.ccs/instances/');
console.log(' Settings: ~/.ccs/*.settings.json');
console.log('');
console.log(colored('CLI Proxy:', 'cyan'));
console.log(' Binary: ~/.ccs/cliproxy/bin/cli-proxy-api');
console.log(' Config: ~/.ccs/cliproxy/config.yaml');
console.log(' Auth: ~/.ccs/cliproxy/auth/');
console.log(' Port: 8317 (default)');
console.log('');
console.log(colored('Shared Data:', 'cyan'));
console.log(' Commands: ~/.ccs/shared/commands/');
console.log(' Skills: ~/.ccs/shared/skills/');
console.log(' Agents: ~/.ccs/shared/agents/');
console.log(' Note: Symlinked across all profiles');
console.log('');
console.log(colored('Examples:', 'cyan'));
console.log(` ${colored('$ ccs', 'yellow')} # Use default account`);
console.log(
` ${colored('$ ccs gemini', 'yellow')} # OAuth (browser opens first time)`
);
console.log(` ${colored('$ ccs glm "implement API"', 'yellow')} # API key model`);
console.log('');
console.log(` Docs: ${colored('https://github.com/kaitranntt/ccs', 'cyan')}`);
console.log('');
console.log(colored('Uninstall:', 'yellow'));
console.log(' npm uninstall -g @kaitranntt/ccs');
console.log('');
console.log(`${colored('License:', 'cyan')} MIT`);
process.exit(0);
}