mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
The README entry points still described IM support as Telegram and Feishu only, while the product and docs now cover WeChat and DingTalk as first-class adapters. Update the Chinese and English READMEs so the first screen, desktop preview caption, feature list, and documentation table point readers to the current IM guide. Constraint: English IM docs do not have a separate docs/en/im tree yet, so both README variants link to the existing docs/im guide. Rejected: Keep the old Channel System links | they point readers at historical architecture instead of the current setup docs. Confidence: high Scope-risk: narrow Tested: bun run check:docs Not-tested: Live rendered README preview on GitHub
304 lines
13 KiB
Markdown
304 lines
13 KiB
Markdown
# Claude Code Haha
|
||
|
||
<p align="center">
|
||
<img src="docs/images/app-icon.png" alt="Claude Code Haha" width="240">
|
||
</p>
|
||
|
||
<div align="center">
|
||
|
||
[](https://github.com/NanmiCoder/cc-haha/stargazers)
|
||
[](https://github.com/NanmiCoder/cc-haha/network/members)
|
||
[](https://github.com/NanmiCoder/cc-haha/issues)
|
||
[](https://github.com/NanmiCoder/cc-haha/pulls)
|
||
[](https://github.com/NanmiCoder/cc-haha/blob/main/LICENSE)
|
||
[](README.md)
|
||
[](README.en.md)
|
||
[](https://claudecode-haha.relakkesyang.org)
|
||
|
||
</div>
|
||
|
||
基于 Claude Code 泄露源码修复的**本地可运行版本**,支持接入任意 Anthropic 兼容 API(MiniMax、OpenRouter 等)。在完整 TUI 之外,还补全了 Computer Use(macOS / Windows)、打造了图形化**桌面端**,并支持通过 Telegram / 飞书 / 微信 / 钉钉**完整远程驱动**。
|
||
|
||
<p align="center">
|
||
<a href="#桌面端预览">桌面端</a> · <a href="#功能">功能</a> · <a href="#架构概览">架构概览</a> · <a href="#快速开始">快速开始</a> · <a href="docs/guide/env-vars.md">环境变量</a> · <a href="docs/guide/faq.md">FAQ</a> · <a href="docs/guide/global-usage.md">全局使用</a> · <a href="#更多文档">更多文档</a>
|
||
</p>
|
||
|
||
---
|
||
|
||
## 桌面端预览
|
||
|
||
Claude Code Haha 的桌面端把会话、多项目、代码 Diff、权限确认、提供商配置、定时任务和 IM 适配器集中到一个图形化工作台里,适合不想长期停留在终端里的日常开发工作流。
|
||
|
||
<p align="center">
|
||
<a href="https://github.com/NanmiCoder/cc-haha/releases"><img src="https://img.shields.io/badge/⬇_下载桌面端-macOS_%7C_Windows-D97757?style=for-the-badge" alt="下载桌面端"></a>
|
||
|
||
<a href="docs/desktop/04-installation.md"><img src="https://img.shields.io/badge/📖_安装指南-Guide-gray?style=for-the-badge" alt="安装指南"></a>
|
||
</p>
|
||
|
||
<table>
|
||
<tr>
|
||
<td align="center" width="33%"><img src="docs/images/desktop_ui/01_full_ui.png" alt="主界面"><br><b>主界面</b></td>
|
||
<td align="center" width="33%"><img src="docs/images/desktop_ui/02_edit_code.png" alt="代码编辑"><br><b>代码编辑 & Diff 视图</b></td>
|
||
<td align="center" width="33%"><img src="docs/images/desktop_ui/03_ask_question_and_permission.png" alt="权限控制"><br><b>权限控制 & AI 提问</b></td>
|
||
</tr>
|
||
<tr>
|
||
<td align="center" width="33%"><img src="docs/images/desktop_ui/05_settings.png" alt="提供商设置"><br><b>多提供商管理</b></td>
|
||
<td align="center" width="33%"><img src="docs/images/desktop_ui/08_scheduled_task.png" alt="定时任务"><br><b>定时任务</b></td>
|
||
<td align="center" width="33%"><img src="docs/images/desktop_ui/07_im.png" alt="IM 适配器"><br><b>IM 适配器(Telegram / 飞书 / 微信 / 钉钉)</b></td>
|
||
</tr>
|
||
</table>
|
||
|
||
---
|
||
|
||
## 功能
|
||
|
||
- 完整的 Ink TUI 交互界面(与官方 Claude Code 一致)
|
||
- `--print` 无头模式(脚本/CI 场景)
|
||
- 支持 MCP 服务器、插件、Skills
|
||
- 支持自定义 API 端点和模型([第三方模型使用指南](docs/guide/third-party-models.md))
|
||
- **记忆系统**(跨会话持久化记忆)— [使用指南](docs/memory/01-usage-guide.md)
|
||
- **多 Agent 系统**(多代理编排、并行任务、Teams 协作)— [使用指南](docs/agent/01-usage-guide.md) | [实现原理](docs/agent/02-implementation.md)
|
||
- **Skills 系统**(可扩展能力插件、自定义工作流)— [使用指南](docs/skills/01-usage-guide.md) | [实现原理](docs/skills/02-implementation.md)
|
||
- **IM 接入**(通过 Telegram / 飞书 / 微信 / 钉钉远程对话、切换项目和审批权限)— [接入指南](docs/im/)
|
||
- **Computer Use 桌面控制** — [功能指南](docs/features/computer-use.md) | [架构解析](docs/features/computer-use-architecture.md)
|
||
- **桌面端**(Tauri 2 + React 图形化客户端,多标签多会话)— [文档](docs/desktop/)
|
||
- 降级 Recovery CLI 模式(`CLAUDE_CODE_FORCE_RECOVERY_CLI=1 ./bin/claude-haha`)
|
||
|
||
---
|
||
|
||
## 架构概览
|
||
|
||
<table>
|
||
<tr>
|
||
<td align="center" width="25%"><img src="docs/images/01-overall-architecture.png" alt="整体架构"><br><b>整体架构</b></td>
|
||
<td align="center" width="25%"><img src="docs/images/02-request-lifecycle.png" alt="请求生命周期"><br><b>请求生命周期</b></td>
|
||
<td align="center" width="25%"><img src="docs/images/03-tool-system.png" alt="工具系统"><br><b>工具系统</b></td>
|
||
<td align="center" width="25%"><img src="docs/images/04-multi-agent.png" alt="多 Agent 架构"><br><b>多 Agent 架构</b></td>
|
||
</tr>
|
||
<tr>
|
||
<td align="center" width="25%"><img src="docs/images/05-terminal-ui.png" alt="终端 UI"><br><b>终端 UI</b></td>
|
||
<td align="center" width="25%"><img src="docs/images/06-permission-security.png" alt="权限与安全"><br><b>权限与安全</b></td>
|
||
<td align="center" width="25%"><img src="docs/images/07-services-layer.png" alt="服务层"><br><b>服务层</b></td>
|
||
<td align="center" width="25%"><img src="docs/images/08-state-data-flow.png" alt="状态与数据流"><br><b>状态与数据流</b></td>
|
||
</tr>
|
||
</table>
|
||
|
||
## 快速开始
|
||
|
||
### 1. 安装 Bun
|
||
|
||
```bash
|
||
# macOS / Linux
|
||
curl -fsSL https://bun.sh/install | bash
|
||
|
||
# macOS (Homebrew)
|
||
brew install bun
|
||
|
||
# Windows (PowerShell)
|
||
powershell -c "irm bun.sh/install.ps1 | iex"
|
||
```
|
||
|
||
> 精简版 Linux 如提示 `unzip is required`,先运行 `apt update && apt install -y unzip`
|
||
|
||
### 2. 安装依赖并配置
|
||
|
||
```bash
|
||
bun install
|
||
cp .env.example .env
|
||
# 编辑 .env 填入你的 API Key,详见 docs/guide/env-vars.md
|
||
```
|
||
|
||
### 3. 启动
|
||
|
||
#### macOS / Linux
|
||
|
||
```bash
|
||
./bin/claude-haha # 交互 TUI 模式
|
||
./bin/claude-haha -p "your prompt here" # 无头模式
|
||
./bin/claude-haha --help # 查看所有选项
|
||
```
|
||
|
||
#### Windows
|
||
|
||
> **前置要求**:必须安装 [Git for Windows](https://git-scm.com/download/win)
|
||
|
||
```powershell
|
||
# PowerShell / cmd 直接调用 Bun
|
||
bun --env-file=.env ./src/entrypoints/cli.tsx
|
||
|
||
# 或在 Git Bash 中运行
|
||
./bin/claude-haha
|
||
```
|
||
|
||
### 4. 全局使用(可选)
|
||
|
||
将 `bin/` 加入 PATH 后可在任意目录启动,详见 [全局使用指南](docs/guide/global-usage.md):
|
||
|
||
```bash
|
||
export PATH="$HOME/path/to/claude-code-haha/bin:$PATH"
|
||
```
|
||
|
||
### 5. 桌面端联调(Desktop)
|
||
|
||
如果你在开发或测试 `desktop/` 前端,需要同时启动 API 服务端和桌面前端。
|
||
|
||
#### 5.1 启动服务端
|
||
|
||
```bash
|
||
cd /Users/nanmi/workspace/myself_code/claude-code-haha
|
||
SERVER_PORT=3456 bun run src/server/index.ts
|
||
```
|
||
|
||
可选自检:
|
||
|
||
```bash
|
||
curl http://127.0.0.1:3456/health
|
||
```
|
||
|
||
#### 5.2 启动桌面前端
|
||
|
||
```bash
|
||
cd /Users/nanmi/workspace/myself_code/claude-code-haha/desktop
|
||
bun run dev --host 127.0.0.1 --port 2024
|
||
```
|
||
|
||
然后在浏览器打开:
|
||
|
||
```text
|
||
http://127.0.0.1:2024
|
||
```
|
||
|
||
#### 5.3 常见注意事项
|
||
|
||
- 如果 `3456` 端口已经被旧服务端占用,先执行 `lsof -nP -iTCP:3456 -sTCP:LISTEN` 找到 PID,再 `kill <PID>`。
|
||
- 测试聊天时建议新建一个 session,并重新选择一个真实存在的工作目录。
|
||
- 如果某个旧 session 绑定的目录已被删除,服务端会返回 `Working directory does not exist`,这和服务端是否启动是两回事。
|
||
|
||
---
|
||
|
||
## 赞助与合作
|
||
|
||
本项目由个人利用业余时间维护,欢迎企业或个人赞助支持持续开发,也可洽谈定制、集成或商务合作。
|
||
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th width="220">赞助商</th>
|
||
<th align="left">介绍</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td align="center" valign="middle">
|
||
<a href="https://jiekou.ai/referral?invited_code=OBNU3K">
|
||
<img src="docs/images/sponsors/jiekou-logo.svg" width="72" alt="接口AI"><br>
|
||
<strong>接口AI</strong>
|
||
</a>
|
||
</td>
|
||
<td valign="middle">
|
||
感谢 <a href="https://jiekou.ai/referral?invited_code=OBNU3K">接口AI</a> 赞助本项目!接口AI 提供官方资源直供与稳定高性能 API 体验,订阅包价格为官方 8 折;使用 <a href="https://jiekou.ai/referral?invited_code=OBNU3K">专属链接</a> 注册并绑定 GitHub,可领取 3 美元优惠券。
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td align="center" valign="middle">
|
||
<a href="https://www.shengsuanyun.com/?from=CH_LEJ88KWR">
|
||
<img src="docs/images/sponsors/shengsuanyun-logo.svg" width="180" alt="胜算云">
|
||
</a>
|
||
</td>
|
||
<td valign="middle">
|
||
感谢 <a href="https://www.shengsuanyun.com/?from=CH_LEJ88KWR">胜算云</a> 赞助本项目!胜算云是面向 AI Native Teams 的工业级 AI 任务并行执行平台,聚合 Claude、ChatGPT、Gemini 等海内外 LLM 及图片、视频多媒体模型算力;官方直连、非逆向,平台 SLA 可用性达 99.7%,可查看 <a href="https://watch.shengsuanyun.com/status/shengsuanyun">服务状态</a>。平台支持企业专属网关、成本与权限管控、智能路由、安全防护和 BYOK,按量与 tokens plan(即将上线)计费并可开票;使用 <a href="https://www.shengsuanyun.com/?from=CH_LEJ88KWR">专属链接</a> 注册可获 10 元模力及首充 10% 赠送。
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
📧 **联系邮箱**:relakkes@gmail.com
|
||
|
||
---
|
||
|
||
## ☕ 请作者喝杯咖啡
|
||
|
||
如果这个项目对您有帮助,欢迎打赏支持,您的每一份支持都是我持续更新的动力 ❤️
|
||
|
||
<table>
|
||
<tr>
|
||
<td align="center" width="33%">
|
||
<img src="docs/images/donate/wechat_pay.jpeg" width="250" alt="微信赞赏"><br>
|
||
<b>微信赞赏</b>
|
||
</td>
|
||
<td align="center" width="33%">
|
||
<img src="docs/images/donate/zfb_pay.png" width="250" alt="支付宝"><br>
|
||
<b>支付宝</b>
|
||
</td>
|
||
<td align="center" width="33%">
|
||
<a href="https://buymeacoffee.com/relakkes" target="_blank">
|
||
<img src="docs/images/donate/bmc_button.png" width="250" alt="Buy Me a Coffee">
|
||
</a><br>
|
||
<b>Buy Me a Coffee</b>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
|
||
---
|
||
|
||
## 技术栈
|
||
|
||
| 类别 | 技术 |
|
||
|------|------|
|
||
| 运行时 | [Bun](https://bun.sh) |
|
||
| 语言 | TypeScript |
|
||
| 终端 UI | React + [Ink](https://github.com/vadimdemedes/ink) |
|
||
| CLI 解析 | Commander.js |
|
||
| API | Anthropic SDK |
|
||
| 协议 | MCP, LSP |
|
||
|
||
---
|
||
|
||
## 更多文档
|
||
|
||
| 文档 | 说明 |
|
||
|------|------|
|
||
| [环境变量](docs/guide/env-vars.md) | 完整环境变量参考和配置方式 |
|
||
| [第三方模型](docs/guide/third-party-models.md) | 接入 OpenAI / DeepSeek / Ollama 等非 Anthropic 模型 |
|
||
| [贡献与质量门禁](docs/guide/contributing.md) | 本地测试、真实模型 baseline、PR 和 release 门禁 |
|
||
| [记忆系统](docs/memory/01-usage-guide.md) | 跨会话持久化记忆的使用与实现 |
|
||
| [多 Agent 系统](docs/agent/01-usage-guide.md) | 多代理编排、并行任务执行与 Teams 协作 |
|
||
| [Skills 系统](docs/skills/01-usage-guide.md) | 可扩展能力插件、自定义工作流与条件激活 |
|
||
| [IM 接入](docs/im/) | 通过 Telegram / 飞书 / 微信 / 钉钉远程对话、切换项目和审批权限 |
|
||
| [Computer Use](docs/features/computer-use.md) | 桌面控制功能(截屏、鼠标、键盘)— [架构解析](docs/features/computer-use-architecture.md) |
|
||
| [桌面端](docs/desktop/) | Tauri 2 + React 图形化客户端 — [快速上手](docs/desktop/01-quick-start.md) \| [架构设计](docs/desktop/02-architecture.md) \| [安装指南](docs/desktop/04-installation.md) |
|
||
| [全局使用](docs/guide/global-usage.md) | 在任意目录启动 claude-haha |
|
||
| [常见问题](docs/guide/faq.md) | 常见错误排查 |
|
||
| [源码修复记录](docs/reference/fixes.md) | 相对于原始泄露源码的修复内容 |
|
||
| [项目结构](docs/reference/project-structure.md) | 代码目录结构说明 |
|
||
|
||
---
|
||
|
||
## 感谢
|
||
|
||
感谢以下开源项目和社区实践为本项目提供参考与启发:
|
||
|
||
- [React](https://github.com/facebook/react):前端工程与组件化 UI 生态。
|
||
- [Tauri](https://github.com/tauri-apps/tauri):跨端桌面应用能力与工程实践。
|
||
- [cc-switch](https://github.com/farion1231/cc-switch):模型供应商配置能力参考。
|
||
|
||
---
|
||
|
||
## ⭐ Star 趋势图
|
||
|
||
如果这个项目对您有帮助,请给个 ⭐ Star 支持一下,让更多的人看到 Claude Code Haha!
|
||
|
||
<a href="https://www.star-history.com/#NanmiCoder/cc-haha&Date">
|
||
<picture>
|
||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=NanmiCoder/cc-haha&type=Date&theme=dark" />
|
||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=NanmiCoder/cc-haha&type=Date" />
|
||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=NanmiCoder/cc-haha&type=Date" />
|
||
</picture>
|
||
</a>
|
||
|
||
---
|
||
|
||
## Disclaimer
|
||
|
||
本仓库基于 2026-03-31 从 Anthropic npm registry 泄露的 Claude Code 源码。所有原始源码版权归 [Anthropic](https://www.anthropic.com) 所有。仅供学习和研究用途。
|