diff --git a/README.md b/README.md index 77c9407ae..54d8e0224 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,9 @@ ```sh bun i -g claude-code-best bun pm -g trust claude-code-best -ccb # 直接打开 claude code -CLAUDE_BRIDGE_BASE_URL=https://remote-control.claude-code-best.win/ CLAUDE_BRIDGE_OAUTH_TOKEN=test-my-key bun run dev --remote-control # 我们有自部署的远程控制 +ccb # 以 nodejs 打开 claude code +ccb-bun # 以 bun 形态打开 +CLAUDE_BRIDGE_BASE_URL=https://remote-control.claude-code-best.win/ CLAUDE_BRIDGE_OAUTH_TOKEN=test-my-key ccb --remote-control # 我们有自部署的远程控制 ``` ## ⚡ 快速开始(源码版) diff --git a/build.ts b/build.ts index ec4b0091e..7b2169e0a 100644 --- a/build.ts +++ b/build.ts @@ -36,7 +36,7 @@ const DEFAULT_BUILD_FEATURES = [ 'CONTEXT_COLLAPSE', 'MONITOR_TOOL', 'FORK_SUBAGENT', - 'UDS_INBOX', +// 'UDS_INBOX', 'KAIROS', 'COORDINATOR_MODE', 'LAN_PIPES', @@ -112,3 +112,17 @@ if (!rgScript.success) { } else { console.log(`Bundled download-ripgrep script to ${outdir}/`) } + +// Step 6: Generate cli-bun and cli-node executable entry points +const cliBun = join(outdir, 'cli-bun.js') +const cliNode = join(outdir, 'cli-node.js') + +await writeFile(cliBun, '#!/usr/bin/env bun\nimport "./cli.js"\n') +await writeFile(cliNode, '#!/usr/bin/env node\nimport "./cli.js"\n') + +// Make both executable +const { chmodSync } = await import('fs') +chmodSync(cliBun, 0o755) +chmodSync(cliNode, 0o755) + +console.log(`Generated ${cliBun} (shebang: bun) and ${cliNode} (shebang: node)`) diff --git a/package.json b/package.json index 7549723d6..636ec7b24 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "claude-code-best", - "version": "1.2.1", + "version": "1.3.2", "description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal", "type": "module", "author": "claude-code-best ", @@ -25,8 +25,9 @@ "bun": ">=1.2.0" }, "bin": { - "ccb": "dist/cli.js", - "claude-code-best": "dist/cli.js" + "ccb": "dist/cli-node.js", + "ccb-bun": "dist/cli-bun.js", + "claude-code-best": "dist/cli-node.js" }, "workspaces": [ "packages/*", @@ -34,8 +35,8 @@ ], "files": [ "dist", - "scripts/download-ripgrep.ts", - "scripts/postinstall.cjs" + "scripts/postinstall.cjs", + "scripts/setup-chrome-mcp.mjs" ], "scripts": { "build": "bun run build.ts", diff --git a/scripts/setup-chrome-mcp.mjs b/scripts/setup-chrome-mcp.mjs index da10b4218..485457e70 100644 --- a/scripts/setup-chrome-mcp.mjs +++ b/scripts/setup-chrome-mcp.mjs @@ -9,18 +9,11 @@ */ import { execFileSync } from "node:child_process"; +import { createRequire } from "node:module"; import { dirname, join } from "node:path"; -import { fileURLToPath } from "node:url"; -const __dirname = dirname(fileURLToPath(import.meta.url)); -const cliPath = join( - __dirname, - "..", - "node_modules", - "mcp-chrome-bridge", - "dist", - "cli.js", -); +const require = createRequire(import.meta.url); +const cliPath = require.resolve("mcp-chrome-bridge/dist/cli.js"); const userArgs = process.argv.slice(2);