diff --git a/docs/auto-updater.md b/docs/auto-updater.md index 15677948c..d4e83775f 100644 --- a/docs/auto-updater.md +++ b/docs/auto-updater.md @@ -16,7 +16,7 @@ Claude Code 拥有一套复杂的多策略自动更新系统,支持三种安 | `npm-global` | `npm install -g` / `bun install -g` | 是(静默) | | `npm-local` | `npm install` 到 `~/.claude/local/` | 是(静默) | | `package-manager` | 显示通知,附带对应操作系统的升级命令 | 否(仅通知) | -| `development` | 不适用 — 执行 `claude update` 时报错 | 不适用 | +| `development` | 不适用 — 执行 `csc update` 时报错 | 不适用 | ### 策略路由 @@ -95,7 +95,7 @@ void assertMinVersion(); ## 手动 CLI 命令 -### `claude update` / `claude upgrade` +### `csc update` / `claude upgrade` **文件**: `src/cli/update.ts` @@ -258,7 +258,7 @@ React hook `useUpdateNotification(updatedVersion)` — 确保每次 semver 变 | 文件 | 职责 | |---|---| | `src/utils/autoUpdater.ts` | 核心逻辑:版本检查、npm 安装、文件锁、最低/最高版本门控 | -| `src/cli/update.ts` | `claude update` 命令处理 | +| `src/cli/update.ts` | `csc update` 命令处理 | | `src/utils/nativeInstaller/installer.ts` | 原生二进制安装器:下载、版本管理、符号链接、清理 | | `src/utils/nativeInstaller/download.ts` | 从 GCS/Artifactory 下载二进制文件并校验 | | `src/utils/localInstaller.ts` | 本地安装器(`~/.claude/local/`)基于 npm | @@ -308,5 +308,5 @@ REPL 运行中(每 30 分钟) └── 显示 "Run: brew upgrade ..."(不自动安装) 手动操作 - └── claude update → 完整诊断 + 安装编排 + └── csc update → 完整诊断 + 安装编排 ``` diff --git a/learn/phase-1-startup-flow.md b/learn/phase-1-startup-flow.md index 17e3c5595..77bfd8dcb 100644 --- a/learn/phase-1-startup-flow.md +++ b/learn/phase-1-startup-flow.md @@ -294,7 +294,7 @@ action(async (prompt, options) => { | `claude setup-token` | 4267 | 设置长期认证 token | | `claude agents` | 4278 | 列出已配置的 agents | | `claude doctor` | 4346 | 健康检查 | -| `claude update` | 4362 | 检查更新 | +| `csc update` | 4362 | 检查更新 | | `claude install` | 4394 | 安装原生构建 | | `claude log` | 4411 | 查看对话日志(内部) | | `claude completion` | 4491 | Shell 自动补全 | diff --git a/scripts/defines.ts b/scripts/defines.ts index e5215c49f..5558bab4b 100644 --- a/scripts/defines.ts +++ b/scripts/defines.ts @@ -12,7 +12,7 @@ export function getMacroDefines(): Record { "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""), "MACRO.ISSUES_EXPLAINER": JSON.stringify(""), "MACRO.NATIVE_PACKAGE_URL": JSON.stringify(""), - "MACRO.PACKAGE_URL": JSON.stringify(""), + "MACRO.PACKAGE_URL": JSON.stringify("@costrict/csc"), "MACRO.VERSION_CHANGELOG": JSON.stringify(""), }; } diff --git a/src/bridge/initReplBridge.ts b/src/bridge/initReplBridge.ts index 6d012b93b..9a1bd9c31 100644 --- a/src/bridge/initReplBridge.ts +++ b/src/bridge/initReplBridge.ts @@ -421,7 +421,7 @@ export async function initReplBridge( `[bridge:repl] Skipping: ${versionError}`, true, ) - onStateChange?.('failed', 'run `claude update` to upgrade') + onStateChange?.('failed', 'run `csc update` to upgrade') return null } logForDebugging( @@ -462,7 +462,7 @@ export async function initReplBridge( const versionError = checkBridgeMinVersion() if (versionError) { logBridgeSkip('version_too_old', `[bridge:repl] Skipping: ${versionError}`) - onStateChange?.('failed', 'run `claude update` to upgrade') + onStateChange?.('failed', 'run `csc update` to upgrade') return null } diff --git a/src/cli/print.ts b/src/cli/print.ts index 5f2cb308c..a43036fc4 100644 --- a/src/cli/print.ts +++ b/src/cli/print.ts @@ -5051,7 +5051,7 @@ async function loadInitialMessages( ) if (!parsedSessionId) { let errorMessage = - 'Error: --resume requires a valid session ID when used with --print. Usage: claude -p --resume ' + 'Error: --resume requires a valid session ID when used with --print. Usage: csc -p --resume ' if (typeof options.resume === 'string') { errorMessage += `. Session IDs must be in UUID format (e.g., 550e8400-e29b-41d4-a716-446655440000). Provided value "${options.resume}" is not a valid UUID` } diff --git a/src/commands/mcp/addCommand.ts b/src/commands/mcp/addCommand.ts index ca5340315..f0db46471 100644 --- a/src/commands/mcp/addCommand.ts +++ b/src/commands/mcp/addCommand.ts @@ -87,12 +87,12 @@ export function registerMcpAddCommand(mcp: Command): void { if (!name) { cliError( 'Error: Server name is required.\n' + - 'Usage: claude mcp add [args...]', + 'Usage: csc mcp add [args...]', ) } else if (!actualCommand) { cliError( 'Error: Command is required when server name is provided.\n' + - 'Usage: claude mcp add [args...]', + 'Usage: csc mcp add [args...]', ) } diff --git a/src/main.tsx b/src/main.tsx index 881ddba10..001f659cc 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -4937,7 +4937,7 @@ async function run(): Promise { if (!isRemoteTuiEnabled && !hasInitialPrompt) { return await exitWithError( root, - 'Error: --remote requires a description.\nUsage: claude --remote "your task description"', + 'Error: --remote requires a description.\nUsage: csc --remote "your task description"', () => gracefulShutdown(1), ); } @@ -6479,7 +6479,7 @@ async function run(): Promise { // (e.g. `--debug assistant`) and the position-0 predicate // didn't match. Print usage like the ssh stub does. process.stderr.write( - "Usage: claude assistant [sessionId]\n\n" + + "Usage: csc assistant [sessionId]\n\n" + "Attach the REPL as a viewer client to a running bridge session.\n" + "Omit sessionId to discover and pick from available sessions.\n", ); @@ -6487,6 +6487,16 @@ async function run(): Promise { }); } + // Update command - check and install updates + program + .command('update') + .alias('upgrade') + .description('Check for updates and install the latest version') + .action(async () => { + const { update } = await import('./cli/update.js') + await update() + }) + // Doctor command - check installation health program .command('doctor') diff --git a/src/utils/autoUpdater.ts b/src/utils/autoUpdater.ts index d8d807d3e..c9e5d6ecd 100644 --- a/src/utils/autoUpdater.ts +++ b/src/utils/autoUpdater.ts @@ -61,7 +61,7 @@ export type MaxVersionConfig = { * * Versioning approach: * 1. For version requirements/compatibility (assertMinVersion), we use semver comparison that ignores build metadata - * 2. For updates ('claude update'), we use exact string comparison to detect any change, including SHA + * 2. For updates ('csc update'), we use exact string comparison to detect any change, including SHA * - This ensures users always get the latest build, even when only the SHA changes * - The UI clearly shows both versions including build metadata * @@ -87,7 +87,7 @@ It looks like your version of CoStrict (${MACRO.VERSION}) needs an update. A newer version (${versionConfig.minVersion} or higher) is required to continue. To update, please run: - claude update + csc update This will ensure you have access to the latest features and improvements. `) @@ -488,7 +488,7 @@ This configuration is not supported for updates. To fix this issue: 1. Install Node.js within your Linux distribution: e.g. sudo apt install nodejs npm 2. Make sure Linux NPM is in your PATH before the Windows version - 3. Try updating again with 'claude update' + 3. Try updating again with 'csc update' `) return 'install_failed' } diff --git a/src/utils/completionCache.ts b/src/utils/completionCache.ts index ec288c3e6..afb028dd8 100644 --- a/src/utils/completionCache.ts +++ b/src/utils/completionCache.ts @@ -135,7 +135,7 @@ export async function setupShellCompletion(theme: ThemeName): Promise { /** * Regenerate cached shell completion scripts in ~/.claude/. - * Called after `claude update` so completions stay in sync with the new binary. + * Called after `csc update` so completions stay in sync with the new binary. */ export async function regenerateCompletionCache(): Promise { const shell = detectShell() diff --git a/src/utils/gracefulShutdown.ts b/src/utils/gracefulShutdown.ts index 8b8a5b9c7..a7feac188 100644 --- a/src/utils/gracefulShutdown.ts +++ b/src/utils/gracefulShutdown.ts @@ -137,7 +137,7 @@ function printResumeHint(): void { ) { try { const sessionId = getSessionId() - // Don't show resume hint if no session file exists (e.g., subcommands like `claude update`) + // Don't show resume hint if no session file exists (e.g., subcommands like `csc update`) if (!sessionIdExists(sessionId)) { return }