diff --git a/README.en.md b/README.en.md index fe03e176..e515e99e 100644 --- a/README.en.md +++ b/README.en.md @@ -17,17 +17,17 @@ -A **locally runnable version** repaired from the leaked Claude Code source, with support for any Anthropic-compatible API endpoint (MiniMax, OpenRouter, etc.). Beyond the full TUI, we've also completed Computer Use (macOS / Windows), built a GUI **desktop app**, and enabled **full remote control** via Telegram / Feishu / WeChat / DingTalk. +A Claude Code build repaired from the source leaked from Anthropic's npm registry on 2026-03-31. Claude Code Haha is now primarily a **desktop Claude Code workspace** for macOS and Windows: sessions, projects, branch / Worktree launch, right-side file changes, code diffs, permission review, provider setup, Computer Use, H5 remote access, IM integration, and scheduled tasks in one app.

- Desktop · Features · Architecture · Quick Start · Env Vars · FAQ · Global Usage · More Docs + Desktop Preview · Install · Highlights · Sponsorship · More Docs

--- ## Desktop Preview -The Claude Code Haha desktop app brings sessions, multi-project navigation, code diffs, permission review, provider setup, scheduled tasks, and IM adapters into one graphical workspace for daily development flows beyond the terminal. +The Claude Code Haha desktop app brings sessions, multi-project navigation, branch / Worktree controls, right-side file changes, code diffs, permission review, provider setup, and remote access into one graphical workspace for daily development flows beyond the terminal.

Download Desktop @@ -37,142 +37,73 @@ The Claude Code Haha desktop app brings sessions, multi-project navigation, code - - - + + + + - - - + + + +
Main UI
Main Interface
Code Editing
Code Editing & Diff View
Permission Control
Permission Control & AI Questions
Desktop workspace
Desktop Workspace
Right-side changes and Worktree
Right-side Changes & Worktree
Code editing
Code Editing & Diff View
Permission control
Permission Review & AI Questions
Provider Settings
Multi-Provider Management
Scheduled Tasks
Scheduled Tasks
IM Adapters
IM Adapters (Telegram / Feishu / WeChat / DingTalk)
H5 remote access
H5 Remote Access
Token usage
Token Usage
Computer Use
Computer Use
Scheduled tasks
Scheduled Tasks
--- -## Features +## Install the Desktop App -- Full Ink TUI experience (matching the official Claude Code interface) -- `--print` headless mode for scripts and CI -- MCP server, plugin, and Skills support -- Custom API endpoint and model support ([Third-Party Models Guide](docs/en/guide/third-party-models.md)) -- **Memory System** (cross-session persistent memory) — [Usage Guide](docs/memory/01-usage-guide.md) -- **Multi-Agent System** (agent orchestration, parallel tasks, Teams collaboration) — [Usage Guide](docs/agent/01-usage-guide.md) | [Implementation](docs/agent/02-implementation.md) -- **Skills System** (extensible capability plugins, custom workflows) — [Usage Guide](docs/skills/01-usage-guide.md) | [Implementation](docs/skills/02-implementation.md) -- **IM Integration** (remote chat, project switching, and permission approval via Telegram / Feishu / WeChat / DingTalk) — [Guide](docs/im/) -- **Computer Use desktop control** — [Guide](docs/en/features/computer-use.md) | [Architecture](docs/en/features/computer-use-architecture.md) -- **Desktop App** (Tauri 2 + React GUI client, multi-tab multi-session) — [Docs](docs/desktop/) -- Fallback Recovery CLI mode (`CLAUDE_CODE_FORCE_RECOVERY_CLI=1 ./bin/claude-haha`) +1. Download the macOS or Windows desktop installer from [Releases](https://github.com/NanmiCoder/cc-haha/releases). +2. On first launch, configure your model provider, API key, and default model in Settings. +3. If macOS blocks the app on first open, follow the [desktop installation guide](docs/desktop/04-installation.md) for Gatekeeper steps. ---- +## Run the CLI from Source -## Architecture Overview - - - - - - - - - - - - - - -
Overall architecture
Overall architecture
Request lifecycle
Request lifecycle
Tool system
Tool system
Multi-agent architecture
Multi-agent architecture
Terminal UI
Terminal UI
Permissions and security
Permissions and security
Services layer
Services layer
State and data flow
State and data flow
- -## Quick Start - -### 1. Install 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" -``` - -> On minimal Linux images, if you see `unzip is required`, run `apt update && apt install -y unzip` first. - -### 2. Install Dependencies and Configure +For users who want to debug the underlying CLI, server, or local development flow: ```bash bun install cp .env.example .env -# Edit .env with your API key — see docs/en/guide/env-vars.md for details -``` - -### 3. Start - -#### macOS / Linux - -```bash -./bin/claude-haha # Interactive TUI mode -./bin/claude-haha -p "your prompt here" # Headless mode -./bin/claude-haha --help # Show all options -``` - -#### Windows - -> **Prerequisite**: [Git for Windows](https://git-scm.com/download/win) must be installed. - -```powershell -# PowerShell / cmd — call Bun directly -bun --env-file=.env ./src/entrypoints/cli.tsx - -# Or run inside Git Bash ./bin/claude-haha ``` -### 4. Global Usage (Optional) +See [environment variables](docs/en/guide/env-vars.md) and [global usage](docs/en/guide/global-usage.md) for more configuration options. -Add `bin/` to your PATH to run from any directory. See [Global Usage Guide](docs/en/guide/global-usage.md): +--- -```bash -export PATH="$HOME/path/to/claude-code-haha/bin:$PATH" -``` +## Desktop Highlights -### 5. Desktop Development +- **Multi-session workspace**: tabs, project switching, terminal entry, and session history in one place. +- **Branch / Worktree launch**: choose a repository branch and decide whether to use the current working tree or an isolated Worktree. +- **Right-side file changes**: review changed files, added/removed lines, and current workspace state while chatting. +- **Visual code changes**: inspect edits, file writes, and diffs directly in the desktop app. +- **Permission review**: approve risky commands, tool calls, and model follow-up questions in the GUI. +- **Multi-provider setup**: configure Anthropic-compatible APIs, third-party models, WebSearch fallback, and local options. +- **Computer Use**: let the agent take screenshots, click, type, and control desktop apps after authorization. +- **H5 remote access**: open the current desktop session from a phone or another device with a one-time token. +- **IM integration**: chat, switch projects, and approve actions through Telegram / Feishu / WeChat / DingTalk. +- **Scheduled tasks and usage stats**: create planned tasks and track local token usage trends. -If you are developing or testing the `desktop/` frontend, start both the API server and the desktop frontend. +--- -#### 5.1 Start the API server +## More Documentation -```bash -cd /Users/nanmi/workspace/myself_code/claude-code-haha -SERVER_PORT=3456 bun run src/server/index.ts -``` - -Optional health check: - -```bash -curl http://127.0.0.1:3456/health -``` - -#### 5.2 Start the desktop frontend - -```bash -cd /Users/nanmi/workspace/myself_code/claude-code-haha/desktop -bun run dev --host 127.0.0.1 --port 2024 -``` - -Then open: - -```text -http://127.0.0.1:2024 -``` - -#### 5.3 Notes - -- If port `3456` is already occupied by an old server process, run `lsof -nP -iTCP:3456 -sTCP:LISTEN`, find the PID, then `kill `. -- For chat testing, create a fresh session and re-select a real working directory. -- If an old session points to a deleted directory, the server will return `Working directory does not exist`. That is separate from whether the API server is running. +| Document | Description | +|------|------| +| [Environment Variables](docs/en/guide/env-vars.md) | Full env var reference and configuration methods | +| [Third-Party Models](docs/en/guide/third-party-models.md) | Using OpenAI / DeepSeek / Ollama and other non-Anthropic models | +| [Contributing](docs/en/guide/contributing.md) | Local tests, live model baselines, PR gates, and release gates | +| [Memory System](docs/memory/01-usage-guide.md) | Cross-session persistent memory usage and implementation | +| [Multi-Agent System](docs/agent/01-usage-guide.md) | Agent orchestration, parallel tasks and Teams collaboration | +| [Skills System](docs/skills/01-usage-guide.md) | Extensible capability plugins, custom workflows and conditional activation | +| [IM Integration](docs/im/) | Remote chat, project switching, and permission approval via Telegram / Feishu / WeChat / DingTalk | +| [Computer Use](docs/en/features/computer-use.md) | Desktop control (screenshots, mouse, keyboard) — [Architecture](docs/en/features/computer-use-architecture.md) | +| [Desktop App](docs/desktop/) | Tauri 2 + React GUI client — [Quick Start](docs/desktop/01-quick-start.md) \| [Architecture](docs/desktop/02-architecture.md) \| [Installation](docs/desktop/04-installation.md) | +| [Global Usage](docs/en/guide/global-usage.md) | Run claude-haha from any directory | +| [FAQ](docs/en/guide/faq.md) | Common error troubleshooting | +| [Source Fixes](docs/en/reference/fixes.md) | Fixes compared with the original leaked source | +| [Project Structure](docs/en/reference/project-structure.md) | Code directory structure | --- @@ -245,35 +176,15 @@ If this project helps you, consider buying me a coffee — every bit of support | Category | Technology | |------|------| -| Runtime | [Bun](https://bun.sh) | | Language | TypeScript | +| Desktop app | Tauri 2 | +| Desktop UI | React + Vite | +| Local runtime | [Bun](https://bun.sh) | | Terminal UI | React + [Ink](https://github.com/vadimdemedes/ink) | | CLI parsing | Commander.js | | API | Anthropic SDK | | Protocols | MCP, LSP | ---- - -## More Documentation - -| Document | Description | -|------|------| -| [Environment Variables](docs/en/guide/env-vars.md) | Full env var reference and configuration methods | -| [Third-Party Models](docs/en/guide/third-party-models.md) | Using OpenAI / DeepSeek / Ollama and other non-Anthropic models | -| [Contributing](docs/en/guide/contributing.md) | Local tests, live model baselines, PR gates, and release gates | -| [Memory System](docs/memory/01-usage-guide.md) | Cross-session persistent memory usage and implementation | -| [Multi-Agent System](docs/agent/01-usage-guide.md) | Agent orchestration, parallel tasks and Teams collaboration | -| [Skills System](docs/skills/01-usage-guide.md) | Extensible capability plugins, custom workflows and conditional activation | -| [IM Integration](docs/im/) | Remote chat, project switching, and permission approval via Telegram / Feishu / WeChat / DingTalk | -| [Computer Use](docs/en/features/computer-use.md) | Desktop control (screenshots, mouse, keyboard) — [Architecture](docs/en/features/computer-use-architecture.md) | -| [Desktop App](docs/desktop/) | Tauri 2 + React GUI client — [Quick Start](docs/desktop/01-quick-start.md) \| [Architecture](docs/desktop/02-architecture.md) \| [Installation](docs/desktop/04-installation.md) | -| [Global Usage](docs/en/guide/global-usage.md) | Run claude-haha from any directory | -| [FAQ](docs/en/guide/faq.md) | Common error troubleshooting | -| [Source Fixes](docs/en/reference/fixes.md) | Fixes compared with the original leaked source | -| [Project Structure](docs/en/reference/project-structure.md) | Code directory structure | - ---- - ## Thanks Thanks to the following open-source projects and community practices for reference and inspiration: diff --git a/README.md b/README.md index bb564f92..ecdae44a 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,17 @@ -基于 Claude Code 泄露源码修复的**本地可运行版本**,支持接入任意 Anthropic 兼容 API(MiniMax、OpenRouter 等)。在完整 TUI 之外,还补全了 Computer Use(macOS / Windows)、打造了图形化**桌面端**,并支持通过 Telegram / 飞书 / 微信 / 钉钉**完整远程驱动**。 +Claude Code Haha 基于 2026-03-31 从 Anthropic npm registry 泄露的 Claude Code 源码修复而来,现在主要是一个**桌面端 Claude Code 工作台**:把会话、多项目、分支 / Worktree、右侧代码改动、代码 Diff、权限审批、模型提供商、Computer Use、H5 远程访问、IM 接入和定时任务集中到一个 macOS / Windows APP 里。

- 桌面端 · 功能 · 架构概览 · 快速开始 · 环境变量 · FAQ · 全局使用 · 更多文档 + 桌面端预览 · 安装桌面端 · 桌面端亮点 · 赞助与合作 · 更多文档

--- ## 桌面端预览 -Claude Code Haha 的桌面端把会话、多项目、代码 Diff、权限确认、提供商配置、定时任务和 IM 适配器集中到一个图形化工作台里,适合不想长期停留在终端里的日常开发工作流。 +Claude Code Haha 的桌面端把会话、多项目、分支 / Worktree、右侧代码改动、代码 Diff、权限确认、提供商配置和远程入口集中到一个图形化工作台里,适合不想长期停留在终端里的日常开发工作流。

下载桌面端 @@ -37,142 +37,73 @@ Claude Code Haha 的桌面端把会话、多项目、代码 Diff、权限确认 - - - + + + + - - - + + + +
主界面
主界面
代码编辑
代码编辑 & Diff 视图
权限控制
权限控制 & AI 提问
桌面端工作台
桌面端工作台
右侧代码改动与 Worktree
右侧代码改动 & Worktree
代码编辑
代码编辑 & Diff 视图
权限控制
权限控制 & AI 提问
提供商设置
多提供商管理
定时任务
定时任务
IM 适配器
IM 适配器(Telegram / 飞书 / 微信 / 钉钉)
H5 访问
H5 远程访问
Token 用量
Token 用量统计
Computer Use
Computer Use
定时任务
定时任务
--- -## 功能 +## 安装桌面端 -- 完整的 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`) +1. 前往 [Releases](https://github.com/NanmiCoder/cc-haha/releases) 下载 macOS 或 Windows 桌面端安装包。 +2. 首次启动后,在桌面端设置里配置模型提供商、API Key 和默认模型。 +3. 如果 macOS 提示应用无法打开,请按 [桌面端安装指南](docs/desktop/04-installation.md) 处理 Gatekeeper 权限。 ---- +## 从源码启动 CLI -## 架构概览 - - - - - - - - - - - - - - -
整体架构
整体架构
请求生命周期
请求生命周期
工具系统
工具系统
多 Agent 架构
多 Agent 架构
终端 UI
终端 UI
权限与安全
权限与安全
服务层
服务层
状态与数据流
状态与数据流
- -## 快速开始 - -### 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. 安装依赖并配置 +适合想调试底层 CLI、服务端或自行开发的用户: ```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. 全局使用(可选) +更多配置见 [环境变量](docs/guide/env-vars.md) 和 [全局使用](docs/guide/global-usage.md)。 -将 `bin/` 加入 PATH 后可在任意目录启动,详见 [全局使用指南](docs/guide/global-usage.md): +--- -```bash -export PATH="$HOME/path/to/claude-code-haha/bin:$PATH" -``` +## 桌面端亮点 -### 5. 桌面端联调(Desktop) +- **多会话工作台**:标签页、项目切换、终端入口和会话历史集中管理。 +- **分支 / Worktree 启动**:新会话可以选择仓库分支,并决定使用当前工作树还是隔离 Worktree。 +- **右侧代码改动面板**:聊天时直接在右侧查看已更改文件、增删行和当前工作区状态。 +- **代码修改可视化**:直接查看 AI 对文件的编辑、Diff 和执行过程。 +- **权限与确认流**:危险命令、工具调用和 AI 反问可以在桌面端集中审批。 +- **多模型提供商**:支持 Anthropic 兼容 API、第三方模型、WebSearch fallback 和本地配置。 +- **Computer Use**:让 Agent 在授权后截图、点击、输入并控制桌面应用。 +- **H5 远程访问**:用一次性令牌在手机或其他设备上接入当前桌面端会话。 +- **IM 接入**:通过 Telegram / 飞书 / 微信 / 钉钉远程对话、切换项目和审批权限。 +- **定时任务与用量统计**:在桌面端创建计划任务,并查看本机 Token 使用趋势。 -如果你在开发或测试 `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 `。 -- 测试聊天时建议新建一个 session,并重新选择一个真实存在的工作目录。 -- 如果某个旧 session 绑定的目录已被删除,服务端会返回 `Working directory does not exist`,这和服务端是否启动是两回事。 +| 文档 | 说明 | +|------|------| +| [环境变量](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) | 代码目录结构说明 | --- @@ -245,35 +176,15 @@ http://127.0.0.1:2024 | 类别 | 技术 | |------|------| -| 运行时 | [Bun](https://bun.sh) | | 语言 | TypeScript | +| 桌面 APP | Tauri 2 | +| 桌面 UI | React + Vite | +| 本地运行时 | [Bun](https://bun.sh) | | 终端 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) | 代码目录结构说明 | - ---- - ## 感谢 感谢以下开源项目和社区实践为本项目提供参考与启发: diff --git a/docs/images/desktop_ui/10_desktop_workspace.png b/docs/images/desktop_ui/10_desktop_workspace.png new file mode 100644 index 00000000..72159790 Binary files /dev/null and b/docs/images/desktop_ui/10_desktop_workspace.png differ diff --git a/docs/images/desktop_ui/11_token_usage.png b/docs/images/desktop_ui/11_token_usage.png new file mode 100644 index 00000000..68737ffb Binary files /dev/null and b/docs/images/desktop_ui/11_token_usage.png differ diff --git a/docs/images/desktop_ui/12_h5_access.png b/docs/images/desktop_ui/12_h5_access.png new file mode 100644 index 00000000..a8898cd9 Binary files /dev/null and b/docs/images/desktop_ui/12_h5_access.png differ diff --git a/docs/images/desktop_ui/13_workspace_changes_worktree.png b/docs/images/desktop_ui/13_workspace_changes_worktree.png new file mode 100644 index 00000000..9ff45fb4 Binary files /dev/null and b/docs/images/desktop_ui/13_workspace_changes_worktree.png differ