diff --git a/README.md b/README.md index 3ffa43c..9646ae2 100644 --- a/README.md +++ b/README.md @@ -3,30 +3,31 @@ **A native desktop GUI for Claude Code** -- chat, code, and manage projects through a polished visual interface instead of the terminal. -[中文文档](./README_CN.md) +[![GitHub release](https://img.shields.io/github/v/release/op7418/CodePilot)](https://github.com/op7418/CodePilot/releases) +[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Windows-lightgrey)](https://github.com/op7418/CodePilot/releases) +[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE) - - - - +[中文文档](./README_CN.md) --- ## Features -- **Conversational coding** -- Stream responses from Claude in real time with full Markdown rendering, syntax-highlighted code blocks, and tool-call visualization. -- **Session management** -- Create, rename, archive, and resume chat sessions. Conversations are persisted locally in SQLite so nothing is lost between restarts. -- **Project-aware context** -- Pick a working directory per session. The right panel shows a live file tree and file previews so you always know what Claude is looking at. -- **Permission controls** -- Approve, deny, or auto-allow tool use on a per-action basis. Choose between permission modes to match your comfort level. -- **Multiple interaction modes** -- Switch between *Code*, *Plan*, and *Ask* modes to control how Claude behaves in each session. -- **Model selector** -- Switch between Claude models (Opus, Sonnet, Haiku) mid-conversation. -- **MCP server management** -- Add, configure, and remove Model Context Protocol servers directly from the Extensions page. Supports `stdio`, `sse`, and `http` transport types. -- **Custom skills** -- Define reusable prompt-based skills (global or per-project) that can be invoked as slash commands during chat. -- **Settings editor** -- Visual and JSON editors for your `~/.claude/settings.json`, including permissions and environment variables. -- **Token usage tracking** -- See input/output token counts and estimated cost after every assistant response. -- **Dark / Light theme** -- One-click theme toggle in the navigation rail. -- **Slash commands** -- Built-in commands like `/help`, `/clear`, `/cost`, `/compact`, `/doctor`, `/review`, and more. -- **Electron packaging** -- Ships as a native desktop app with a hidden title bar, bundled Next.js server, and automatic port allocation. +- **💬 Conversational coding** -- Stream responses from Claude in real time with full Markdown rendering, syntax-highlighted code blocks, and tool-call visualization. +- **📂 Session management** -- Create, rename, archive, and resume chat sessions. Conversations are persisted locally in SQLite so nothing is lost between restarts. +- **🎯 Project-aware context** -- Pick a working directory per session. The right panel shows a live file tree and file previews so you always know what Claude is looking at. +- **🔒 Permission controls** -- Approve, deny, or auto-allow tool use on a per-action basis. Choose between permission modes to match your comfort level. +- **🎭 Multiple interaction modes** -- Switch between *Code*, *Plan*, and *Ask* modes to control how Claude behaves in each session. +- **🤖 Model selector** -- Switch between Claude models (Opus, Sonnet, Haiku) mid-conversation. +- **🔌 MCP server management** -- Add, configure, and remove Model Context Protocol servers directly from the Extensions page. Supports `stdio`, `sse`, and `http` transport types. +- **⚡ Custom skills** -- Define reusable prompt-based skills (global or per-project) that can be invoked as slash commands during chat. +- **⚙️ Settings editor** -- Visual and JSON editors for your `~/.claude/settings.json`, including permissions and environment variables. +- **📊 Token usage tracking** -- See input/output token counts and estimated cost after every assistant response. +- **🌗 Dark / Light theme** -- One-click theme toggle in the navigation rail. +- **⌨️ Slash commands** -- Built-in commands like `/help`, `/clear`, `/cost`, `/compact`, `/doctor`, `/review`, and more. +- **🖥️ Electron packaging** -- Ships as a native desktop app with a hidden title bar, bundled Next.js server, and automatic port allocation. + +--- ## Screenshots @@ -36,13 +37,26 @@ ## Prerequisites +> **Important**: CodePilot calls the Claude Code Agent SDK under the hood. Make sure `claude` is available on your `PATH` and that you have authenticated (`claude login`) before launching the app. + | Requirement | Minimum version | |---|---| | **Node.js** | 18+ | | **Claude Code CLI** | Installed and authenticated (`claude --version` should work) | | **npm** | 9+ (ships with Node 18) | -> CodePilot calls the Claude Code Agent SDK under the hood. Make sure `claude` is available on your `PATH` and that you have authenticated (`claude login`) before launching the app. +--- + +## Download + +Pre-built releases are available on the [**Releases**](https://github.com/op7418/CodePilot/releases) page. + +### Supported Platforms + +- **macOS**: Universal binary (arm64 + x64) distributed as `.dmg` +- **Windows**: x64 distributed as `.zip` + +> Linux builds are planned. Contributions welcome. --- @@ -67,14 +81,6 @@ Then open [http://localhost:3000](http://localhost:3000) (browser mode) or wait --- -## Download - -Pre-built releases for macOS are available on the [Releases](https://github.com/op7418/CodePilot/releases) page. - -> Windows and Linux builds are planned. Contributions welcome. - ---- - ## Installation Troubleshooting CodePilot is not code-signed yet, so your operating system will display a security warning the first time you open it. @@ -204,7 +210,7 @@ npm run electron:pack ### Notes - The Electron main process (`electron/main.ts`) forks the Next.js standalone server and connects to it over `127.0.0.1` with a random free port. -- Chat data is stored in `codepilot.db` inside the Electron `userData` directory (or `./data/` in dev mode). +- Chat data is stored in `~/.codepilot/codepilot.db` (or `./data/codepilot.db` in dev mode). - The app uses WAL mode for SQLite, so concurrent reads are fast. --- diff --git a/README_CN.md b/README_CN.md index 7ed1b8e..35d873b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -5,31 +5,35 @@ [English](./README.md) +[![GitHub release](https://img.shields.io/github/v/release/op7418/CodePilot)](https://github.com/op7418/CodePilot/releases) +[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Windows-lightgrey)](https://github.com/op7418/CodePilot/releases) +[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE) + --- -## 功能特性 +## ✨ 功能特性 -- **实时对话编码** -- 流式接收 Claude 的响应,支持完整的 Markdown 渲染、语法高亮代码块和工具调用可视化。 -- **会话管理** -- 创建、重命名、归档和恢复聊天会话。所有对话本地持久化存储在 SQLite 中,重启不丢失。 -- **项目感知上下文** -- 为每个会话选择工作目录。右侧面板实时展示文件树和文件预览,随时了解 Claude 正在查看的内容。 -- **权限控制** -- 逐项审批、拒绝或自动允许工具使用,可选择不同的权限模式。 -- **多种交互模式** -- 在 *Code*、*Plan* 和 *Ask* 模式之间切换,控制 Claude 在每个会话中的行为方式。 -- **模型切换** -- 在对话中随时切换 Claude 模型(Opus、Sonnet、Haiku)。 -- **MCP 服务器管理** -- 直接在扩展页面添加、配置和移除 Model Context Protocol 服务器。支持 `stdio`、`sse` 和 `http` 传输类型。 -- **自定义技能** -- 定义可复用的提示词技能(全局或项目级别),在聊天中作为斜杠命令调用。 -- **设置编辑器** -- 可视化和 JSON 编辑器管理 `~/.claude/settings.json`,包括权限和环境变量配置。 -- **Token 用量追踪** -- 每次助手回复后查看输入/输出 Token 数量和预估费用。 -- **深色/浅色主题** -- 导航栏一键切换主题。 -- **斜杠命令** -- 内置 `/help`、`/clear`、`/cost`、`/compact`、`/doctor`、`/review` 等命令。 -- **Electron 打包** -- 原生桌面应用,隐藏标题栏,内置 Next.js 服务器,自动端口分配。 +- 💬 **实时对话编码** -- 流式接收 Claude 的响应,支持完整的 Markdown 渲染、语法高亮代码块和工具调用可视化 +- 📂 **会话管理** -- 创建、重命名、归档和恢复聊天会话。所有对话本地持久化存储在 SQLite 中,重启不丢失 +- 🎯 **项目感知上下文** -- 为每个会话选择工作目录。右侧面板实时展示文件树和文件预览,随时了解 Claude 正在查看的内容 +- 🔐 **权限控制** -- 逐项审批、拒绝或自动允许工具使用,可选择不同的权限模式 +- 🎭 **多种交互模式** -- 在 *Code*、*Plan* 和 *Ask* 模式之间切换,控制 Claude 在每个会话中的行为方式 +- 🤖 **模型切换** -- 在对话中随时切换 Claude 模型(Opus、Sonnet、Haiku) +- 🔌 **MCP 服务器管理** -- 直接在扩展页面添加、配置和移除 Model Context Protocol 服务器。支持 `stdio`、`sse` 和 `http` 传输类型 +- ⚡ **自定义技能** -- 定义可复用的提示词技能(全局或项目级别),在聊天中作为斜杠命令调用 +- ⚙️ **设置编辑器** -- 可视化和 JSON 编辑器管理 `~/.claude/settings.json`,包括权限和环境变量配置 +- 📊 **Token 用量追踪** -- 每次助手回复后查看输入/输出 Token 数量和预估费用 +- 🌓 **深色/浅色主题** -- 导航栏一键切换主题 +- 💻 **斜杠命令** -- 内置 `/help`、`/clear`、`/cost`、`/compact`、`/doctor`、`/review` 等命令 +- 📦 **Electron 打包** -- 原生桌面应用,隐藏标题栏,内置 Next.js 服务器,自动端口分配 -## 截图 +## 📸 截图 ![CodePilot](docs/screenshot.png) --- -## 环境要求 +## 📋 环境要求 | 要求 | 最低版本 | |------|---------| @@ -37,11 +41,11 @@ | **Claude Code CLI** | 已安装并完成认证(`claude --version` 可正常运行) | | **npm** | 9+(Node 18 自带) | -> CodePilot 底层调用 Claude Code Agent SDK。请确保 `claude` 命令在 `PATH` 中可用,并且已完成认证(`claude login`)。 +> **注意**:CodePilot 底层调用 Claude Code Agent SDK。请确保 `claude` 命令在 `PATH` 中可用,并且已完成认证(`claude login`)。 --- -## 快速开始 +## 🚀 快速开始 ```bash # 克隆仓库 @@ -62,15 +66,20 @@ npm run electron:dev --- -## 下载 +## 📥 下载 -macOS 预编译版本可在 [Releases](https://github.com/op7418/CodePilot/releases) 页面下载。 +预编译版本可在 [Releases](https://github.com/op7418/CodePilot/releases) 页面下载。 -> Windows 和 Linux 版本正在计划中,欢迎贡献。 +### 支持平台 + +- **macOS** -- 支持 arm64(Apple Silicon)和 x64(Intel)架构的 `.dmg` 安装包 +- **Windows** -- 提供 `.zip` 压缩包,解压即用 + +> **Linux** 版本正在计划中,欢迎贡献。 --- -## 安装问题排查 +## 🔧 安装问题排查 CodePilot 尚未进行代码签名,因此操作系统在首次打开时会显示安全警告。 @@ -80,16 +89,16 @@ CodePilot 尚未进行代码签名,因此操作系统在首次打开时会显 **方案一 -- 右键打开** -1. 在访达中右键(或 Control-点击)`CodePilot.app`。 -2. 从右键菜单中选择 **打开**。 -3. 在确认对话框中点击 **打开**。 +1. 在访达中右键(或 Control-点击)`CodePilot.app` +2. 从右键菜单中选择 **打开** +3. 在确认对话框中点击 **打开** **方案二 -- 系统设置** -1. 打开 **系统设置** > **隐私与安全性**。 -2. 向下滚动到 **安全性** 部分。 -3. 你会看到关于 CodePilot 被阻止的提示,点击 **仍要打开**。 -4. 如有提示则输入密码验证,然后启动应用。 +1. 打开 **系统设置** > **隐私与安全性** +2. 向下滚动到 **安全性** 部分 +3. 你会看到关于 CodePilot 被阻止的提示,点击 **仍要打开** +4. 如有提示则输入密码验证,然后启动应用 **方案三 -- 终端命令** @@ -105,17 +114,17 @@ Windows SmartScreen 会阻止安装程序或可执行文件。 **方案一 -- 仍要运行** -1. 在 SmartScreen 对话框中,点击 **更多信息**。 -2. 点击 **仍要运行**。 +1. 在 SmartScreen 对话框中,点击 **更多信息** +2. 点击 **仍要运行** **方案二 -- 关闭应用安装控制** -1. 打开 **设置** > **应用** > **高级应用设置**。 -2. 将 **应用安装控制**(或"选择获取应用的位置")切换为允许任何来源。 +1. 打开 **设置** > **应用** > **高级应用设置** +2. 将 **应用安装控制**(或"选择获取应用的位置")切换为允许任何来源 --- -## 技术栈 +## 🛠 技术栈 | 层级 | 技术 | |------|------| @@ -134,7 +143,7 @@ Windows SmartScreen 会阻止安装程序或可执行文件。 --- -## 项目结构 +## 📂 项目结构 ``` codepilot/ @@ -176,7 +185,7 @@ codepilot/ --- -## 开发 +## 💻 开发 ```bash # 仅运行 Next.js 开发服务器(在浏览器中打开) @@ -198,26 +207,26 @@ npm run electron:pack ### 说明 -- Electron 主进程(`electron/main.ts`)会 fork Next.js standalone 服务器,通过 `127.0.0.1` 上的随机可用端口进行连接。 -- 聊天数据存储在 Electron `userData` 目录下的 `codepilot.db` 中(开发模式下为 `./data/`)。 -- 应用使用 SQLite WAL 模式,并发读取性能优秀。 +- Electron 主进程(`electron/main.ts`)会 fork Next.js standalone 服务器,通过 `127.0.0.1` 上的随机可用端口进行连接 +- 聊天数据存储在 `~/.codepilot/codepilot.db`(开发模式下为 `./data/`) +- 应用使用 SQLite WAL 模式,并发读取性能优秀 --- -## 贡献 +## 🤝 贡献 欢迎贡献代码。开始之前: -1. Fork 本仓库并创建功能分支。 -2. 使用 `npm install` 安装依赖。 -3. 运行 `npm run electron:dev` 在本地测试你的更改。 -4. 确保 `npm run lint` 通过后再提交 Pull Request。 -5. 向 `main` 分支提交 PR,并附上清晰的变更说明。 +1. Fork 本仓库并创建功能分支 +2. 使用 `npm install` 安装依赖 +3. 运行 `npm run electron:dev` 在本地测试你的更改 +4. 确保 `npm run lint` 通过后再提交 Pull Request +5. 向 `main` 分支提交 PR,并附上清晰的变更说明 请保持 PR 聚焦 -- 每个 PR 只包含一个功能或修复。 --- -## 许可证 +## 📄 许可证 MIT