返回 CodeWhale
README.md
根目录 / README.md
1 <div align="center">
2
3 <picture>
4 <source media="(prefers-color-scheme: dark)" srcset="brand/wordmark-inverted.svg">
5 <img src="brand/wordmark.svg" alt="Codewhale" width="320">
6 </picture>
7
8 **Open-source Rust coding agent for your terminal. Any model, multi-agent fleets, OS sandboxing, and verifiable receipts.**
9
10 ```bash
11 curl -fsSL https://codewhale.net/install.sh | sh
12 ```
13
14 [![Latest release](https://img.shields.io/github/v/release/codewhale-hq/Codewhale?label=release)](https://github.com/codewhale-hq/Codewhale/releases/latest)
15 [![CI](https://github.com/codewhale-hq/Codewhale/actions/workflows/ci.yml/badge.svg)](https://github.com/codewhale-hq/Codewhale/actions/workflows/ci.yml)
16 [![Built With Ratatui](https://ratatui.rs/built-with-ratatui/badge.svg)](https://ratatui.rs/)
17 [![crates.io](https://img.shields.io/crates/v/codewhale-cli?label=crates.io)](https://crates.io/crates/codewhale-cli)
18 [![npm](https://img.shields.io/npm/v/codewhale?label=npm)](https://www.npmjs.com/package/codewhale)
19 [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
20 [![Discord](https://img.shields.io/badge/Discord-join-5865F2?logo=discord&logoColor=white)](https://discord.gg/37gfS3ksug)
21
22 [Website](https://codewhale.net) · [Documentation](docs/README.md) · [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md)
23
24 [简体中文](docs/i18n/README.zh-CN.md) · [日本語](docs/i18n/README.ja-JP.md) · [Tiếng Việt](docs/i18n/README.vi.md) · [Bahasa Indonesia](docs/i18n/README.id.md) · [한국어](docs/i18n/README.ko-KR.md) · [Español](docs/i18n/README.es-419.md) · [Português](docs/i18n/README.pt-BR.md) · [Русский](docs/i18n/README.ru.md) · [Українська](docs/i18n/README.uk.md) · [Français](docs/i18n/README.fr.md) · [Deutsch](docs/i18n/README.de.md) · [繁體中文](docs/i18n/README.zh-TW.md) · [हिन्दी](docs/i18n/README.hi.md) · [Türkçe](docs/i18n/README.tr.md) · [Italiano](docs/i18n/README.it.md) · [Polski](docs/i18n/README.pl.md) · [العربية](docs/i18n/README.ar.md) · [Català](docs/i18n/README.ca.md)
25
26 <img src="web/public/codewhale-tui-latest.png" width="760" alt="Codewhale v0.10.4 in a terminal after a real task on local Ollama (qwen3:4b): it edited ls.py, waited for approval before running python3 -m unittest -v test_ls.py, ran 2 passing tests, and reported the result.">
27
28 <sub>Real session on published Codewhale v0.10.4 (48669ad108fa) running local Ollama (qwen3:4b) in Accept Edits mode.</sub>
29
30 </div>
31
32 ## Install
33
34 The install script above puts checksum-verified `codewhale` and its short alias
35 `codew` in `~/.local/bin` on macOS and Linux. If your shell reports
36 `command not found`, add `~/.local/bin` to your `PATH`
37 ([details](docs/INSTALL.md#put-it-on-your-path)). Upgrade in place with
38 `codewhale update`.
39
40 ```bash
41 winget install --id HunterBown.CodeWhale --exact --source winget # Windows x64
42 npm install -g codewhale # wraps the same release binaries
43 cargo install codewhale-cli --locked # builds from source; can trail GitHub Releases
44 ```
45
46 Prebuilt binaries ship for Linux, macOS, and Windows (x64 and arm64). Scoop,
47 Nix, Homebrew on Linux, Android/Termux (preview), and manual downloads are in
48 [docs/INSTALL.md](docs/INSTALL.md); container images are in
49 [docs/DOCKER.md](docs/DOCKER.md). Use one install method per machine so two
50 binaries do not shadow each other on `PATH`.
51
52 ## Quickstart
53
54 1. Commit or stash your work, then run `codewhale` from a git repository root.
55 2. Run `/provider` (or press `F3`) to select a provider, paste an API key, and
56 pick a model. DeepSeek is the default; if no key is configured and a local
57 Ollama server responds, Codewhale offers its models on your first message.
58 3. Give it a task:
59
60 ```text
61 Fix the failing tests and explain what changed.
62 ```
63
64 Read-only commands run immediately, except in Ask, which asks before every
65 command. Mutating shell commands prompt for approval: `y` runs once, `a` allows matching commands for the rest of the
66 session, and `n` denies. Run `/undo` to revert the last turn and its file
67 edits, or `/help` for commands and keybindings.
68
69 ## Capabilities
70
71 - **50+ built-in providers and local models:** Anthropic, OpenAI, DeepSeek
72 (`deepseek-flash` / V4.1 Flash by default;
73 [details](docs/PROVIDERS.md#deepseek-v41-flash)), Google, Mistral, Moonshot,
74 OpenRouter, xAI, any OpenAI-compatible endpoint, and local runtimes via
75 Ollama, vLLM, or SGLang. Switch models mid-session with `/model`, route
76 per-turn with `/model auto` (`/router`), and inspect latency and cost with
77 `/turn inspect`. See [Providers](docs/PROVIDERS.md).
78 - **Receipts and rollback:** `/receipts` (or `codewhale receipts --last` after
79 exiting) records changed files, commands, web/MCP calls, sub-agents,
80 approvals, and failures. `/undo` reverts the last turn in one step;
81 `/restore` rolls the workspace back to an earlier snapshot (requires
82 `/trust on` or Full Access). See [Receipts](docs/RECEIPTS.md).
83 - **Sub-agents, Fleets, and workflows:** Carry multi-turn objectives with
84 `/goal`, delegate work to [sub-agents](docs/SUBAGENTS.md), coordinate role-
85 and model-specific [Fleets](docs/FLEET.md), or run repository-checked
86 [workflows](docs/WORKFLOW_AUTHORING.md).
87 - **MCP, skills, hooks, and plugins:** Attach [MCP servers](docs/MCP.md),
88 [skills](docs/SKILLS.md), [plugins](docs/PLUGINS.md), and lifecycle
89 [hooks](docs/HOOKS.md). Experimental code mode (`execute_tools`) batches
90 multiple MCP/plugin calls under your normal approval rules. Optional macOS
91 [Computer Use](https://github.com/codewhale-hq/codewhale-cu-plugin) stays off
92 until explicitly reviewed and enabled.
93 - **Drop-in compatibility:** Reads `AGENTS.md` automatically. Opt into
94 `CLAUDE.md`, `.cursorrules`, or `.github/copilot-instructions.md` via
95 `project_instruction_imports` in [config.example.toml](config.example.toml).
96 Import Claude Code settings and MCP servers with `/import-claude`, or install
97 Claude Code plugins (skills, commands, agent profiles, MCP) and DeepSeek
98 Harness (DSH) plugins with `/plugin install`
99 ([details](docs/CLAUDE_PLUGIN_COMPAT.md)).
100
101 ## Entry points
102
103 | Command | Purpose |
104 | --- | --- |
105 | `codewhale` | Interactive terminal app |
106 | `codewhale exec "…"` | Headless single-task runner for scripts and CI ([guide](docs/INSTALL.md#headless-scripts-ci); `--auto` uses Full Access unless sandboxed) |
107 | `codewhale web` | Local web client on `127.0.0.1` ([guide](docs/WEB.md)) |
108 | `codewhale review --pr N` | Advisory GitHub PR review; [GitHub bot setup](docs/GITHUB_ACTION.md#set-up-your-own-bot) runs it on your own key |
109 | `codewhale app-server --http` | Local HTTP [Runtime API](docs/RUNTIME_API.md) for threads, events, approvals, and per-turn diffs |
110 | `codewhale serve --acp` | Agent Client Protocol over stdio for editors such as Zed |
111
112 All entry points share one Rust engine ([architecture](docs/ARCHITECTURE.md)).
113 A community-maintained
114 [VS Code extension](https://marketplace.visualstudio.com/items?itemName=HengQuWorld.brotherwhale-vscode)
115 ([source](https://github.com/HengQuWorld/CodeWhale-VSCode)) connects to the
116 same engine. See the [latest release notes](https://github.com/codewhale-hq/Codewhale/releases/latest)
117 and [roadmap](docs/ROADMAP.md) for current release and desktop/cloud status.
118
119 ## Permissions, sandboxing, and privacy
120
121 `Shift+Tab` cycles permission modes:
122 **Ask → Accept Edits → Plan → Auto-Review → Full Access** (`Tab` only
123 completes). **Accept Edits** (default) applies edits inside the git repository
124 and asks before commands. **Ask** prompts on every edit and command. **Plan**
125 is read-only. **Auto-Review** uses rules and a reviewer model to approve
126 routine calls and block high-risk ones. **Full Access** skips prompts and
127 disables the OS sandbox (repository rules and managed policy still apply). See
128 [Modes](docs/MODES.md).
129
130 In Ask, Accept Edits, and Auto-Review, commands run inside an OS sandbox where
131 available: Seatbelt on macOS and bubblewrap on Linux (Windows has no OS sandbox
132 yet). Sandboxed commands and terminal sessions cannot read credential paths
133 such as `~/.ssh`, `~/.aws`, or `.env` files. Run `/preview-request` to inspect
134 a redacted outgoing request before sending it.
135
136 API keys added with `/provider` stay on your machine, and local models require
137 no key. `/cost` and the footer track session spend when pricing is known (an
138 unknown price is shown as unknown, never as free).
139
140 Aggregate telemetry is enabled by default (version, OS, session length/outcome,
141 built-in provider IDs, bundled public-catalog model IDs (custom, private, or
142 local models map to `other`), aggregate token totals, built-in tool call/error
143 counts, and feature/error counters; rotating 90-day random install ID; never
144 code, prompts, conversations, custom/private model names, file/repo/branch
145 names, credentials, or IP addresses). Disable it with:
146
147 ```bash
148 codewhale config set telemetry false
149 ```
150
151 At startup Codewhale also checks GitHub for a new release
152 (`CODEWHALE_NO_UPDATE_CHECK=1` to skip) and refreshes the public `models.dev`
153 model catalog every 24 hours (`CODEWHALE_DISABLE_MODELS_DEV_FETCH=1` or
154 `[catalog] auto_refresh = false` to skip; suppressed automatically in CI and
155 under `DO_NOT_TRACK`). Details: [authorization order](docs/AUTHORIZATION_ORDER.md),
156 [sandboxing](docs/SANDBOX.md), and [telemetry](docs/TELEMETRY.md).
157
158 ## Documentation
159
160 Guides follow `main` and may describe changes not yet in the latest release.
161
162 | Start here | Reference |
163 | --- | --- |
164 | [User guide](docs/GUIDE.md) | [Configuration](docs/CONFIGURATION.md) |
165 | [Installation](docs/INSTALL.md) | [Architecture](docs/ARCHITECTURE.md) |
166 | [Providers and local models](docs/PROVIDERS.md) | [Runtime API](docs/RUNTIME_API.md) |
167 | [Modes and permissions](docs/MODES.md) | [Plugin authoring](docs/PLUGIN_AUTHORING.md) |
168 | [Keybindings](docs/KEYBINDINGS.md) | [Receipts](docs/RECEIPTS.md) |
169 | [GitHub pull request review](docs/GITHUB_ACTION.md) | [All documentation](docs/README.md) |
170
171 ## Contributing and license
172
173 <a href="docs/CONTRIBUTORS.md#everyone"><img src="docs/assets/contributors.png" width="760" alt="Codewhale contributor wall"></a>
174
175 The [contributor wall](docs/CONTRIBUTORS.md) (`scripts/release/contributor-wall.py`)
176 tracks code, co-authored commits, carried-forward PRs, and credited reports.
177 Bug reports and feature proposals go to
178 [Issues](https://github.com/codewhale-hq/Codewhale/issues/new/choose),
179 questions to [Discussions](https://github.com/codewhale-hq/Codewhale/discussions),
180 and contribution guidelines plus layout are in [CONTRIBUTING.md](CONTRIBUTING.md)
181 ([project structure](CONTRIBUTING.md#project-structure)). Join us on
182 [Discord](https://discord.gg/37gfS3ksug) or add `hunterbown` on WeChat for the
183 Whale Brothers group.
184
185 Codewhale started as `deepseek-tui` and remains backward-compatible with its
186 config and sessions. It is independently maintained and not affiliated with
187 DeepSeek or any other model provider.
188
189 [MIT](LICENSE). Third-party notices: [vendored sources](THIRD_PARTY_NOTICES.md)
190 and [adapted designs](docs/THIRD_PARTY_NOTICES.md).
191
191 lines MARKDOWN