codewhale 0.8.60 → 0.8.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,16 +1,23 @@
1
1
  # codewhale
2
2
 
3
- Install and run CodeWhale, the agentic terminal for DeepSeek and other
4
- OpenAI-compatible coding models, from GitHub release artifacts.
3
+ > The terminal coding agent for any model — open models first.
4
+
5
+ CodeWhale is a Rust TUI and CLI for 24 providers — DeepSeek, OpenRouter,
6
+ Hugging Face, and local vLLM/SGLang/Ollama are first-class routes, and it
7
+ 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.
5
10
 
6
11
  This npm package is a small launcher: it downloads the matching native
7
- CodeWhale binaries for your platform and exposes the `codewhale` and
8
- `codewhale-tui` commands. The application state and credentials still live in
9
- CodeWhale's normal config files, not inside `node_modules`.
12
+ CodeWhale binaries for your platform, verifies them against the release
13
+ SHA-256 manifest, and installs the `codewhale`, `codew`, and `codewhale-tui`
14
+ commands. The application state and credentials still live in CodeWhale's
15
+ normal config files, not inside `node_modules`.
10
16
 
11
- > Previously published as `deepseek-tui`. See `docs/REBRAND.md` in the upstream
12
- > repository for the migration notes; the legacy `deepseek-tui` npm package is
13
- > deprecated and receives no further releases.
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.
14
21
 
15
22
  ## Install
16
23
 
@@ -34,45 +41,37 @@ wrapper retries the download on first run.
34
41
  ## First run
35
42
 
36
43
  ```bash
37
- codewhale login --api-key "YOUR_DEEPSEEK_API_KEY"
44
+ codewhale auth set --provider deepseek
45
+ codewhale auth status
38
46
  codewhale doctor
39
47
  codewhale
40
48
  ```
41
49
 
50
+ Every provider is the same one-line shape — `--provider openrouter`,
51
+ `--provider huggingface`, `--provider ollama`, or `--provider anthropic` for a
52
+ Claude key; the full registry lives in
53
+ [docs/PROVIDERS.md](https://github.com/Hmbown/CodeWhale/blob/main/docs/PROVIDERS.md).
54
+
42
55
  The `codewhale` facade and `codewhale-tui` binary share
43
- `~/.codewhale/config.toml` for DeepSeek auth and default model settings. Legacy
56
+ `~/.codewhale/config.toml` for auth and default model settings. Legacy
44
57
  `~/.deepseek/config.toml` installs are still read as a compatibility fallback.
45
58
  Common TUI commands are available directly through the facade, including
46
59
  `codewhale doctor`, `codewhale models`, `codewhale sessions`, and
47
60
  `codewhale resume --last`.
48
61
 
49
- The app talks to DeepSeek's documented OpenAI-compatible Chat Completions API.
50
- Set `DEEPSEEK_BASE_URL` only if you need the China endpoint or DeepSeek beta
51
- features such as strict tool mode, chat prefix completion, or FIM completion.
52
-
53
- NVIDIA NIM-hosted DeepSeek V4 Pro is also supported:
54
-
55
- ```bash
56
- codewhale auth set --provider nvidia-nim --api-key "YOUR_NVIDIA_API_KEY"
57
- codewhale --provider nvidia-nim
58
- ```
59
-
60
- For a single process, set `DEEPSEEK_PROVIDER=nvidia-nim` and `NVIDIA_API_KEY`
61
- or `NVIDIA_NIM_API_KEY` (with `DEEPSEEK_API_KEY` as a compatibility fallback).
62
- The NIM default model is `deepseek-ai/deepseek-v4-pro` and the default base URL
63
- is `https://integrate.api.nvidia.com/v1`. With `--provider nvidia-nim`,
64
- `--model deepseek-v4-flash` maps to `deepseek-ai/deepseek-v4-flash`.
65
-
66
62
  ## Supported platforms
67
63
 
68
64
  Prebuilt binaries for the GitHub release are downloaded automatically:
69
65
 
70
66
  - Linux x64
71
- - Linux arm64 (v0.8.8+)
67
+ - Linux arm64
68
+ - Linux riscv64
72
69
  - macOS x64 / arm64
73
70
  - Windows x64
74
71
 
75
- Other platform/architecture combinations (musl, riscv64, FreeBSD, …) aren't
72
+ HarmonyOS PC (`openharmony`) is treated as `linux`, so it gets the Linux
73
+ binaries matching your CPU architecture (x64, arm64, or riscv64). Other
74
+ platform/architecture combinations (musl, FreeBSD, …) aren't
76
75
  shipped as prebuilts. Unsupported platforms, checksum failures, and glibc
77
76
  compatibility problems still fail with a clear error pointing you at
78
77
  `cargo install codewhale-cli codewhale-tui --locked` and the full
@@ -84,12 +83,21 @@ build-from-source guide.
84
83
  | Setting | What it does |
85
84
  | --- | --- |
86
85
  | `codewhaleBinaryVersion` in `package.json` | Default native binary version. `deepseekBinaryVersion` is still read as a backward-compat fallback. |
86
+ | `CODEWHALE_RELEASE_BASE_URL` | Canonical override: use an internal or mirrored release-asset directory when GitHub Releases is unavailable. 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. |
87
+ | `CODEWHALE_USE_CNB_MIRROR=1` | Download release assets from the CNB (China-friendly) mirror instead of GitHub. |
87
88
  | `DEEPSEEK_TUI_VERSION` or `DEEPSEEK_VERSION` | Override the GitHub release version to download. |
88
89
  | `DEEPSEEK_TUI_GITHUB_REPO` or `DEEPSEEK_GITHUB_REPO` | Override the source repo. Defaults to `Hmbown/CodeWhale`. |
89
- | `DEEPSEEK_TUI_RELEASE_BASE_URL` | Use an internal or mirrored release-asset directory when GitHub Releases is unavailable. The directory must contain `codewhale-artifacts-sha256.txt` and the platform binaries. |
90
90
  | `DEEPSEEK_TUI_FORCE_DOWNLOAD=1` | Force download even when the cached binary is already present. |
91
91
  | `DEEPSEEK_TUI_DISABLE_INSTALL=1` | Skip install-time download. |
92
92
  | `DEEPSEEK_TUI_OPTIONAL_INSTALL=1` | Make install-time retryable download failures warn and exit `0` instead of failing `npm install`. |
93
+ | `DEEPSEEK_TUI_SKIP_GLIBC_CHECK=1` | Bypass the Linux glibc preflight check at your own risk (`DEEPSEEK_SKIP_GLIBC_CHECK=1` also works). |
94
+
95
+ ### Proxies
96
+
97
+ Downloads respect `HTTPS_PROXY` / `HTTP_PROXY` (CONNECT tunneling included)
98
+ and `NO_PROXY`, so the wrapper works behind corporate proxies. For fully
99
+ offline installs, set `DEEPSEEK_TUI_DISABLE_INSTALL=1` or point
100
+ `CODEWHALE_RELEASE_BASE_URL` at a local mirror.
93
101
 
94
102
  ## Release integrity
95
103
 
@@ -97,3 +105,10 @@ build-from-source guide.
97
105
  exist for the target GitHub release before publishing.
98
106
  - Install-time downloads are verified against the release checksum manifest before
99
107
  the wrapper marks them executable.
108
+
109
+ ## Links
110
+
111
+ - Repository: <https://github.com/Hmbown/CodeWhale>
112
+ - Website: <https://codewhale.net/>
113
+ - Provider registry: [docs/PROVIDERS.md](https://github.com/Hmbown/CodeWhale/blob/main/docs/PROVIDERS.md)
114
+ - Changelog: [CHANGELOG.md](https://github.com/Hmbown/CodeWhale/blob/main/CHANGELOG.md)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "codewhale",
3
- "version": "0.8.60",
4
- "codewhaleBinaryVersion": "0.8.60",
3
+ "version": "0.8.63",
4
+ "codewhaleBinaryVersion": "0.8.63",
5
5
  "description": "Install and run CodeWhale, the agentic terminal for open-source and open-weight coding models, from GitHub release artifacts.",
6
6
  "author": "Hmbown",
7
7
  "license": "MIT",
@@ -83,12 +83,34 @@ function buildFromSourceHint() {
83
83
  ].join("\n");
84
84
  }
85
85
 
86
- function preflightGlibc(filePath) {
87
- if (!isLinux()) return;
88
- if (
86
+ function skipGlibcCheck() {
87
+ return (
88
+ process.env.CODEWHALE_SKIP_GLIBC_CHECK === "1" ||
89
89
  process.env.DEEPSEEK_TUI_SKIP_GLIBC_CHECK === "1" ||
90
90
  process.env.DEEPSEEK_SKIP_GLIBC_CHECK === "1"
91
- ) {
91
+ );
92
+ }
93
+
94
+ function glibcCompatibilityMessage(required, host) {
95
+ const hostLine = host
96
+ ? `this system has glibc ${formatVersion(host)}, which is too old for that asset.`
97
+ : "this system does not appear to provide GNU libc.";
98
+ return [
99
+ `Prebuilt CodeWhale Linux binaries require GLIBC_${formatVersion(required)}, but ${hostLine}`,
100
+ "",
101
+ "The Linux x64 release asset is a static (musl) build that runs on any glibc,",
102
+ "but the Linux arm64 and riscv64 assets are GNU libc builds linked against",
103
+ "Ubuntu 24.04/glibc 2.39, which Ubuntu 22.04 (glibc 2.35) cannot run.",
104
+ "",
105
+ buildFromSourceHint(),
106
+ "",
107
+ "Set CODEWHALE_SKIP_GLIBC_CHECK=1 to bypass this check at your own risk.",
108
+ ].join("\n");
109
+ }
110
+
111
+ function preflightGlibc(filePath) {
112
+ if (!isLinux()) return;
113
+ if (skipGlibcCheck()) {
92
114
  return;
93
115
  }
94
116
 
@@ -100,29 +122,11 @@ function preflightGlibc(filePath) {
100
122
 
101
123
  const host = detectHostGlibc();
102
124
  if (!host) {
103
- throw new Error(
104
- [
105
- `The prebuilt binary requires GLIBC_${formatVersion(required)}, but no GNU libc was detected on this host.`,
106
- "This usually means you're on a musl-based distro such as Alpine.",
107
- "",
108
- buildFromSourceHint(),
109
- "",
110
- "Set DEEPSEEK_TUI_SKIP_GLIBC_CHECK=1 to bypass this check at your own risk.",
111
- ].join("\n"),
112
- );
125
+ throw new Error(glibcCompatibilityMessage(required, null));
113
126
  }
114
127
 
115
128
  if (compareVersion(host, required) < 0) {
116
- throw new Error(
117
- [
118
- `Prebuilt DeepSeek TUI binary requires GLIBC_${formatVersion(required)} but this system has glibc ${formatVersion(host)}.`,
119
- "Older distros (CentOS 7/8, RHEL 7/8, Debian 10, etc.) ship an older glibc that is not compatible with the prebuilt artifact.",
120
- "",
121
- buildFromSourceHint(),
122
- "",
123
- "Set DEEPSEEK_TUI_SKIP_GLIBC_CHECK=1 to bypass this check at your own risk.",
124
- ].join("\n"),
125
- );
129
+ throw new Error(glibcCompatibilityMessage(required, host));
126
130
  }
127
131
  }
128
132
 
@@ -131,5 +135,11 @@ module.exports = {
131
135
  detectHostGlibc,
132
136
  detectBinaryRequiredGlibc,
133
137
  // exported for tests
134
- _internal: { parseVersion, compareVersion, formatVersion },
138
+ _internal: {
139
+ parseVersion,
140
+ compareVersion,
141
+ formatVersion,
142
+ glibcCompatibilityMessage,
143
+ skipGlibcCheck,
144
+ },
135
145
  };
@@ -10,6 +10,7 @@ const installScript = fs.readFileSync(
10
10
  "utf8",
11
11
  );
12
12
  const { installFailureHint, _internal } = require("../scripts/install");
13
+ const { _internal: glibcInternal } = require("../scripts/preflight-glibc");
13
14
 
14
15
  function sha256(content) {
15
16
  return crypto.createHash("sha256").update(content).digest("hex");
@@ -111,6 +112,50 @@ test("install failure hint checks configured release base when override is alrea
111
112
  }
112
113
  });
113
114
 
115
+ test("glibc preflight message is CodeWhale-branded and actionable", () => {
116
+ const message = glibcInternal.glibcCompatibilityMessage([2, 39, 0], [2, 35, 0]);
117
+
118
+ assert.match(message, /Prebuilt CodeWhale Linux binaries require GLIBC_2\.39/);
119
+ assert.match(message, /this system has glibc 2\.35/);
120
+ assert.match(message, /cargo install codewhale-cli --locked/);
121
+ assert.match(message, /Linux x64 release asset is a static \(musl\) build/);
122
+ assert.match(message, /arm64 and riscv64 assets are GNU libc builds/);
123
+ assert.match(message, /CODEWHALE_SKIP_GLIBC_CHECK=1/);
124
+ });
125
+
126
+ test("glibc preflight accepts canonical and legacy skip env vars", () => {
127
+ const previousCodewhale = process.env.CODEWHALE_SKIP_GLIBC_CHECK;
128
+ const previousTui = process.env.DEEPSEEK_TUI_SKIP_GLIBC_CHECK;
129
+ const previousLegacy = process.env.DEEPSEEK_SKIP_GLIBC_CHECK;
130
+ delete process.env.CODEWHALE_SKIP_GLIBC_CHECK;
131
+ delete process.env.DEEPSEEK_TUI_SKIP_GLIBC_CHECK;
132
+ delete process.env.DEEPSEEK_SKIP_GLIBC_CHECK;
133
+ try {
134
+ assert.equal(glibcInternal.skipGlibcCheck(), false);
135
+ process.env.CODEWHALE_SKIP_GLIBC_CHECK = "1";
136
+ assert.equal(glibcInternal.skipGlibcCheck(), true);
137
+ delete process.env.CODEWHALE_SKIP_GLIBC_CHECK;
138
+ process.env.DEEPSEEK_TUI_SKIP_GLIBC_CHECK = "1";
139
+ assert.equal(glibcInternal.skipGlibcCheck(), true);
140
+ } finally {
141
+ if (previousCodewhale === undefined) {
142
+ delete process.env.CODEWHALE_SKIP_GLIBC_CHECK;
143
+ } else {
144
+ process.env.CODEWHALE_SKIP_GLIBC_CHECK = previousCodewhale;
145
+ }
146
+ if (previousTui === undefined) {
147
+ delete process.env.DEEPSEEK_TUI_SKIP_GLIBC_CHECK;
148
+ } else {
149
+ process.env.DEEPSEEK_TUI_SKIP_GLIBC_CHECK = previousTui;
150
+ }
151
+ if (previousLegacy === undefined) {
152
+ delete process.env.DEEPSEEK_SKIP_GLIBC_CHECK;
153
+ } else {
154
+ process.env.DEEPSEEK_SKIP_GLIBC_CHECK = previousLegacy;
155
+ }
156
+ }
157
+ });
158
+
114
159
  test("ensureBinary adopts a manually placed target binary after checksum validation", async (t) => {
115
160
  const dir = await makeTempDir(t);
116
161
  const target = path.join(dir, process.platform === "win32" ? "codewhale.exe" : "codewhale");