mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
docs: present desktop app as primary entrypoint
The README is now the first screen most users see before deciding whether to download the app, so it leads with the desktop workflow, recent app features, and current screenshots while keeping CLI-from-source setup compact. Constraint: Homepage should still mention the leaked Claude Code source origin. Rejected: Keep the expanded CLI quick start on the homepage | it pushed sponsor and desktop content too far down. Confidence: high Scope-risk: narrow Tested: bun run --silent check:docs Tested: README image reference checks for Chinese and English files Not-tested: GitHub README rendering after push
This commit is contained in:
parent
6ae98a2f4e
commit
08d1e0e8c2
189
README.en.md
189
README.en.md
@ -17,17 +17,17 @@
|
||||
|
||||
</div>
|
||||
|
||||
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.
|
||||
|
||||
<p align="center">
|
||||
<a href="#desktop-preview">Desktop</a> · <a href="#features">Features</a> · <a href="#architecture-overview">Architecture</a> · <a href="#quick-start">Quick Start</a> · <a href="docs/en/guide/env-vars.md">Env Vars</a> · <a href="docs/en/guide/faq.md">FAQ</a> · <a href="docs/en/guide/global-usage.md">Global Usage</a> · <a href="#more-documentation">More Docs</a>
|
||||
<a href="#desktop-preview">Desktop Preview</a> · <a href="#install-the-desktop-app">Install</a> · <a href="#desktop-highlights">Highlights</a> · <a href="#sponsorship--partnership">Sponsorship</a> · <a href="#more-documentation">More Docs</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## 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.
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/NanmiCoder/cc-haha/releases"><img src="https://img.shields.io/badge/⬇_Download_Desktop-macOS_%7C_Windows-D97757?style=for-the-badge" alt="Download Desktop"></a>
|
||||
@ -37,142 +37,73 @@ The Claude Code Haha desktop app brings sessions, multi-project navigation, code
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center" width="33%"><img src="docs/images/desktop_ui/01_full_ui.png" alt="Main UI"><br><b>Main Interface</b></td>
|
||||
<td align="center" width="33%"><img src="docs/images/desktop_ui/02_edit_code.png" alt="Code Editing"><br><b>Code Editing & Diff View</b></td>
|
||||
<td align="center" width="33%"><img src="docs/images/desktop_ui/03_ask_question_and_permission.png" alt="Permission Control"><br><b>Permission Control & AI Questions</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/10_desktop_workspace.png" alt="Desktop workspace"><br><b>Desktop Workspace</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/13_workspace_changes_worktree.png" alt="Right-side changes and Worktree"><br><b>Right-side Changes & Worktree</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/02_edit_code.png" alt="Code editing"><br><b>Code Editing & Diff View</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/03_ask_question_and_permission.png" alt="Permission control"><br><b>Permission Review & AI Questions</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="33%"><img src="docs/images/desktop_ui/05_settings.png" alt="Provider Settings"><br><b>Multi-Provider Management</b></td>
|
||||
<td align="center" width="33%"><img src="docs/images/desktop_ui/08_scheduled_task.png" alt="Scheduled Tasks"><br><b>Scheduled Tasks</b></td>
|
||||
<td align="center" width="33%"><img src="docs/images/desktop_ui/07_im.png" alt="IM Adapters"><br><b>IM Adapters (Telegram / Feishu / WeChat / DingTalk)</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/12_h5_access.png" alt="H5 remote access"><br><b>H5 Remote Access</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/11_token_usage.png" alt="Token usage"><br><b>Token Usage</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/06_settings_computer_use.png" alt="Computer Use"><br><b>Computer Use</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/08_scheduled_task.png" alt="Scheduled tasks"><br><b>Scheduled Tasks</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## 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
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center" width="25%"><img src="docs/images/01-overall-architecture.png" alt="Overall architecture"><br><b>Overall architecture</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/02-request-lifecycle.png" alt="Request lifecycle"><br><b>Request lifecycle</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/03-tool-system.png" alt="Tool system"><br><b>Tool system</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/04-multi-agent.png" alt="Multi-agent architecture"><br><b>Multi-agent architecture</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="25%"><img src="docs/images/05-terminal-ui.png" alt="Terminal UI"><br><b>Terminal UI</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/06-permission-security.png" alt="Permissions and security"><br><b>Permissions and security</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/07-services-layer.png" alt="Services layer"><br><b>Services layer</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/08-state-data-flow.png" alt="State and data flow"><br><b>State and data flow</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## 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 <PID>`.
|
||||
- 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:
|
||||
|
||||
189
README.md
189
README.md
@ -17,17 +17,17 @@
|
||||
|
||||
</div>
|
||||
|
||||
基于 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 里。
|
||||
|
||||
<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>
|
||||
<a href="#桌面端预览">桌面端预览</a> · <a href="#安装桌面端">安装桌面端</a> · <a href="#桌面端亮点">桌面端亮点</a> · <a href="#赞助与合作">赞助与合作</a> · <a href="#更多文档">更多文档</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## 桌面端预览
|
||||
|
||||
Claude Code Haha 的桌面端把会话、多项目、代码 Diff、权限确认、提供商配置、定时任务和 IM 适配器集中到一个图形化工作台里,适合不想长期停留在终端里的日常开发工作流。
|
||||
Claude Code Haha 的桌面端把会话、多项目、分支 / Worktree、右侧代码改动、代码 Diff、权限确认、提供商配置和远程入口集中到一个图形化工作台里,适合不想长期停留在终端里的日常开发工作流。
|
||||
|
||||
<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>
|
||||
@ -37,142 +37,73 @@ Claude Code Haha 的桌面端把会话、多项目、代码 Diff、权限确认
|
||||
|
||||
<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>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/10_desktop_workspace.png" alt="桌面端工作台"><br><b>桌面端工作台</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/13_workspace_changes_worktree.png" alt="右侧代码改动与 Worktree"><br><b>右侧代码改动 & Worktree</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/02_edit_code.png" alt="代码编辑"><br><b>代码编辑 & Diff 视图</b></td>
|
||||
<td align="center" width="25%"><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>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/12_h5_access.png" alt="H5 访问"><br><b>H5 远程访问</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/11_token_usage.png" alt="Token 用量"><br><b>Token 用量统计</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/06_settings_computer_use.png" alt="Computer Use"><br><b>Computer Use</b></td>
|
||||
<td align="center" width="25%"><img src="docs/images/desktop_ui/08_scheduled_task.png" alt="定时任务"><br><b>定时任务</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`)
|
||||
1. 前往 [Releases](https://github.com/NanmiCoder/cc-haha/releases) 下载 macOS 或 Windows 桌面端安装包。
|
||||
2. 首次启动后,在桌面端设置里配置模型提供商、API Key 和默认模型。
|
||||
3. 如果 macOS 提示应用无法打开,请按 [桌面端安装指南](docs/desktop/04-installation.md) 处理 Gatekeeper 权限。
|
||||
|
||||
---
|
||||
## 从源码启动 CLI
|
||||
|
||||
## 架构概览
|
||||
|
||||
<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. 安装依赖并配置
|
||||
适合想调试底层 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 <PID>`。
|
||||
- 测试聊天时建议新建一个 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) | 代码目录结构说明 |
|
||||
|
||||
---
|
||||
|
||||
## 感谢
|
||||
|
||||
感谢以下开源项目和社区实践为本项目提供参考与启发:
|
||||
|
||||
BIN
docs/images/desktop_ui/10_desktop_workspace.png
Normal file
BIN
docs/images/desktop_ui/10_desktop_workspace.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 231 KiB |
BIN
docs/images/desktop_ui/11_token_usage.png
Normal file
BIN
docs/images/desktop_ui/11_token_usage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 250 KiB |
BIN
docs/images/desktop_ui/12_h5_access.png
Normal file
BIN
docs/images/desktop_ui/12_h5_access.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 352 KiB |
BIN
docs/images/desktop_ui/13_workspace_changes_worktree.png
Normal file
BIN
docs/images/desktop_ui/13_workspace_changes_worktree.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 350 KiB |
Loading…
x
Reference in New Issue
Block a user