@kaitranntt/ccs 7.65.3-dev.1 → 7.65.3-dev.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +36 -3
  2. package/dist/auth/auth-commands.d.ts +1 -0
  3. package/dist/auth/auth-commands.d.ts.map +1 -1
  4. package/dist/auth/auth-commands.js +11 -0
  5. package/dist/auth/auth-commands.js.map +1 -1
  6. package/dist/auth/commands/backup-command.d.ts +3 -0
  7. package/dist/auth/commands/backup-command.d.ts.map +1 -0
  8. package/dist/auth/commands/backup-command.js +126 -0
  9. package/dist/auth/commands/backup-command.js.map +1 -0
  10. package/dist/auth/commands/index.d.ts +1 -0
  11. package/dist/auth/commands/index.d.ts.map +1 -1
  12. package/dist/auth/commands/index.js +3 -1
  13. package/dist/auth/commands/index.js.map +1 -1
  14. package/dist/auth/profile-continuity-inheritance.d.ts +1 -0
  15. package/dist/auth/profile-continuity-inheritance.d.ts.map +1 -1
  16. package/dist/auth/profile-continuity-inheritance.js +10 -6
  17. package/dist/auth/profile-continuity-inheritance.js.map +1 -1
  18. package/dist/auth/profile-detector.d.ts +9 -1
  19. package/dist/auth/profile-detector.d.ts.map +1 -1
  20. package/dist/auth/profile-detector.js +35 -0
  21. package/dist/auth/profile-detector.js.map +1 -1
  22. package/dist/auth/resume-lane-diagnostics.d.ts +21 -0
  23. package/dist/auth/resume-lane-diagnostics.d.ts.map +1 -0
  24. package/dist/auth/resume-lane-diagnostics.js +146 -0
  25. package/dist/auth/resume-lane-diagnostics.js.map +1 -0
  26. package/dist/auth/resume-lane-warning.d.ts +9 -0
  27. package/dist/auth/resume-lane-warning.d.ts.map +1 -0
  28. package/dist/auth/resume-lane-warning.js +60 -0
  29. package/dist/auth/resume-lane-warning.js.map +1 -0
  30. package/dist/ccs.js +47 -4
  31. package/dist/ccs.js.map +1 -1
  32. package/dist/cliproxy/gemini-cli-quota-normalizer.d.ts +10 -0
  33. package/dist/cliproxy/gemini-cli-quota-normalizer.d.ts.map +1 -0
  34. package/dist/cliproxy/gemini-cli-quota-normalizer.js +122 -0
  35. package/dist/cliproxy/gemini-cli-quota-normalizer.js.map +1 -0
  36. package/dist/cliproxy/quota-fetcher-gemini-cli.d.ts.map +1 -1
  37. package/dist/cliproxy/quota-fetcher-gemini-cli.js +133 -92
  38. package/dist/cliproxy/quota-fetcher-gemini-cli.js.map +1 -1
  39. package/dist/cliproxy/quota-types.d.ts +8 -0
  40. package/dist/cliproxy/quota-types.d.ts.map +1 -1
  41. package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
  42. package/dist/commands/cliproxy/quota-subcommand.js +10 -1
  43. package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
  44. package/dist/commands/command-catalog.d.ts +39 -0
  45. package/dist/commands/command-catalog.d.ts.map +1 -0
  46. package/dist/commands/command-catalog.js +298 -0
  47. package/dist/commands/command-catalog.js.map +1 -0
  48. package/dist/commands/completion-backend.d.ts +14 -0
  49. package/dist/commands/completion-backend.d.ts.map +1 -0
  50. package/dist/commands/completion-backend.js +208 -0
  51. package/dist/commands/completion-backend.js.map +1 -0
  52. package/dist/commands/cursor-command-display.d.ts.map +1 -1
  53. package/dist/commands/cursor-command-display.js +25 -5
  54. package/dist/commands/cursor-command-display.js.map +1 -1
  55. package/dist/commands/cursor-command.d.ts +1 -3
  56. package/dist/commands/cursor-command.d.ts.map +1 -1
  57. package/dist/commands/cursor-command.js +3 -15
  58. package/dist/commands/cursor-command.js.map +1 -1
  59. package/dist/commands/help-command.d.ts +4 -3
  60. package/dist/commands/help-command.d.ts.map +1 -1
  61. package/dist/commands/help-command.js +155 -507
  62. package/dist/commands/help-command.js.map +1 -1
  63. package/dist/commands/root-command-router.d.ts +2 -0
  64. package/dist/commands/root-command-router.d.ts.map +1 -1
  65. package/dist/commands/root-command-router.js +13 -13
  66. package/dist/commands/root-command-router.js.map +1 -1
  67. package/dist/commands/shell-completion-command.d.ts +1 -0
  68. package/dist/commands/shell-completion-command.d.ts.map +1 -1
  69. package/dist/commands/shell-completion-command.js +27 -11
  70. package/dist/commands/shell-completion-command.js.map +1 -1
  71. package/dist/cursor/constants.d.ts +3 -0
  72. package/dist/cursor/constants.d.ts.map +1 -0
  73. package/dist/cursor/constants.js +20 -0
  74. package/dist/cursor/constants.js.map +1 -0
  75. package/dist/cursor/cursor-models.d.ts.map +1 -1
  76. package/dist/cursor/cursor-models.js +2 -0
  77. package/dist/cursor/cursor-models.js.map +1 -1
  78. package/dist/cursor/cursor-profile-executor.d.ts +10 -0
  79. package/dist/cursor/cursor-profile-executor.d.ts.map +1 -0
  80. package/dist/cursor/cursor-profile-executor.js +158 -0
  81. package/dist/cursor/cursor-profile-executor.js.map +1 -0
  82. package/dist/cursor/cursor-translator.d.ts +22 -11
  83. package/dist/cursor/cursor-translator.d.ts.map +1 -1
  84. package/dist/cursor/cursor-translator.js +254 -75
  85. package/dist/cursor/cursor-translator.js.map +1 -1
  86. package/dist/cursor/index.d.ts +1 -0
  87. package/dist/cursor/index.d.ts.map +1 -1
  88. package/dist/cursor/index.js +4 -1
  89. package/dist/cursor/index.js.map +1 -1
  90. package/dist/shared/claude-extension-setup.d.ts.map +1 -1
  91. package/dist/shared/claude-extension-setup.js +36 -16
  92. package/dist/shared/claude-extension-setup.js.map +1 -1
  93. package/dist/targets/target-runtime-compatibility.d.ts.map +1 -1
  94. package/dist/targets/target-runtime-compatibility.js +6 -0
  95. package/dist/targets/target-runtime-compatibility.js.map +1 -1
  96. package/dist/types/profile.d.ts +1 -1
  97. package/dist/types/profile.d.ts.map +1 -1
  98. package/dist/ui/assets/accounts-BjfPKR8m.js +1 -0
  99. package/dist/ui/assets/{alert-dialog-C5RdUHi9.js → alert-dialog-Dh2NUFdm.js} +1 -1
  100. package/dist/ui/assets/{api-C0ROFLme.js → api-C-3mQCFf.js} +1 -1
  101. package/dist/ui/assets/{auth-section-M2azTP3G.js → auth-section-Dp10_YyD.js} +1 -1
  102. package/dist/ui/assets/{backups-section-DIDUVa0t.js → backups-section-C0jF8MP1.js} +1 -1
  103. package/dist/ui/assets/{channels-D_5uerEp.js → channels-CkXuK5i7.js} +1 -1
  104. package/dist/ui/assets/{checkbox-CgMg7fDH.js → checkbox-tA5FH8Ol.js} +1 -1
  105. package/dist/ui/assets/{claude-extension-DA9wMzPz.js → claude-extension-Bg2ZkzMz.js} +1 -1
  106. package/dist/ui/assets/{cliproxy-4yUL1fQw.js → cliproxy-1qRVSbVC.js} +2 -2
  107. package/dist/ui/assets/{cliproxy-ai-providers-DedMcdcc.js → cliproxy-ai-providers-DBSXTTyw.js} +1 -1
  108. package/dist/ui/assets/cliproxy-control-panel-Da-sGGyI.js +1 -0
  109. package/dist/ui/assets/{codex-CAWw4ZNl.js → codex-ooWKOPa2.js} +1 -1
  110. package/dist/ui/assets/{confirm-dialog-Ds0PYz2R.js → confirm-dialog-CKjwhn9j.js} +1 -1
  111. package/dist/ui/assets/{copilot-m6i00mFy.js → copilot-GA7EPiK1.js} +1 -1
  112. package/dist/ui/assets/{cursor-COeD0Dgq.js → cursor-B6c8CyHG.js} +1 -1
  113. package/dist/ui/assets/{droid-CznUyiRx.js → droid-CPRHOIX2.js} +1 -1
  114. package/dist/ui/assets/{globalenv-section-FgK1eGWk.js → globalenv-section-Czgnw_GV.js} +1 -1
  115. package/dist/ui/assets/{health-Cpu6bD6K.js → health-CXLOMk8n.js} +1 -1
  116. package/dist/ui/assets/icons-B9oTjo-t.js +1 -0
  117. package/dist/ui/assets/index-BMHPMj0j.js +69 -0
  118. package/dist/ui/assets/{index-DgnxlKNk.js → index-BceMcbCR.js} +1 -1
  119. package/dist/ui/assets/{index-C7sG68Mi.js → index-Boa5e-GY.js} +1 -1
  120. package/dist/ui/assets/index-CknHGRYp.css +1 -0
  121. package/dist/ui/assets/{index-DampXntj.js → index-CvfzKRSH.js} +1 -1
  122. package/dist/ui/assets/{index-Bhz6T039.js → index-D2v_-6AW.js} +1 -1
  123. package/dist/ui/assets/{index-rTSyskt3.js → index-v-DY6Zby.js} +1 -1
  124. package/dist/ui/assets/{masked-input-B_l4FMkE.js → masked-input-B1_asiUI.js} +1 -1
  125. package/dist/ui/assets/{proxy-status-widget-C7wSbfPC.js → proxy-status-widget-Ci1JpStj.js} +1 -1
  126. package/dist/ui/assets/{radix-ui-C98W0NRG.js → radix-ui-Zb8sVEtn.js} +1 -1
  127. package/dist/ui/assets/{raw-json-settings-editor-panel-CViWFt6t.js → raw-json-settings-editor-panel-DMbTkxWw.js} +1 -1
  128. package/dist/ui/assets/{searchable-select-7-yJbbw2.js → searchable-select-HbP2PXl3.js} +1 -1
  129. package/dist/ui/assets/{separator-DApM4Wa5.js → separator-CdaalG0K.js} +1 -1
  130. package/dist/ui/assets/{shared-Blmm7sMd.js → shared-BiFB-et0.js} +1 -1
  131. package/dist/ui/assets/{table-BwM4zncv.js → table-BPwgFXLQ.js} +1 -1
  132. package/dist/ui/assets/{tanstack-CfKik0yL.js → tanstack-DWm6aJ-G.js} +1 -1
  133. package/dist/ui/assets/{updates-DJ0ofB67.js → updates-l8Co9uve.js} +1 -1
  134. package/dist/ui/index.html +5 -5
  135. package/dist/utils/config-manager.d.ts +5 -0
  136. package/dist/utils/config-manager.d.ts.map +1 -1
  137. package/dist/utils/config-manager.js +10 -1
  138. package/dist/utils/config-manager.js.map +1 -1
  139. package/dist/utils/hooks/image-analysis-backend-resolver.d.ts.map +1 -1
  140. package/dist/utils/hooks/image-analysis-backend-resolver.js +8 -0
  141. package/dist/utils/hooks/image-analysis-backend-resolver.js.map +1 -1
  142. package/dist/web-server/routes/account-routes.d.ts.map +1 -1
  143. package/dist/web-server/routes/account-routes.js +14 -2
  144. package/dist/web-server/routes/account-routes.js.map +1 -1
  145. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
  146. package/dist/web-server/routes/cliproxy-auth-routes.js +80 -6
  147. package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
  148. package/lib/hooks/websearch-transformer.cjs +37 -2
  149. package/package.json +1 -1
  150. package/scripts/completion/README.md +55 -131
  151. package/scripts/completion/ccs.bash +22 -190
  152. package/scripts/completion/ccs.fish +19 -245
  153. package/scripts/completion/ccs.ps1 +37 -427
  154. package/scripts/completion/ccs.zsh +27 -305
  155. package/dist/ui/assets/accounts-Dh95PibK.js +0 -1
  156. package/dist/ui/assets/cliproxy-control-panel-B0kwxgNi.js +0 -1
  157. package/dist/ui/assets/icons-CeH5899d.js +0 -1
  158. package/dist/ui/assets/index-B6SrL1O-.css +0 -1
  159. package/dist/ui/assets/index-CcKb4PL_.js +0 -69
@@ -22,530 +22,178 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.handleHelpCommand = void 0;
27
- const fs = __importStar(require("fs"));
28
- const path = __importStar(require("path"));
29
+ exports.getRootHelpCatalogEntries = exports.getRootHelpVisibleCommands = exports.handleHelpRoute = exports.handleHelpCommand = void 0;
30
+ const package_json_1 = __importDefault(require("../../package.json"));
29
31
  const ui_1 = require("../utils/ui");
30
- const unified_config_loader_1 = require("../config/unified-config-loader");
31
- const config_manager_1 = require("../utils/config-manager");
32
- const port_manager_1 = require("../cliproxy/config/port-manager");
33
- const official_channels_runtime_1 = require("../channels/official-channels-runtime");
34
- // Get version from package.json (same as version-command.ts)
35
- const VERSION = JSON.parse(fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf8')).version;
36
- /**
37
- * Print a major section with ═══ borders (only for 3 main sections)
38
- * Format:
39
- * ═══ TITLE ═══
40
- * Subtitle line 1
41
- * Subtitle line 2
42
- *
43
- * command Description
44
- */
45
- function printMajorSection(title, subtitles, items, writeLine = console.log) {
46
- // Section header with ═══ borders
47
- writeLine((0, ui_1.sectionHeader)(title));
48
- // Subtitles on separate lines (dim)
49
- for (const subtitle of subtitles) {
50
- writeLine(` ${(0, ui_1.dim)(subtitle)}`);
51
- }
52
- // Empty line before items
53
- writeLine('');
54
- // Calculate max command length for alignment
55
- const maxCmdLen = Math.max(...items.map(([cmd]) => cmd.length));
56
- for (const [cmd, desc] of items) {
57
- const paddedCmd = cmd.padEnd(maxCmdLen + 2);
58
- writeLine(` ${(0, ui_1.color)(paddedCmd, 'command')} ${desc}`);
59
- }
60
- // Extra spacing after section
61
- writeLine('');
32
+ const command_catalog_1 = require("./command-catalog");
33
+ function getTopicSummary(name) {
34
+ return command_catalog_1.ROOT_HELP_TOPICS.find((topic) => topic.name === name)?.summary || '';
62
35
  }
63
- /**
64
- * Print a sub-section with colored title
65
- * Format:
66
- * Title (context):
67
- * command Description
68
- */
69
- function printSubSection(title, items, writeLine = console.log) {
70
- // Sub-section header (colored, no borders)
71
- writeLine((0, ui_1.subheader)(`${title}:`));
72
- // Calculate max command length for alignment
73
- const maxCmdLen = Math.max(...items.map(([cmd]) => cmd.length));
74
- for (const [cmd, desc] of items) {
75
- const paddedCmd = cmd.padEnd(maxCmdLen + 2);
76
- writeLine(` ${(0, ui_1.color)(paddedCmd, 'command')} ${desc}`);
36
+ function writeCommandTable(title, entries, writeLine) {
37
+ writeLine((0, ui_1.subheader)(title));
38
+ const maxWidth = Math.max(...entries.map((entry) => entry.name.length));
39
+ for (const entry of entries) {
40
+ writeLine(` ${(0, ui_1.color)(entry.name.padEnd(maxWidth + 2), 'command')} ${entry.summary}`);
77
41
  }
78
- // Spacing after section
79
42
  writeLine('');
80
43
  }
81
- /**
82
- * Print a config/paths section
83
- * Format:
84
- * Title:
85
- * Label: path
86
- */
87
- function printConfigSection(title, items, writeLine = console.log) {
88
- writeLine((0, ui_1.subheader)(`${title}:`));
89
- // Calculate max label length for alignment
90
- const maxLabelLen = Math.max(...items.map(([label]) => label.length));
91
- for (const [label, path] of items) {
92
- const paddedLabel = label.padEnd(maxLabelLen);
93
- writeLine(` ${paddedLabel} ${(0, ui_1.color)(path, 'path')}`);
94
- }
95
- writeLine('');
44
+ function writeGroupedCommands(group, writeLine) {
45
+ const entries = (0, command_catalog_1.getPublicRootCommands)()
46
+ .filter((entry) => entry.group === group)
47
+ .map((entry) => ({ name: entry.name, summary: entry.summary }));
48
+ const titles = {
49
+ start: 'Start Here',
50
+ manage: 'Profile Management',
51
+ operations: 'Operations',
52
+ runtime: 'Compatible Runtimes',
53
+ };
54
+ writeCommandTable(titles[group], entries, writeLine);
96
55
  }
97
- /**
98
- * Display comprehensive help information for CCS (Claude Code Switch)
99
- */
100
- async function handleHelpCommand(writeLine = console.log) {
101
- // Initialize UI (if not already)
56
+ async function showProfilesHelp(writeLine) {
102
57
  await (0, ui_1.initUI)();
103
- // Hero box with ASCII art logo and config hint
104
- // Each letter: C=╔═╗/║ /╚═╝, C=╔═╗/║ /╚═╝, S=╔═╗/╚═╗/╚═╝
105
- const logo = `
106
- ╔═╗ ╔═╗ ╔═╗
107
- ║ ║ ╚═╗ v${VERSION}
108
- ╚═╝ ╚═╝ ╚═╝
109
-
110
- Claude Code Profile & Model Switcher
111
-
112
- Run ${(0, ui_1.color)('ccs config', 'command')} for web dashboard`.trim();
113
- writeLine((0, ui_1.box)(logo, {
114
- padding: 1,
115
- borderStyle: 'round',
116
- titleAlignment: 'center',
117
- }));
58
+ writeLine((0, ui_1.header)('CCS Profiles Help'));
118
59
  writeLine('');
119
- // Resolve display path for dynamic sections
120
- const [dirSource] = (0, config_manager_1.getCcsDirSource)();
121
- const dirDisplay = dirSource === 'default' ? '~/.ccs' : (0, config_manager_1.getCcsDir)();
122
- // Usage section
123
- writeLine((0, ui_1.subheader)('Usage:'));
124
- writeLine(` ${(0, ui_1.color)('ccs', 'command')} [profile] [claude-args...]`);
125
- writeLine(` ${(0, ui_1.color)('ccs', 'command')} [flags]`);
60
+ writeCommandTable('Profile Types', [
61
+ { name: 'ccs auth create <name>', summary: 'Concurrent Claude account profile' },
62
+ { name: 'ccs api create', summary: 'API-backed settings profile' },
63
+ { name: 'ccs cliproxy create <name>', summary: 'Named CLIProxy variant profile' },
64
+ { name: 'ccs env <profile>', summary: 'Export an existing profile for other tools' },
65
+ ], writeLine);
66
+ writeCommandTable('Examples', command_catalog_1.ROOT_PROFILE_EXAMPLES, writeLine);
67
+ writeLine(` ${(0, ui_1.dim)('Deep help: ccs auth --help | ccs api --help | ccs cliproxy --help')}`);
126
68
  writeLine('');
127
- // ═══════════════════════════════════════════════════════════════════════════
128
- // MAJOR SECTION 1: API Key Profiles
129
- // ═══════════════════════════════════════════════════════════════════════════
130
- printMajorSection('API Key Profiles', [`Configure in ${dirDisplay}/*.settings.json`], [
131
- ['ccs', 'Use default Claude account'],
132
- ['ccs glm', 'GLM 5 (API key required)'],
133
- ['ccs km', 'Kimi for Coding (API key)'],
134
- [
135
- 'ccs api create --preset alibaba-coding-plan',
136
- 'Alibaba Coding Plan (Anthropic-compatible API key)',
137
- ],
138
- ['ccs ollama', 'Local Ollama (http://localhost:11434)'],
139
- ['ccs llamacpp', 'Local llama.cpp (http://127.0.0.1:8080)'],
140
- ['ccs ollama-cloud', 'Ollama Cloud (API key required)'],
141
- ['', ''], // Spacer
142
- ['ccs api create --preset anthropic', 'Anthropic direct API key (sk-ant-...)'],
143
- [
144
- 'ccs api create --cliproxy-provider gemini',
145
- 'Create routed API profile from CLIProxy Gemini',
146
- ],
147
- ['ccs api create', 'Create custom API profile'],
148
- ['ccs api discover --register', 'Discover/register orphan settings files'],
149
- ['ccs api copy <src> <dest>', 'Duplicate API profile'],
150
- ['ccs api export <name>', 'Export profile bundle'],
151
- ['ccs api import <file>', 'Import profile bundle'],
152
- ['ccs api remove', 'Remove an API profile'],
153
- ['ccs api list', 'List all API profiles'],
154
- ], writeLine);
155
- // ═══════════════════════════════════════════════════════════════════════════
156
- // MAJOR SECTION 2: Account Management
157
- // ═══════════════════════════════════════════════════════════════════════════
158
- printMajorSection('Account Management', ['Run multiple Claude accounts concurrently'], [
159
- ['ccs auth --help', 'Show account management commands'],
160
- [
161
- 'ccs auth create <name>',
162
- 'Create account profile (supports --bare, shared groups, --deeper-continuity)',
163
- ],
164
- ['ccs config', 'Dashboard: Accounts table can edit context mode/group/continuity depth'],
165
- [
166
- '~/.ccs/config.yaml',
167
- 'Optional: continuity.inherit_from_account maps API/CLIProxy/copilot/default profiles to an account context',
168
- ],
169
- ['ccs auth list', 'List all account profiles'],
170
- ['ccs auth default <name>', 'Set default profile'],
171
- ['ccs auth reset-default', 'Restore original CCS default'],
172
- ['ccs cliproxy auth claude', 'Alternative: authenticate Claude account pool via CLIProxy'],
173
- ], writeLine);
174
- // ═══════════════════════════════════════════════════════════════════════════
175
- // MAJOR SECTION 3: CLI Proxy (OAuth Providers)
176
- // ═══════════════════════════════════════════════════════════════════════════
177
- printMajorSection('CLI Proxy Plus (OAuth Providers)', [
178
- 'Zero-config OAuth authentication via CLIProxy Plus',
179
- 'First run: Browser opens for authentication, then model selection',
180
- 'Settings: ~/.ccs/{provider}.settings.json (created after auth)',
181
- 'Safety: do not reuse one Google account across "ccs gemini" and "ccs agy" (issue #509)',
182
- 'Antigravity requires multi-step responsibility confirmation (issue #509)',
183
- 'If you want to keep Google AI access, do not continue this shared-account setup',
184
- 'CCS is as-is and does not take responsibility for account bans/access loss',
185
- ], [
186
- ['ccs gemini', 'Google Gemini (gemini-2.5-pro or 3-pro)'],
187
- ['ccs codex', 'OpenAI Codex (supports -medium/-high/-xhigh model suffixes)'],
188
- ['ccs agy', 'Antigravity (Claude/Gemini models)'],
189
- ['ccs qwen', 'Qwen Code OAuth (CLIProxy)'],
190
- ['ccs kimi', 'Kimi (Moonshot AI K2/K2.5 models)'],
191
- ['ccs kiro', 'Kiro (AWS CodeWhisperer Claude models)'],
192
- ['ccs ghcp', 'GitHub Copilot (OAuth via CLIProxy Plus)'],
193
- ['', ''], // Spacer
194
- ['ccs <provider> --auth', 'Authenticate only'],
195
- ['ccs <provider> --auth --add', 'Add another account'],
196
- [
197
- 'ccs <provider> --paste-callback',
198
- 'Show auth URL and prompt for callback paste (cross-browser)',
199
- ],
200
- ['ccs <provider> --accounts', 'List all accounts'],
201
- ['ccs <provider> --use <nickname-or-id>', 'Switch to account'],
202
- ['ccs <provider> --config', 'Change model (agy, gemini)'],
203
- [
204
- 'ccs agy --accept-agr-risk',
205
- 'Bypass interactive Antigravity confirmation (you accept full responsibility)',
206
- ],
207
- [
208
- 'ccs <provider> --thinking <value>',
209
- 'Set thinking budget (low/medium/high/xhigh/auto/off or number)',
210
- ],
211
- ['ccs codex --effort <level>', 'Set codex reasoning effort (minimal/low/medium/high/xhigh)'],
212
- ['ccs <provider> --1m', 'Request explicit 1M context when the selected model supports [1m]'],
213
- ['ccs <provider> --no-1m', 'Force standard context / clear [1m]'],
214
- ['ccs <provider> --logout', 'Clear authentication'],
215
- ['ccs <provider> --headless', 'Headless auth (for SSH)'],
216
- ['ccs <provider> --port-forward', 'Force port-forwarding mode (skip prompt)'],
217
- ['ccs kiro --auth --kiro-auth-method aws', 'Kiro via AWS Builder ID (device code)'],
218
- ['ccs kiro --auth --kiro-auth-method aws-authcode', 'Kiro via AWS auth code flow'],
219
- ['ccs kiro --auth --kiro-auth-method google', 'Kiro via Google OAuth'],
220
- ['ccs kiro --auth --kiro-auth-method github', 'Kiro via GitHub OAuth (Dashboard flow)'],
221
- ['ccs kiro --import', 'Import token from Kiro IDE'],
222
- ['ccs kiro --incognito', 'Use incognito browser (default: normal)'],
223
- ['ccs codex "explain code"', 'Use with prompt'],
224
- ], writeLine);
225
- // ═══════════════════════════════════════════════════════════════════════════
226
- // MAJOR SECTION 4: GitHub Copilot Integration (copilot-api)
227
- // ═══════════════════════════════════════════════════════════════════════════
228
- printMajorSection('GitHub Copilot Integration (copilot-api)', [
229
- 'Use your GitHub Copilot subscription with Claude Code via copilot-api',
230
- 'Requires: npm install -g copilot-api',
231
- 'Note: For OAuth-based access, use ccs ghcp instead',
232
- ], [
233
- ['ccs copilot', 'Use Copilot via copilot-api daemon'],
234
- ['ccs copilot auth', 'Authenticate with GitHub'],
235
- ['ccs copilot status', 'Show integration status'],
236
- ['ccs copilot models', 'List available models'],
237
- ['ccs copilot usage', 'Show Copilot quota usage'],
238
- ['ccs copilot start', 'Start copilot-api daemon'],
239
- ['ccs copilot stop', 'Stop copilot-api daemon'],
240
- ['ccs copilot enable', 'Enable integration'],
241
- ['ccs copilot disable', 'Disable integration'],
242
- ], writeLine);
243
- // ═══════════════════════════════════════════════════════════════════════════
244
- // MAJOR SECTION 5: Cursor IDE Integration
245
- // ═══════════════════════════════════════════════════════════════════════════
246
- printMajorSection('Cursor IDE Integration', [
247
- 'Use Cursor IDE with Claude Code via cursor proxy daemon',
248
- 'Auto-detects token from Cursor installation',
249
- ], [
250
- ['ccs cursor <cmd>', 'Use Cursor IDE integration'],
251
- ['ccs cursor auth', 'Import Cursor token'],
252
- ['ccs cursor auth --manual --token <t> --machine-id <id>', 'Manual token import'],
253
- ['ccs cursor status', 'Show connection status'],
254
- ['ccs cursor models', 'List available models'],
255
- ['ccs cursor start', 'Start proxy daemon'],
256
- ['ccs cursor stop', 'Stop proxy daemon'],
257
- ['ccs cursor enable', 'Enable cursor integration'],
258
- ['ccs cursor disable', 'Disable cursor integration'],
259
- ], writeLine);
260
- // ═══════════════════════════════════════════════════════════════════════════
261
- // SUB-SECTIONS (simpler styling)
262
- // ═══════════════════════════════════════════════════════════════════════════
263
- // Delegation
264
- printSubSection('Delegation (inside Claude Code CLI)', [
265
- ['/ccs "task"', 'Delegate task (auto-selects profile)'],
266
- ['/ccs --glm "task"', 'Force GLM-5 for simple tasks'],
267
- ['/ccs --kimi "task"', 'Force Kimi OAuth for long context'],
268
- ['/ccs --km "task"', 'Force Kimi API key for long context'],
269
- ['/ccs:continue "follow-up"', 'Continue last delegation session'],
270
- ], writeLine);
271
- // Delegation CLI Flags (Claude Code passthrough)
272
- printSubSection('Delegation Flags (Claude Code passthrough)', [
273
- ['--max-turns <n>', 'Limit agentic turns (prevents loops)'],
274
- ['--fallback-model <model>', 'Auto-fallback on overload (sonnet)'],
275
- ['--agents <json>', 'Inject dynamic subagents'],
276
- ['--betas <features>', 'Enable experimental features'],
277
- ['--allowedTools <list>', 'Restrict available tools'],
278
- ['--disallowedTools <list>', 'Block specific tools'],
279
- ], writeLine);
280
- // Diagnostics
281
- printSubSection('Diagnostics', [
282
- ['ccs setup', 'First-time setup wizard'],
283
- ['ccs doctor', 'Run health check and diagnostics'],
284
- ['ccs cleanup', 'Remove old CLIProxy logs'],
285
- ['ccs config', 'Open web dashboard (includes Claude IDE Extension setup page)'],
286
- ['ccs config auth setup', 'Configure dashboard login'],
287
- ['ccs config auth show', 'Show dashboard auth status'],
288
- ['ccs config channels', 'Show Official Channels status'],
289
- [
290
- 'ccs config channels --set telegram,discord',
291
- 'Auto-add Telegram + Discord on supported native Claude runs',
292
- ],
293
- ['ccs config channels --set-token telegram=<token>', 'Save TELEGRAM_BOT_TOKEN'],
294
- ['ccs config image-analysis', 'Show image analysis settings'],
295
- ['ccs config image-analysis --enable', 'Enable image analysis'],
296
- ['ccs config thinking', 'Show thinking/reasoning settings'],
297
- ['ccs config thinking --mode auto', 'Set thinking mode'],
298
- ['ccs config thinking --clear-provider-override codex', 'Clear provider overrides'],
299
- ['ccs config --port 3000', 'Use specific port'],
300
- ['ccs config --host 0.0.0.0', 'Force all-interface binding for remote devices'],
301
- ['ccs persist <profile>', 'Write profile setup to ~/.claude/settings.json'],
302
- ['ccs persist --list-backups', 'List available settings.json backups'],
303
- ['ccs persist --restore', 'Restore settings.json from latest backup'],
304
- ['ccs sync', 'Sync delegation commands and skills'],
305
- ['ccs update', 'Update CCS to latest version'],
306
- ['ccs update --force', 'Force reinstall current version'],
307
- ['ccs update --beta', 'Install from dev channel (unstable)'],
308
- ], writeLine);
309
- // Environment export
310
- printSubSection('Environment Export', [
311
- ['ccs env <profile>', 'Export env vars for third-party tools'],
312
- ['ccs env <profile> --format openai', 'OpenAI-compatible vars (OpenCode/Cursor)'],
313
- ['ccs env <profile> --format anthropic', 'Anthropic vars (default)'],
314
- ['ccs env <profile> --format raw', 'All effective env vars'],
315
- [
316
- 'ccs env <profile> --format claude-extension --ide vscode',
317
- 'VS Code/Cursor Claude extension settings JSON',
318
- ],
319
- [
320
- 'ccs env <profile> --format claude-extension --ide windsurf',
321
- 'Windsurf Claude extension settings JSON',
322
- ],
323
- ['ccs env <profile> --shell fish', 'Fish shell syntax'],
324
- ], writeLine);
325
- // Flags
326
- printSubSection('Flags', [
327
- ['--config-dir <path>', 'Use custom CCS config directory'],
328
- ['--target <cli>', 'Target CLI: claude (default), droid, codex (runtime-only)'],
329
- ['-h, --help', 'Show this help message'],
330
- ['-v, --version', 'Show version and installation info'],
331
- ['-sc, --shell-completion', 'Install shell auto-completion'],
332
- ], writeLine);
333
- // Aliases
334
- printSubSection('Aliases', [
335
- ['ccs-droid <profile> [args]', 'Explicit Droid runtime alias'],
336
- ['ccsd <profile> [args]', 'Legacy shortcut for: ccs-droid <profile> [args]'],
337
- ['ccs-codex <profile> [args]', 'Explicit Codex runtime alias'],
338
- ['ccsx <profile> [args]', 'Short alias for: ccs-codex <profile> [args]'],
339
- ['ccsxp [args]', 'Shortcut for: ccs codex --target codex [args]'],
340
- ], writeLine);
341
- // Multi-target examples
342
- printSubSection('Multi-Target', [
343
- ['ccs glm --target droid', 'Run GLM profile on Droid CLI'],
344
- ['ccs-droid glm', 'Same as above (explicit alias)'],
345
- ['ccsd glm', 'Legacy shortcut for ccs-droid'],
346
- ['ccs --target codex', 'Open a native Codex session with your existing ~/.codex setup'],
347
- ['ccs-codex', 'Same as above (explicit Codex alias)'],
348
- ['ccsx', 'Short alias for ccs-codex'],
349
- ['ccsxp "your prompt"', 'Run built-in CLIProxy Codex on native Codex CLI'],
350
- ['ccs codex --target codex', 'Explicit form of ccsxp'],
351
- [
352
- 'ccs api create codex-api --cliproxy-provider codex',
353
- 'Create a routed API bridge that can also run on Codex',
354
- ],
355
- ['ccs codex-api --target codex', 'Run a Codex bridge profile on native Codex CLI'],
356
- ['ccs-droid codex', 'Run built-in CLIProxy Codex profile on Droid'],
357
- ['ccs-droid agy', 'Run built-in CLIProxy Antigravity profile on Droid'],
358
- [
359
- 'ccs-droid codex exec --skip-permissions-unsafe "fix failing tests"',
360
- 'Pass through Droid exec mode',
361
- ],
362
- [
363
- 'ccs-droid codex -m custom:gpt-5.3-codex "fix failing tests"',
364
- 'Auto-routes short exec flags',
365
- ],
366
- [
367
- 'ccs-droid codex --skip-permissions-unsafe "fix failing tests"',
368
- 'Auto-routes to Droid exec when exec-only flags are detected',
369
- ],
370
- [
371
- 'ccs cliproxy create my-codex --provider codex --target droid',
372
- 'Create CLIProxy variant with Droid as default target',
373
- ],
374
- ['ccs glm', 'Run GLM profile on Claude Code (default)'],
375
- ], writeLine);
376
- printSubSection('Codex + CLIProxy', [
377
- ['ccsxp "your prompt"', 'Use the built-in CCS Codex provider shortcut on native Codex'],
378
- ['ccs config', 'Open Compatible -> Codex CLI for native Codex setup and diagnostics'],
379
- [
380
- 'Default provider',
381
- 'Set to cliproxy if plain codex or a personal cxp alias should use CLIProxy',
382
- ],
383
- ['Model provider auth', 'Save cliproxy with env_key = "CLIPROXY_API_KEY"'],
384
- ], writeLine);
385
- // Configuration
386
- printConfigSection('Configuration', [
387
- ['Config File:', (0, unified_config_loader_1.isUnifiedMode)() ? `${dirDisplay}/config.yaml` : `${dirDisplay}/config.json`],
388
- ['Profiles:', `${dirDisplay}/profiles.json`],
389
- ['Instances:', `${dirDisplay}/instances/`],
390
- ['Settings:', `${dirDisplay}/*.settings.json`],
391
- ], writeLine);
392
- // CLI Proxy management
393
- printSubSection('CLI Proxy Plus Management', [
394
- ['ccs cliproxy', 'Show CLIProxy Plus status and version'],
395
- ['ccs cliproxy --help', 'Full CLIProxy Plus management help'],
396
- ['ccs cliproxy doctor', 'Quota diagnostics (Antigravity)'],
397
- ['ccs cliproxy --install <ver>', 'Install specific version (e.g., 6.6.6)'],
398
- ['ccs cliproxy --latest', 'Update to latest version'],
399
- ['', ''], // Spacer
400
- ['ccs cliproxy pause <p> <a>', 'Pause account from rotation'],
401
- ['ccs cliproxy resume <p> <a>', 'Resume paused account'],
402
- ['ccs cliproxy status', 'Show CLIProxy process status'],
403
- ['ccs cliproxy quota', 'Show quota/tier/pause status for all providers'],
404
- ['ccs cliproxy quota --provider <name>', 'Show quota/tier/pause status for one provider'],
405
- ], writeLine);
406
- printSubSection('Docker Deployment', [
407
- ['ccs docker --help', 'Manage the integrated CCS + CLIProxy Docker stack'],
408
- ['ccs docker up', 'Build and start the stack locally'],
409
- ['ccs docker up --host <ssh>', 'Stage assets to ~/.ccs/docker and deploy remotely'],
410
- ['ccs docker status', 'Show docker compose and supervisor status'],
411
- ['ccs docker logs --follow', 'Tail combined CCS + CLIProxy logs'],
412
- ['ccs docker update', 'Update CCS and CLIProxy inside the running container'],
413
- ['ccs docker config', 'Show bundled asset paths and deployment defaults'],
414
- ], writeLine);
415
- // CLI Proxy configuration flags (new)
416
- printSubSection('CLI Proxy Configuration', [
417
- ['--proxy-host <host>', 'Remote proxy hostname/IP'],
418
- ['--proxy-port <port>', `Proxy port (default: ${port_manager_1.CLIPROXY_DEFAULT_PORT})`],
419
- ['--proxy-protocol <proto>', 'Protocol: http or https (default: http)'],
420
- ['--proxy-auth-token <token>', 'Auth token for remote proxy'],
421
- ['--proxy-timeout <ms>', 'Connection timeout in ms (default: 2000)'],
422
- ['--local-proxy', 'Force local mode, ignore remote config'],
423
- ['--remote-only', 'Fail if remote unreachable (no fallback)'],
424
- ['--allow-self-signed', 'Allow self-signed certs (for dev proxies)'],
425
- ], writeLine);
426
- // W3: Thinking Budget explanation
427
- printSubSection('Extended Thinking / Reasoning', [
428
- ['--thinking off', 'Disable extended thinking'],
429
- ['--thinking auto', 'Let model decide dynamically'],
430
- ['--thinking low', '1K tokens - Quick responses'],
431
- ['--thinking medium', '8K tokens - Standard analysis'],
432
- ['--thinking high', '24K tokens - Deep reasoning'],
433
- ['--thinking xhigh', '32K tokens - Maximum depth'],
434
- ['--thinking <number>', 'Custom token budget (512-100000)'],
435
- ['', ''],
436
- ['--effort <level>', 'Codex alias for reasoning effort (minimal/low/medium/high/xhigh)'],
437
- ['--effort xhigh', 'Pin Codex effort to xhigh for this run'],
438
- ['', ''],
439
- ['Droid exec:', 'Use native Droid flag: --reasoning-effort <level>'],
440
- ['', 'CCS auto-maps --thinking/--effort to --reasoning-effort in droid exec mode.'],
441
- ['', 'For interactive droid sessions, CCS applies reasoning via Droid BYOK model config.'],
442
- ['', 'When multiple reasoning flags are provided, the first flag wins.'],
443
- ['', ''],
444
- ['Note:', 'Extended thinking allocates compute for step-by-step reasoning'],
445
- ['', 'before responding.'],
446
- ['', 'Providers: agy/gemini use --thinking, codex uses --effort (or --thinking alias).'],
447
- ['', 'Codex model suffixes also pin effort: -medium / -high / -xhigh.'],
448
- ], writeLine);
449
- // Extended Context (1M)
450
- printSubSection('Extended Context (--1m)', [
451
- ['--1m', 'Request 1M token context when the selected model supports [1m]'],
452
- ['--no-1m', 'Force standard context (Claude default stays plain)'],
453
- ['', ''],
454
- ['Auto behavior:', 'Gemini models: CCS auto-adds [1m] when supported'],
455
- ['', 'Claude models: plain by default, opt-in with --1m or saved [1m]'],
456
- ['', ''],
457
- ['Note:', 'CCS only controls the saved [1m] suffix.'],
458
- ['', 'Provider pricing and entitlement stay upstream.'],
459
- [
460
- '',
461
- 'Some accounts/providers can still return 429 extra-usage errors for long-context requests.',
462
- ],
463
- ], writeLine);
464
- // Image Analysis
465
- printSubSection('Image Analysis (first-class local tool)', [
466
- ['ccs config image-analysis', 'Show current settings'],
467
- ['ccs config image-analysis --enable', 'Enable for CLIProxy providers'],
468
- ['ccs config image-analysis --disable', 'Disable (use native Read)'],
469
- ['ccs config image-analysis --timeout 120', 'Set analysis timeout'],
470
- ['ccs config image-analysis --set-model <p> <m>', 'Set provider model'],
471
- ['', ''],
472
- ['Note:', 'When ready, third-party launches expose the local ImageAnalysis MCP tool'],
473
- ['', 'and route requests directly to the resolved CCS provider path.'],
474
- ['', 'If runtime/auth/proxy is unavailable, CCS falls back to native Read.'],
475
- ], writeLine);
476
- printSubSection('Official Channels (official Claude plugins)', [
477
- ['ccs config', 'Dashboard -> Settings -> Channels (fastest path)'],
478
- ['ccs config channels', 'Show current status'],
479
- [
480
- 'ccs config channels --set telegram,discord',
481
- 'Auto-add selected channels on native Claude default/account sessions',
482
- ],
483
- ['ccs config channels --set all', 'Enable Telegram, Discord, and iMessage'],
484
- ['ccs config channels --unattended', 'Also add --dangerously-skip-permissions'],
485
- ['ccs config channels --set-token telegram=<token>', 'Save TELEGRAM_BOT_TOKEN'],
486
- ['ccs config channels --set-token discord=<token>', 'Save DISCORD_BOT_TOKEN'],
487
- ['ccs config channels --clear-token [channel]', 'Remove one or all saved channel tokens'],
488
- ['', ''],
489
- ['', 'Fastest path: turn on the channel, save the token if needed, then run ccs.'],
490
- ['Note:', (0, official_channels_runtime_1.getOfficialChannelsSupportMessage)()],
491
- ['', 'Telegram/Discord tokens live in ~/.claude/channels/<channel>/.env.'],
492
- ['', 'Current-process TELEGRAM_BOT_TOKEN / DISCORD_BOT_TOKEN also work for that launch.'],
493
- ['', 'iMessage is macOS-only and requires local OS permissions instead of a bot token.'],
494
- ], writeLine);
495
- // CCS Environment Variables
496
- printSubSection('Environment Variables', [
497
- ['CCS_DIR', 'Override CCS config directory (default: ~/.ccs)'],
498
- ['CCS_HOME', 'Override home directory (legacy, appends .ccs)'],
499
- ['CCS_DEBUG', 'Enable debug logging'],
500
- ['CCS_THINKING', 'Override thinking level (flag > env > config)'],
501
- ], writeLine);
502
- // CLI Proxy env vars
503
- printSubSection('CLI Proxy Environment Variables', [
504
- ['CCS_PROXY_HOST', 'Remote proxy hostname'],
505
- ['CCS_PROXY_PORT', 'Proxy port'],
506
- ['CCS_PROXY_PROTOCOL', 'Protocol (http/https)'],
507
- ['CCS_PROXY_AUTH_TOKEN', 'Auth token'],
508
- ['CCS_PROXY_TIMEOUT', 'Connection timeout in ms'],
509
- ['CCS_PROXY_FALLBACK_ENABLED', 'Enable local fallback (1/0)'],
510
- ['CCS_ALLOW_SELF_SIGNED', 'Allow self-signed certs (1/0)'],
511
- ], writeLine);
512
- // CLI Proxy paths
513
- writeLine((0, ui_1.subheader)('CLI Proxy:'));
514
- writeLine(` Binary: ${(0, ui_1.color)(`${dirDisplay}/cliproxy/bin/cli-proxy-api-plus`, 'path')}`);
515
- writeLine(` Config: ${(0, ui_1.color)(`${dirDisplay}/cliproxy/config.yaml`, 'path')}`);
516
- writeLine(` Auth: ${(0, ui_1.color)(`${dirDisplay}/cliproxy/auth/`, 'path')}`);
517
- writeLine(` ${(0, ui_1.dim)(`Port: ${port_manager_1.CLIPROXY_DEFAULT_PORT} (default)`)}`);
69
+ }
70
+ async function showProvidersHelp(writeLine) {
71
+ await (0, ui_1.initUI)();
72
+ writeLine((0, ui_1.header)('CCS Providers Help'));
518
73
  writeLine('');
519
- // Shared Data
520
- writeLine((0, ui_1.subheader)('Shared Data:'));
521
- writeLine(` Commands: ${(0, ui_1.color)(`${dirDisplay}/shared/commands/`, 'path')}`);
522
- writeLine(` Skills: ${(0, ui_1.color)(`${dirDisplay}/shared/skills/`, 'path')}`);
523
- writeLine(` Agents: ${(0, ui_1.color)(`${dirDisplay}/shared/agents/`, 'path')}`);
524
- writeLine(` ${(0, ui_1.dim)('Note: Symlinked across all profiles')}`);
74
+ writeCommandTable('Built-in OAuth Providers', command_catalog_1.BUILTIN_PROVIDER_SHORTCUTS, writeLine);
75
+ writeCommandTable('Common Setup Paths', [
76
+ {
77
+ name: 'ccs <provider> --auth',
78
+ summary: 'Authenticate a provider account without launching',
79
+ },
80
+ { name: 'ccs api create --preset <id>', summary: 'Create an API-backed provider profile' },
81
+ { name: 'ccs config', summary: 'Use the dashboard for provider and model setup' },
82
+ ], writeLine);
83
+ writeLine(` ${(0, ui_1.dim)('Deep help: ccs cliproxy --help | ccs api --help')}`);
525
84
  writeLine('');
526
- // Examples (aligned with consistent spacing)
527
- writeLine((0, ui_1.subheader)('Examples:'));
528
- writeLine(` $ ${(0, ui_1.color)('ccs', 'command')} ${(0, ui_1.dim)('# Use default account')}`);
529
- writeLine(` $ ${(0, ui_1.color)('ccs gemini', 'command')} ${(0, ui_1.dim)('# OAuth (browser opens first time)')}`);
530
- writeLine(` $ ${(0, ui_1.color)('ccs glm "implement API"', 'command')} ${(0, ui_1.dim)('# API key model')}`);
531
- writeLine(` $ ${(0, ui_1.color)('ccs config', 'command')} ${(0, ui_1.dim)('# Open web dashboard')}`);
85
+ }
86
+ async function showTargetsHelp(writeLine) {
87
+ await (0, ui_1.initUI)();
88
+ writeLine((0, ui_1.header)('CCS Targets Help'));
532
89
  writeLine('');
533
- // Update examples
534
- writeLine((0, ui_1.subheader)('Update:'));
535
- writeLine(` $ ${(0, ui_1.color)('ccs update', 'command')} ${(0, ui_1.dim)('# Update to latest stable')}`);
536
- writeLine(` $ ${(0, ui_1.color)('ccs update --force', 'command')} ${(0, ui_1.dim)('# Force reinstall current')}`);
537
- writeLine(` $ ${(0, ui_1.color)('ccs update --beta', 'command')} ${(0, ui_1.dim)('# Install dev channel')}`);
90
+ writeCommandTable('Target Routing', command_catalog_1.ROOT_COMPATIBLE_ALIAS_EXAMPLES, writeLine);
91
+ writeCommandTable('Examples', [
92
+ { name: 'ccs glm --target droid', summary: 'Run a profile on Droid instead of Claude' },
93
+ {
94
+ name: 'ccs --target codex',
95
+ summary: 'Open a native Codex session with your current setup',
96
+ },
97
+ { name: 'ccs codex-api --target codex', summary: 'Run a routed API bridge on native Codex' },
98
+ ], writeLine);
99
+ }
100
+ async function handleHelpCommand(writeLine = console.log) {
101
+ await (0, ui_1.initUI)();
102
+ writeLine((0, ui_1.header)(`CCS CLI v${package_json_1.default.version}`));
538
103
  writeLine('');
539
- // Docs link
540
- writeLine(` ${(0, ui_1.dim)('Docs: https://github.com/kaitranntt/ccs')}`);
104
+ writeLine(' Claude profile switching, provider routing, and compatible runtime bridges.');
541
105
  writeLine('');
542
- // Uninstall
543
- writeLine((0, ui_1.subheader)('Uninstall:'));
544
- writeLine(` ${(0, ui_1.color)('npm uninstall -g @kaitranntt/ccs', 'command')}`);
106
+ writeLine((0, ui_1.subheader)('Usage'));
107
+ writeLine(` ${(0, ui_1.color)('ccs <profile> [claude-args...]', 'command')}`);
108
+ writeLine(` ${(0, ui_1.color)('ccs <command> [options]', 'command')}`);
109
+ writeLine(` ${(0, ui_1.color)('ccs help <topic>', 'command')}`);
545
110
  writeLine('');
546
- // License
547
- writeLine((0, ui_1.dim)('License: MIT'));
111
+ writeGroupedCommands('start', writeLine);
112
+ writeGroupedCommands('manage', writeLine);
113
+ writeGroupedCommands('runtime', writeLine);
114
+ writeGroupedCommands('operations', writeLine);
115
+ writeCommandTable('OAuth Provider Shortcuts', command_catalog_1.BUILTIN_PROVIDER_SHORTCUTS.map((entry) => ({
116
+ name: `ccs ${entry.name}`,
117
+ summary: entry.summary,
118
+ })), writeLine);
119
+ writeCommandTable('Examples', command_catalog_1.ROOT_PROFILE_EXAMPLES, writeLine);
120
+ writeCommandTable('Targets and Aliases', command_catalog_1.ROOT_COMPATIBLE_ALIAS_EXAMPLES, writeLine);
121
+ writeCommandTable('More Help', [
122
+ { name: 'ccs help profiles', summary: getTopicSummary('profiles') },
123
+ { name: 'ccs help providers', summary: getTopicSummary('providers') },
124
+ { name: 'ccs help completion', summary: getTopicSummary('completion') },
125
+ { name: 'ccs help targets', summary: getTopicSummary('targets') },
126
+ { name: 'ccs api --help', summary: 'Deep help for API profile lifecycle commands' },
127
+ { name: 'ccs cliproxy --help', summary: 'Deep help for variants, quota, and lifecycle' },
128
+ { name: 'ccs docker --help', summary: 'Deep help for Docker deployment commands' },
129
+ { name: 'ccs cursor --help', summary: 'Deep help for Cursor runtime/admin commands' },
130
+ { name: 'ccs copilot --help', summary: 'Deep help for GitHub Copilot commands' },
131
+ ], writeLine);
132
+ writeLine(` ${(0, ui_1.dim)('Flags: -h/--help, -v/--version, -sc/--shell-completion, --target <cli>')}`);
548
133
  writeLine('');
549
134
  }
550
135
  exports.handleHelpCommand = handleHelpCommand;
136
+ function listHelpTargets() {
137
+ return command_catalog_1.ROOT_HELP_TOPICS.map((topic) => topic.name).join(', ');
138
+ }
139
+ async function handleHelpRoute(args, writeLine = console.log) {
140
+ const topic = args[0];
141
+ if (!topic) {
142
+ await handleHelpCommand(writeLine);
143
+ return;
144
+ }
145
+ if (topic === 'profiles') {
146
+ await showProfilesHelp(writeLine);
147
+ return;
148
+ }
149
+ if (topic === 'providers') {
150
+ await showProvidersHelp(writeLine);
151
+ return;
152
+ }
153
+ if (topic === 'targets') {
154
+ await showTargetsHelp(writeLine);
155
+ return;
156
+ }
157
+ if (topic === 'completion') {
158
+ const { showShellCompletionHelp } = await Promise.resolve().then(() => __importStar(require('./shell-completion-command')));
159
+ showShellCompletionHelp(writeLine);
160
+ return;
161
+ }
162
+ const commandHandlers = {
163
+ api: async () => (await Promise.resolve().then(() => __importStar(require('./api-command/help')))).showApiCommandHelp(writeLine),
164
+ auth: async () => {
165
+ const authModule = await Promise.resolve().then(() => __importStar(require('../auth/auth-commands')));
166
+ const AuthCommands = authModule.default;
167
+ await new AuthCommands().showHelp();
168
+ },
169
+ cleanup: async () => (await Promise.resolve().then(() => __importStar(require('./cleanup-command')))).handleCleanupCommand(['--help']),
170
+ cliproxy: async () => (await Promise.resolve().then(() => __importStar(require('./cliproxy/help-subcommand')))).showHelp(),
171
+ copilot: async () => process.exit(await (await Promise.resolve().then(() => __importStar(require('./copilot-command')))).handleCopilotCommand(['--help'])),
172
+ cursor: async () => process.exit(await (await Promise.resolve().then(() => __importStar(require('./cursor-command')))).handleCursorCommand(['--help'])),
173
+ docker: async () => (await Promise.resolve().then(() => __importStar(require('./docker/help-subcommand')))).showHelp(),
174
+ migrate: async () => (await Promise.resolve().then(() => __importStar(require('./migrate-command')))).printMigrateHelp(),
175
+ setup: async () => (await Promise.resolve().then(() => __importStar(require('./setup-command')))).handleSetupCommand(['--help']),
176
+ tokens: async () => process.exit(await (await Promise.resolve().then(() => __importStar(require('./tokens-command')))).handleTokensCommand(['--help'])),
177
+ };
178
+ const handler = commandHandlers[topic];
179
+ if (handler) {
180
+ await handler();
181
+ return;
182
+ }
183
+ await (0, ui_1.initUI)();
184
+ writeLine((0, ui_1.color)(`Unknown help topic or command: ${topic}`, 'error'));
185
+ writeLine('');
186
+ writeLine(` ${(0, ui_1.dim)(`Available help topics: ${listHelpTargets()}`)}`);
187
+ writeLine('');
188
+ process.exitCode = 1;
189
+ }
190
+ exports.handleHelpRoute = handleHelpRoute;
191
+ function getRootHelpVisibleCommands() {
192
+ return (0, command_catalog_1.getPublicRootCommands)().map((entry) => entry.name);
193
+ }
194
+ exports.getRootHelpVisibleCommands = getRootHelpVisibleCommands;
195
+ function getRootHelpCatalogEntries() {
196
+ return command_catalog_1.ROOT_COMMAND_CATALOG;
197
+ }
198
+ exports.getRootHelpCatalogEntries = getRootHelpCatalogEntries;
551
199
  //# sourceMappingURL=help-command.js.map