返回 CodeWhale
README.md
根目录 / npm / codewhale / README.md
1 # codewhale
2
3 > The terminal coding agent for supported hosted and local models — open models first.
4
5 Codewhale is a Rust TUI and CLI for many model providers — DeepSeek,
6 OpenRouter, Hugging Face, and local vLLM/SGLang/Ollama are supported routes,
7 and it speaks natively to Anthropic Claude and OpenAI when that's what you have
8 — with approval-gated tools, OS sandboxing, side-git snapshots, and `/restore`
9 rollback.
10
11 This npm package is a small launcher: it downloads the matching native
12 Codewhale binaries for your platform, verifies them against the release
13 SHA-256 manifest, and installs `codewhale` plus the `codew` convenience name.
14 Both names run the same compiled runtime. The application state and credentials
15 still live in Codewhale's normal config files, not inside `node_modules`.
16
17 > Previously published as `deepseek-tui`. See
18 > [docs/REBRAND.md](https://github.com/Hmbown/CodeWhale/blob/main/docs/REBRAND.md)
19 > for the migration notes; the legacy `deepseek-tui` npm package is deprecated
20 > and receives no further releases.
21
22 ## Install
23
24 ```bash
25 npm install -g codewhale
26 # or
27 pnpm add -g codewhale
28 ```
29
30 For project-local usage:
31
32 ```bash
33 npm install codewhale
34 npx codewhale --help
35 ```
36
37 `postinstall` tries to download platform binaries into `bin/downloads/`. On
38 Linux x64 it concurrently probes the GitHub Releases and CNB first-party
39 checksum manifests for this package version, locks the first source that
40 validates, and downloads binaries only from that source. If GitHub release
41 assets are temporarily unreachable, install continues and the wrapper retries
42 the download on first run.
43
44 ## First run
45
46 ```bash
47 codewhale auth set --provider deepseek
48 codewhale auth status
49 codewhale doctor
50 codewhale
51 ```
52
53 Every provider is the same one-line shape — `--provider openrouter`,
54 `--provider huggingface`, `--provider ollama`, or `--provider anthropic` for a
55 Claude key; the full registry lives in
56 [docs/PROVIDERS.md](https://github.com/Hmbown/CodeWhale/blob/main/docs/PROVIDERS.md).
57
58 The single runtime reads `~/.codewhale/config.toml` for auth and default model
59 settings. Legacy `~/.deepseek/config.toml` installs are still read as a
60 compatibility fallback. Common commands are available directly, including
61 `codewhale doctor`, `codewhale models`, `codewhale sessions`, and
62 `codewhale resume --last`.
63
64 ## Supported platforms
65
66 Prebuilt binaries for the GitHub release are downloaded automatically:
67
68 - Linux x64
69 - Linux arm64
70 - macOS x64 / arm64
71 - Windows x64 / arm64
72 - Android arm64 / Termux (preview; requires matching Android assets in the
73 selected GitHub Release)
74
75 The source-candidate wrapper recognizes Android arm64 and resolves the
76 Termux-native `codewhale` and `codew` assets. That path works only for package
77 versions whose matching GitHub Release publishes both assets, and remains
78 preview support pending real-device QA. See the support table in
79 [docs/INSTALL.md](https://github.com/Hmbown/CodeWhale/blob/main/docs/INSTALL.md).
80
81 HarmonyOS PC (`openharmony`) is treated as `linux`, so it gets the Linux
82 binaries matching your CPU architecture (x64 or arm64). Linux riscv64 prebuilts
83 are temporarily paused while the locked `rquickjs-sys` dependency lacks
84 `riscv64gc-unknown-linux-gnu` bindings. Other platform/architecture combinations
85 (FreeBSD, Linux riscv64, …) aren't shipped as prebuilts. Unsupported platforms,
86 checksum failures, and glibc compatibility problems still fail with a clear
87 error pointing you at the full
88 [docs/INSTALL.md](https://github.com/Hmbown/CodeWhale/blob/main/docs/INSTALL.md)
89 guide.
90
91 ## Wrapper configuration
92
93 | Setting | What it does |
94 | --- | --- |
95 | `codewhaleBinaryVersion` in `package.json` | Default native binary version. `deepseekBinaryVersion` is still read as a backward-compat fallback. |
96 | `CODEWHALE_RELEASE_BASE_URL` | Canonical override: use an internal or mirrored release-asset directory and skip the Linux x64 GitHub/CNB race. The directory must contain `codewhale-artifacts-sha256.txt` and the platform binaries. `DEEPSEEK_TUI_RELEASE_BASE_URL` and `DEEPSEEK_RELEASE_BASE_URL` are the implemented legacy fallbacks. |
97 | `CODEWHALE_USE_CNB_MIRROR=1` | Force the CNB (China-friendly) first-party mirror on Linux x64 and OpenHarmony x64, skipping the automatic race. Other targets fail with a clear unsupported-mirror error; use GitHub or a complete `CODEWHALE_RELEASE_BASE_URL` mirror there. Without this variable, Linux x64 still probes CNB and GitHub together and uses the first valid checksum manifest. |
98 | `CODEWHALE_VERSION` | Override the release version to download. |
99 | `CODEWHALE_GITHUB_REPO` | Override the source repo. Defaults to `Hmbown/CodeWhale`. |
100 | `CODEWHALE_FORCE_DOWNLOAD=1` | Force download even when the cached binary is already present. |
101 | `CODEWHALE_DISABLE_INSTALL=1` | Skip install-time download. |
102 | `CODEWHALE_OPTIONAL_INSTALL=1` | Make install-time retryable download failures warn and exit `0` instead of failing `npm install`. |
103 | `CODEWHALE_QUIET_INSTALL=1` | Suppress installer progress messages. |
104 | `CODEWHALE_DOWNLOAD_TIMEOUT_MS` | Override the total download budget. |
105 | `CODEWHALE_DOWNLOAD_STALL_MS` | Override the no-progress stall budget. |
106 | `CODEWHALE_SKIP_GLIBC_CHECK=1` | Bypass the Linux glibc preflight check at your own risk. |
107
108 The corresponding `DEEPSEEK_TUI_*` and `DEEPSEEK_*` names remain accepted as
109 legacy aliases, after the canonical Codewhale names.
110
111 ### Proxies
112
113 Downloads respect `HTTPS_PROXY` / `HTTP_PROXY` (CONNECT tunneling included)
114 and `NO_PROXY`, so the wrapper works behind corporate proxies. For fully
115 offline installs, set `CODEWHALE_DISABLE_INSTALL=1` or point
116 `CODEWHALE_RELEASE_BASE_URL` at a local mirror.
117
118 ## Release integrity
119
120 - `npm publish` runs a release-asset check to ensure the required binaries,
121 archives, Windows installer, and checksum manifests exist for the target
122 GitHub release before publishing.
123 - For the default GitHub Release source, `npm run release:check` also verifies
124 that those release assets were updated by a successful `release.yml` run for
125 the tag commit. When `CODEWHALE_RELEASE_BASE_URL` or a legacy mirror override
126 is set, it checks the mirror asset URLs and checksum manifests instead.
127 - Install-time downloads are verified against the release checksum manifest before
128 the wrapper marks them executable.
129
130 ## Links
131
132 - Repository: <https://github.com/Hmbown/CodeWhale>
133 - Website: <https://codewhale.net/>
134 - Provider registry: [docs/PROVIDERS.md](https://github.com/Hmbown/CodeWhale/blob/main/docs/PROVIDERS.md)
135 - Changelog: [CHANGELOG.md](https://github.com/Hmbown/CodeWhale/blob/main/CHANGELOG.md)
136
136 lines MARKDOWN