From 32f7ca235c30353ac96398a75a65e5d516e263e4 Mon Sep 17 00:00:00 2001 From: janlaywss Date: Tue, 31 Mar 2026 19:29:13 +0800 Subject: [PATCH] readme --- claude-code-source/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/claude-code-source/README.md b/claude-code-source/README.md index a1f61944..0cbd46f4 100644 --- a/claude-code-source/README.md +++ b/claude-code-source/README.md @@ -1,5 +1,21 @@ # Claude Code 源码还原与构建 +## 从源码重新构建 +```bash +# 1. 安装 Bun(构建工具) +curl -LO https://github.com/oven-sh/bun/releases/latest/download/bun-darwin-aarch64.zip +unzip bun-darwin-aarch64.zip -d /tmp/bun && sudo cp /tmp/bun/bun-darwin-aarch64/bun /usr/local/bin/bun + +# 2. 安装/更新依赖(可选,node_modules 已包含在仓库中) +pnpm install --registry https://registry.npmjs.org + +# 3. 构建 +bun run build.ts + +# 4. 运行 +bun dist/cli.js --version +``` + 从 `@anthropic-ai/claude-code` v2.1.88 npm 包中的 `cli.js.map` source map 文件还原出的完整源代码,并配置为可编译运行。 ## 效果验证