@rse/claudex 1.0.10 → 1.0.12
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/CHANGELOG.md +12 -0
- package/claudex.js +37 -34
- package/claudex.ts +38 -35
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
ChangeLog
|
|
3
3
|
=========
|
|
4
4
|
|
|
5
|
+
1.0.12 (2026-08-02)
|
|
6
|
+
-------------------
|
|
7
|
+
|
|
8
|
+
- BUGFIX: allow NPM scripts for "ansi-recolor" (again)
|
|
9
|
+
- UPDATE: upgrade NPM dependencies
|
|
10
|
+
|
|
11
|
+
1.0.11 (2026-07-26)
|
|
12
|
+
-------------------
|
|
13
|
+
|
|
14
|
+
- BUGFIX: allow NPM scripts for "ansi-recolor"
|
|
15
|
+
- UPDATE: upgrade NPM dependencies
|
|
16
|
+
|
|
5
17
|
1.0.10 (2026-07-11)
|
|
6
18
|
-------------------
|
|
7
19
|
|
package/claudex.js
CHANGED
|
@@ -50,7 +50,7 @@ const findTool = (tool) => {
|
|
|
50
50
|
if (process.platform === "win32") {
|
|
51
51
|
const r2 = execaSync("where", [tool], { reject: false, windowsHide: true });
|
|
52
52
|
if ((r2.exitCode ?? 1) === 0) {
|
|
53
|
-
const line = (r2.stdout ?? "").
|
|
53
|
+
const line = (r2.stdout ?? "").split(/\r?\n/)[0].trim();
|
|
54
54
|
if (line !== "")
|
|
55
55
|
return line;
|
|
56
56
|
}
|
|
@@ -140,26 +140,26 @@ const executeCommand = (config) => {
|
|
|
140
140
|
/* helper to ensure a tool is available */
|
|
141
141
|
const ensureTool = (tool, options = {}) => {
|
|
142
142
|
const tools = typeof tool === "string" ? [tool] : tool;
|
|
143
|
-
for (const
|
|
144
|
-
let r = findTool(
|
|
143
|
+
for (const toolName of tools) {
|
|
144
|
+
let r = findTool(toolName);
|
|
145
145
|
if (r === null && options.install) {
|
|
146
146
|
const rc = executeCommand(options.install);
|
|
147
147
|
if (rc !== 0) {
|
|
148
148
|
if (options.optional)
|
|
149
149
|
continue;
|
|
150
|
-
fatal(`failed to install required tool "${
|
|
150
|
+
fatal(`failed to install required tool "${toolName}" (exit ${rc})` +
|
|
151
151
|
(options.hint !== undefined ? ` -- hint: ${options.hint}` : ""));
|
|
152
152
|
}
|
|
153
|
-
r = findTool(
|
|
153
|
+
r = findTool(toolName);
|
|
154
154
|
}
|
|
155
155
|
if (r !== null)
|
|
156
156
|
continue;
|
|
157
157
|
if (options.optional)
|
|
158
158
|
continue;
|
|
159
159
|
if (options.hint !== undefined)
|
|
160
|
-
fatal(`required tool "${
|
|
160
|
+
fatal(`required tool "${toolName}" not found in $PATH -- hint: ${options.hint}`);
|
|
161
161
|
else
|
|
162
|
-
fatal(`required tool "${
|
|
162
|
+
fatal(`required tool "${toolName}" not found in $PATH`);
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
165
|
/* re-invoke this same script (mirrors "$0 ..." in Bash) */
|
|
@@ -222,6 +222,7 @@ const pruneClaudeVersions = (active) => {
|
|
|
222
222
|
fs.rmSync(path.join(versionsDir, f), { recursive: true, force: true });
|
|
223
223
|
}
|
|
224
224
|
catch (_e) {
|
|
225
|
+
/* ignore removal failures (best-effort pruning) */
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
228
|
};
|
|
@@ -263,9 +264,9 @@ const actionInstall = async (capsula) => {
|
|
|
263
264
|
await self("internal", "capsula", "-s", "sudo", "-E", "apt", "install", "-qq", "-y", "nodejs");
|
|
264
265
|
await self("internal", "capsula", "-s", "sudo", "-E", "apt", "install", "-qq", "-y", "binutils", "gcc", "g++", "make");
|
|
265
266
|
info("install Claude Code");
|
|
266
|
-
await self("internal", "capsula", "bash", "-c", `PATH="${HOME}/.local/bin:$PATH"; curl -
|
|
267
|
+
await self("internal", "capsula", "bash", "-c", `PATH="${HOME}/.local/bin:$PATH"; curl -fsSL https://claude.ai/install.sh | bash`);
|
|
267
268
|
info("install ANSI-Recolor");
|
|
268
|
-
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "ansi-recolor");
|
|
269
|
+
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "--allow-scripts=node-pty,tty-attr", "ansi-recolor");
|
|
269
270
|
info("install TypeScript LS");
|
|
270
271
|
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "typescript-language-server");
|
|
271
272
|
info("install CodeBurn");
|
|
@@ -285,14 +286,14 @@ const actionInstall = async (capsula) => {
|
|
|
285
286
|
const platform = detectPlatform();
|
|
286
287
|
info("install Tmux");
|
|
287
288
|
ensureTool("tmux", {
|
|
288
|
-
hint:
|
|
289
|
+
hint: /^windows:/.test(platform) ?
|
|
289
290
|
"https://github.com/psmux/psmux/" :
|
|
290
291
|
"https://github.com/tmux/tmux/",
|
|
291
292
|
install: {
|
|
292
293
|
"windows:winget": "winget install --accept-package-agreements --accept-source-agreements --silent -e psmux",
|
|
293
294
|
"windows:choco": "choco install -y --accept-license --no-progress psmux",
|
|
294
295
|
"macos:ports": "sudo port -N install tmux",
|
|
295
|
-
"macos:brew": "
|
|
296
|
+
"macos:brew": "brew install tmux",
|
|
296
297
|
"linux:apt": "sudo apt install -y tmux",
|
|
297
298
|
"linux:apk": "sudo apk add --no-interactive tmux"
|
|
298
299
|
}
|
|
@@ -305,7 +306,7 @@ const actionInstall = async (capsula) => {
|
|
|
305
306
|
"windows:winget": "winget install --accept-package-agreements --accept-source-agreements --silent -e --id JesseDuffield.lazygit",
|
|
306
307
|
"windows:choco": "choco install -y --accept-license --no-progress lazygit",
|
|
307
308
|
"macos:ports": "sudo port -N install lazygit",
|
|
308
|
-
"macos:brew": "
|
|
309
|
+
"macos:brew": "brew install lazygit",
|
|
309
310
|
"linux:apt": "sudo apt install -y lazygit",
|
|
310
311
|
"linux:apk": "sudo apk add --no-interactive lazygit"
|
|
311
312
|
}
|
|
@@ -318,7 +319,7 @@ const actionInstall = async (capsula) => {
|
|
|
318
319
|
"windows:winget": "winget install --accept-package-agreements --accept-source-agreements --silent -e --id Git.Git",
|
|
319
320
|
"windows:choco": "choco install -y --accept-license --no-progress git",
|
|
320
321
|
"macos:ports": "sudo port -N install git",
|
|
321
|
-
"macos:brew": "
|
|
322
|
+
"macos:brew": "brew install git",
|
|
322
323
|
"linux:apt": "sudo apt install -y git",
|
|
323
324
|
"linux:apk": "sudo apk add --no-interactive git"
|
|
324
325
|
}
|
|
@@ -330,7 +331,7 @@ const actionInstall = async (capsula) => {
|
|
|
330
331
|
"windows:winget": "winget install --accept-package-agreements --accept-source-agreements --silent -e --id OpenJS.NodeJS.LTS",
|
|
331
332
|
"windows:choco": "choco install -y --accept-license --no-progress nodejs",
|
|
332
333
|
"macos:ports": "sudo port -N install nodejs26 npm11",
|
|
333
|
-
"macos:brew": "
|
|
334
|
+
"macos:brew": "brew install node",
|
|
334
335
|
"linux:apt": "curl -fsSL https://deb.nodesource.com/setup_26.x | sudo -E bash - && sudo apt install -y nodejs",
|
|
335
336
|
"linux:apk": "sudo apk add --no-interactive nodejs npm"
|
|
336
337
|
}
|
|
@@ -339,9 +340,9 @@ const actionInstall = async (capsula) => {
|
|
|
339
340
|
ensureTool("ansi-recolor", {
|
|
340
341
|
hint: "https://github.com/rse/ansi-recolor",
|
|
341
342
|
install: {
|
|
342
|
-
"windows:*": "npm install -g ansi-recolor",
|
|
343
|
-
"macos:*": "sudo npm install -g ansi-recolor",
|
|
344
|
-
"linux:*": "sudo npm install -g ansi-recolor"
|
|
343
|
+
"windows:*": "npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor",
|
|
344
|
+
"macos:*": "sudo npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor",
|
|
345
|
+
"linux:*": "sudo npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor"
|
|
345
346
|
}
|
|
346
347
|
});
|
|
347
348
|
info("install TypeScript-Language-Server");
|
|
@@ -376,7 +377,7 @@ const actionInstall = async (capsula) => {
|
|
|
376
377
|
/* run installation script */
|
|
377
378
|
ensureTool("bash", { hint: "https://www.gnu.org/software/bash/" });
|
|
378
379
|
ensureTool("curl", { hint: "https://curl.se/" });
|
|
379
|
-
await execa("bash", ["-c", `PATH="${HOME}/.local/bin:$PATH"; curl -
|
|
380
|
+
await execa("bash", ["-c", `PATH="${HOME}/.local/bin:$PATH"; curl -fsSL https://claude.ai/install.sh | bash`], {
|
|
380
381
|
stdio: "inherit", reject: false
|
|
381
382
|
});
|
|
382
383
|
/* prune obsolete versions only after successful install */
|
|
@@ -416,7 +417,7 @@ const actionUpdate = async (capsula) => {
|
|
|
416
417
|
info("update Claude Code");
|
|
417
418
|
await self("internal", "capsula", "bash", "-c", `PATH="${HOME}/.local/bin:$PATH"; ${HOME}/.local/bin/claude update`);
|
|
418
419
|
info("update ANSI-Recolor");
|
|
419
|
-
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "ansi-recolor");
|
|
420
|
+
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "--allow-scripts=node-pty,tty-attr", "ansi-recolor");
|
|
420
421
|
info("update TypeScript LS");
|
|
421
422
|
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "typescript-language-server");
|
|
422
423
|
info("update CodeBurn");
|
|
@@ -432,7 +433,7 @@ const actionUpdate = async (capsula) => {
|
|
|
432
433
|
"windows:winget": "winget upgrade --accept-package-agreements --accept-source-agreements --silent -e psmux",
|
|
433
434
|
"windows:choco": "choco upgrade -y --accept-license --no-progress psmux",
|
|
434
435
|
"macos:ports": "sudo port -N upgrade tmux",
|
|
435
|
-
"macos:brew": "
|
|
436
|
+
"macos:brew": "brew upgrade tmux",
|
|
436
437
|
"linux:apt": "sudo apt install --only-upgrade -y tmux",
|
|
437
438
|
"linux:apk": "sudo apk upgrade --no-interactive tmux"
|
|
438
439
|
});
|
|
@@ -441,7 +442,7 @@ const actionUpdate = async (capsula) => {
|
|
|
441
442
|
"windows:winget": "winget upgrade --accept-package-agreements --accept-source-agreements --silent -e --id JesseDuffield.lazygit",
|
|
442
443
|
"windows:choco": "choco upgrade -y --accept-license --no-progress lazygit",
|
|
443
444
|
"macos:ports": "sudo port -N upgrade lazygit",
|
|
444
|
-
"macos:brew": "
|
|
445
|
+
"macos:brew": "brew upgrade lazygit",
|
|
445
446
|
"linux:apt": "sudo apt install --only-upgrade -y lazygit",
|
|
446
447
|
"linux:apk": "sudo apk upgrade --no-interactive lazygit"
|
|
447
448
|
});
|
|
@@ -450,7 +451,7 @@ const actionUpdate = async (capsula) => {
|
|
|
450
451
|
"windows:winget": "winget upgrade --accept-package-agreements --accept-source-agreements --silent -e --id Git.Git --source winget",
|
|
451
452
|
"windows:choco": "choco upgrade -y --accept-license --no-progress git",
|
|
452
453
|
"macos:ports": "sudo port -N upgrade git",
|
|
453
|
-
"macos:brew": "
|
|
454
|
+
"macos:brew": "brew upgrade git",
|
|
454
455
|
"linux:apt": "sudo apt install --only-upgrade -y git",
|
|
455
456
|
"linux:apk": "sudo apk upgrade --no-interactive git"
|
|
456
457
|
});
|
|
@@ -459,15 +460,15 @@ const actionUpdate = async (capsula) => {
|
|
|
459
460
|
"windows:winget": "winget upgrade --accept-package-agreements --accept-source-agreements --silent -e --id OpenJS.NodeJS.LTS",
|
|
460
461
|
"windows:choco": "choco upgrade -y --accept-license --no-progress nodejs",
|
|
461
462
|
"macos:ports": "sudo port -N upgrade nodejs26 npm11",
|
|
462
|
-
"macos:brew": "
|
|
463
|
+
"macos:brew": "brew upgrade node",
|
|
463
464
|
"linux:apt": "sudo apt install --only-upgrade -y nodejs",
|
|
464
465
|
"linux:apk": "sudo apk upgrade --no-interactive nodejs npm"
|
|
465
466
|
});
|
|
466
467
|
info("update ANSI-Recolor");
|
|
467
468
|
executeCommand({
|
|
468
|
-
"windows:*": "npm install -g ansi-recolor",
|
|
469
|
-
"macos:*": "sudo npm install -g ansi-recolor",
|
|
470
|
-
"linux:*": "sudo npm install -g ansi-recolor"
|
|
469
|
+
"windows:*": "npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor",
|
|
470
|
+
"macos:*": "sudo npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor",
|
|
471
|
+
"linux:*": "sudo npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor"
|
|
471
472
|
});
|
|
472
473
|
info("update TypeScript-Language-Server");
|
|
473
474
|
executeCommand({
|
|
@@ -601,9 +602,8 @@ const actionInternalShell = (_opts, args) => {
|
|
|
601
602
|
/* action: internal "ase-task-edit" -- edit the ASE task associated with the current tmux pane */
|
|
602
603
|
const actionInternalAseTaskEdit = async (_opts) => {
|
|
603
604
|
ensureTool("ase");
|
|
604
|
-
let tid = "";
|
|
605
605
|
const r1 = execaSync("tmux", ["display-message", "-p", "#{@ase_task_id}"], { reject: false });
|
|
606
|
-
tid = (r1.stdout ?? "").trim();
|
|
606
|
+
const tid = (r1.stdout ?? "").trim();
|
|
607
607
|
if (tid !== "")
|
|
608
608
|
execInherit("ase", ["task", "edit", tid]);
|
|
609
609
|
else {
|
|
@@ -764,9 +764,8 @@ const actionDefault = (opts, args) => {
|
|
|
764
764
|
session = opts.tmux;
|
|
765
765
|
else
|
|
766
766
|
session = detectSessionName();
|
|
767
|
-
const rest = args;
|
|
768
767
|
/* build the in-pane self-invocation */
|
|
769
|
-
const inPane = shQ.quote(["node" /* process.execPath is not valid inside container! */, selfPathJS, ...innerFlags, ...
|
|
768
|
+
const inPane = shQ.quote(["node" /* process.execPath is not valid inside container! */, selfPathJS, ...innerFlags, ...args]);
|
|
770
769
|
/* propagate the chosen pass-through flags to subsequent in-pane
|
|
771
770
|
"claudex" invocations via the CLAUDEX_FLAGS env var (honored by
|
|
772
771
|
the env-merge in main()) */
|
|
@@ -914,8 +913,11 @@ const actionDefault = (opts, args) => {
|
|
|
914
913
|
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context;
|
|
915
914
|
env.DISABLE_LOGIN_COMMAND = "1";
|
|
916
915
|
env.DISABLE_LOGOUT_COMMAND = "1";
|
|
916
|
+
env.ENABLE_TOOL_SEARCH = "auto";
|
|
917
917
|
}
|
|
918
918
|
else if (/^openrouter:/.test(claudeModel)) {
|
|
919
|
+
if (!process.env.OPENROUTER_API_KEY)
|
|
920
|
+
fatal("CLAUDE_MODEL uses \"openrouter:\" but the OPENROUTER_API_KEY environment variable is not set");
|
|
919
921
|
/* parse openrouter:<model>[?[context=<size>],[capabilities=<list>]] */
|
|
920
922
|
const remainder = claudeModel.slice("openrouter:".length);
|
|
921
923
|
const qIdx = remainder.indexOf("?");
|
|
@@ -950,11 +952,12 @@ const actionDefault = (opts, args) => {
|
|
|
950
952
|
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context;
|
|
951
953
|
env.DISABLE_LOGIN_COMMAND = "1";
|
|
952
954
|
env.DISABLE_LOGOUT_COMMAND = "1";
|
|
955
|
+
env.ENABLE_TOOL_SEARCH = "auto";
|
|
953
956
|
}
|
|
954
957
|
else if (claudeModel !== "")
|
|
955
|
-
|
|
958
|
+
fatal(`invalid CLAUDE_MODEL "${claudeModel}" ` +
|
|
956
959
|
"(supports only: \"ollama[://<host>[:<port>]]/<model>[?[context=<size>],[capabilities=<list>]]\" " +
|
|
957
|
-
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\"");
|
|
960
|
+
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\")");
|
|
958
961
|
/* override ASE configuration (for its diagram rendering) */
|
|
959
962
|
if (opts.ase) {
|
|
960
963
|
if (env.ASE_TERM_WIDTH === undefined) {
|
|
@@ -973,7 +976,7 @@ const actionDefault = (opts, args) => {
|
|
|
973
976
|
colorMode = "ansi256";
|
|
974
977
|
else if (depth >= 4)
|
|
975
978
|
colorMode = "ansi16";
|
|
976
|
-
env.ASE_TERM_COLORS =
|
|
979
|
+
env.ASE_TERM_COLORS = colorMode;
|
|
977
980
|
}
|
|
978
981
|
if (args.includes("-p") || args.includes("--print"))
|
|
979
982
|
env.ASE_HEADLESS = "true";
|
|
@@ -1088,7 +1091,7 @@ const main = async () => {
|
|
|
1088
1091
|
invoked with any of these options, as the corresponding
|
|
1089
1092
|
non-interactive or session-related modes are incompatible
|
|
1090
1093
|
with wrapping claude inside a Tmux session */
|
|
1091
|
-
const noTmuxOpts = ["-p"];
|
|
1094
|
+
const noTmuxOpts = ["-p", "--print"];
|
|
1092
1095
|
const skipTmux = topArgs.some((a) => noTmuxOpts.includes(a));
|
|
1093
1096
|
const filtered = [];
|
|
1094
1097
|
for (let i = 0; i < tokens.length; i++) {
|
package/claudex.ts
CHANGED
|
@@ -59,7 +59,7 @@ const findTool = (tool: string): string | null => {
|
|
|
59
59
|
if (process.platform === "win32") {
|
|
60
60
|
const r2 = execaSync("where", [ tool ], { reject: false, windowsHide: true })
|
|
61
61
|
if ((r2.exitCode ?? 1) === 0) {
|
|
62
|
-
const line = (r2.stdout ?? "").
|
|
62
|
+
const line = (r2.stdout ?? "").split(/\r?\n/)[0].trim()
|
|
63
63
|
if (line !== "")
|
|
64
64
|
return line
|
|
65
65
|
}
|
|
@@ -160,26 +160,26 @@ const ensureTool = (tool: string | string[], options: {
|
|
|
160
160
|
optional?: boolean
|
|
161
161
|
} = {}): void => {
|
|
162
162
|
const tools = typeof tool === "string" ? [ tool ] : tool
|
|
163
|
-
for (const
|
|
164
|
-
let r = findTool(
|
|
163
|
+
for (const toolName of tools) {
|
|
164
|
+
let r = findTool(toolName)
|
|
165
165
|
if (r === null && options.install) {
|
|
166
166
|
const rc = executeCommand(options.install)
|
|
167
167
|
if (rc !== 0) {
|
|
168
168
|
if (options.optional)
|
|
169
169
|
continue
|
|
170
|
-
fatal(`failed to install required tool "${
|
|
170
|
+
fatal(`failed to install required tool "${toolName}" (exit ${rc})` +
|
|
171
171
|
(options.hint !== undefined ? ` -- hint: ${options.hint}` : ""))
|
|
172
172
|
}
|
|
173
|
-
r = findTool(
|
|
173
|
+
r = findTool(toolName)
|
|
174
174
|
}
|
|
175
175
|
if (r !== null)
|
|
176
176
|
continue
|
|
177
177
|
if (options.optional)
|
|
178
178
|
continue
|
|
179
179
|
if (options.hint !== undefined)
|
|
180
|
-
fatal(`required tool "${
|
|
180
|
+
fatal(`required tool "${toolName}" not found in $PATH -- hint: ${options.hint}`)
|
|
181
181
|
else
|
|
182
|
-
fatal(`required tool "${
|
|
182
|
+
fatal(`required tool "${toolName}" not found in $PATH`)
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
|
|
@@ -246,6 +246,7 @@ const pruneClaudeVersions = (active: string | null): void => {
|
|
|
246
246
|
fs.rmSync(path.join(versionsDir, f), { recursive: true, force: true })
|
|
247
247
|
}
|
|
248
248
|
catch (_e) {
|
|
249
|
+
/* ignore removal failures (best-effort pruning) */
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
252
|
}
|
|
@@ -302,10 +303,10 @@ const actionInstall = async (capsula: boolean): Promise<void> => {
|
|
|
302
303
|
await self("internal", "capsula", "-s", "sudo", "-E", "apt", "install", "-qq", "-y", "binutils", "gcc", "g++", "make")
|
|
303
304
|
|
|
304
305
|
info("install Claude Code")
|
|
305
|
-
await self("internal", "capsula", "bash", "-c", `PATH="${HOME}/.local/bin:$PATH"; curl -
|
|
306
|
+
await self("internal", "capsula", "bash", "-c", `PATH="${HOME}/.local/bin:$PATH"; curl -fsSL https://claude.ai/install.sh | bash`)
|
|
306
307
|
|
|
307
308
|
info("install ANSI-Recolor")
|
|
308
|
-
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "ansi-recolor")
|
|
309
|
+
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "--allow-scripts=node-pty,tty-attr", "ansi-recolor")
|
|
309
310
|
|
|
310
311
|
info("install TypeScript LS")
|
|
311
312
|
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "typescript-language-server")
|
|
@@ -333,14 +334,14 @@ const actionInstall = async (capsula: boolean): Promise<void> => {
|
|
|
333
334
|
|
|
334
335
|
info("install Tmux")
|
|
335
336
|
ensureTool("tmux", {
|
|
336
|
-
hint:
|
|
337
|
+
hint: /^windows:/.test(platform) ?
|
|
337
338
|
"https://github.com/psmux/psmux/" :
|
|
338
339
|
"https://github.com/tmux/tmux/",
|
|
339
340
|
install: {
|
|
340
341
|
"windows:winget": "winget install --accept-package-agreements --accept-source-agreements --silent -e psmux",
|
|
341
342
|
"windows:choco": "choco install -y --accept-license --no-progress psmux",
|
|
342
343
|
"macos:ports": "sudo port -N install tmux",
|
|
343
|
-
"macos:brew": "
|
|
344
|
+
"macos:brew": "brew install tmux",
|
|
344
345
|
"linux:apt": "sudo apt install -y tmux",
|
|
345
346
|
"linux:apk": "sudo apk add --no-interactive tmux"
|
|
346
347
|
}
|
|
@@ -354,7 +355,7 @@ const actionInstall = async (capsula: boolean): Promise<void> => {
|
|
|
354
355
|
"windows:winget": "winget install --accept-package-agreements --accept-source-agreements --silent -e --id JesseDuffield.lazygit",
|
|
355
356
|
"windows:choco": "choco install -y --accept-license --no-progress lazygit",
|
|
356
357
|
"macos:ports": "sudo port -N install lazygit",
|
|
357
|
-
"macos:brew": "
|
|
358
|
+
"macos:brew": "brew install lazygit",
|
|
358
359
|
"linux:apt": "sudo apt install -y lazygit",
|
|
359
360
|
"linux:apk": "sudo apk add --no-interactive lazygit"
|
|
360
361
|
}
|
|
@@ -368,7 +369,7 @@ const actionInstall = async (capsula: boolean): Promise<void> => {
|
|
|
368
369
|
"windows:winget": "winget install --accept-package-agreements --accept-source-agreements --silent -e --id Git.Git",
|
|
369
370
|
"windows:choco": "choco install -y --accept-license --no-progress git",
|
|
370
371
|
"macos:ports": "sudo port -N install git",
|
|
371
|
-
"macos:brew": "
|
|
372
|
+
"macos:brew": "brew install git",
|
|
372
373
|
"linux:apt": "sudo apt install -y git",
|
|
373
374
|
"linux:apk": "sudo apk add --no-interactive git"
|
|
374
375
|
}
|
|
@@ -381,7 +382,7 @@ const actionInstall = async (capsula: boolean): Promise<void> => {
|
|
|
381
382
|
"windows:winget": "winget install --accept-package-agreements --accept-source-agreements --silent -e --id OpenJS.NodeJS.LTS",
|
|
382
383
|
"windows:choco": "choco install -y --accept-license --no-progress nodejs",
|
|
383
384
|
"macos:ports": "sudo port -N install nodejs26 npm11",
|
|
384
|
-
"macos:brew": "
|
|
385
|
+
"macos:brew": "brew install node",
|
|
385
386
|
"linux:apt": "curl -fsSL https://deb.nodesource.com/setup_26.x | sudo -E bash - && sudo apt install -y nodejs",
|
|
386
387
|
"linux:apk": "sudo apk add --no-interactive nodejs npm"
|
|
387
388
|
}
|
|
@@ -391,9 +392,9 @@ const actionInstall = async (capsula: boolean): Promise<void> => {
|
|
|
391
392
|
ensureTool("ansi-recolor", {
|
|
392
393
|
hint: "https://github.com/rse/ansi-recolor",
|
|
393
394
|
install: {
|
|
394
|
-
"windows:*": "npm install -g ansi-recolor",
|
|
395
|
-
"macos:*": "sudo npm install -g ansi-recolor",
|
|
396
|
-
"linux:*": "sudo npm install -g ansi-recolor"
|
|
395
|
+
"windows:*": "npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor",
|
|
396
|
+
"macos:*": "sudo npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor",
|
|
397
|
+
"linux:*": "sudo npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor"
|
|
397
398
|
}
|
|
398
399
|
})
|
|
399
400
|
|
|
@@ -432,7 +433,7 @@ const actionInstall = async (capsula: boolean): Promise<void> => {
|
|
|
432
433
|
/* run installation script */
|
|
433
434
|
ensureTool("bash", { hint: "https://www.gnu.org/software/bash/" })
|
|
434
435
|
ensureTool("curl", { hint: "https://curl.se/" })
|
|
435
|
-
await execa("bash", [ "-c", `PATH="${HOME}/.local/bin:$PATH"; curl -
|
|
436
|
+
await execa("bash", [ "-c", `PATH="${HOME}/.local/bin:$PATH"; curl -fsSL https://claude.ai/install.sh | bash` ], {
|
|
436
437
|
stdio: "inherit", reject: false
|
|
437
438
|
})
|
|
438
439
|
|
|
@@ -480,7 +481,7 @@ const actionUpdate = async (capsula: boolean): Promise<void> => {
|
|
|
480
481
|
await self("internal", "capsula", "bash", "-c", `PATH="${HOME}/.local/bin:$PATH"; ${HOME}/.local/bin/claude update`)
|
|
481
482
|
|
|
482
483
|
info("update ANSI-Recolor")
|
|
483
|
-
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "ansi-recolor")
|
|
484
|
+
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "--allow-scripts=node-pty,tty-attr", "ansi-recolor")
|
|
484
485
|
|
|
485
486
|
info("update TypeScript LS")
|
|
486
487
|
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "typescript-language-server")
|
|
@@ -500,7 +501,7 @@ const actionUpdate = async (capsula: boolean): Promise<void> => {
|
|
|
500
501
|
"windows:winget": "winget upgrade --accept-package-agreements --accept-source-agreements --silent -e psmux",
|
|
501
502
|
"windows:choco": "choco upgrade -y --accept-license --no-progress psmux",
|
|
502
503
|
"macos:ports": "sudo port -N upgrade tmux",
|
|
503
|
-
"macos:brew": "
|
|
504
|
+
"macos:brew": "brew upgrade tmux",
|
|
504
505
|
"linux:apt": "sudo apt install --only-upgrade -y tmux",
|
|
505
506
|
"linux:apk": "sudo apk upgrade --no-interactive tmux"
|
|
506
507
|
})
|
|
@@ -510,7 +511,7 @@ const actionUpdate = async (capsula: boolean): Promise<void> => {
|
|
|
510
511
|
"windows:winget": "winget upgrade --accept-package-agreements --accept-source-agreements --silent -e --id JesseDuffield.lazygit",
|
|
511
512
|
"windows:choco": "choco upgrade -y --accept-license --no-progress lazygit",
|
|
512
513
|
"macos:ports": "sudo port -N upgrade lazygit",
|
|
513
|
-
"macos:brew": "
|
|
514
|
+
"macos:brew": "brew upgrade lazygit",
|
|
514
515
|
"linux:apt": "sudo apt install --only-upgrade -y lazygit",
|
|
515
516
|
"linux:apk": "sudo apk upgrade --no-interactive lazygit"
|
|
516
517
|
})
|
|
@@ -520,7 +521,7 @@ const actionUpdate = async (capsula: boolean): Promise<void> => {
|
|
|
520
521
|
"windows:winget": "winget upgrade --accept-package-agreements --accept-source-agreements --silent -e --id Git.Git --source winget",
|
|
521
522
|
"windows:choco": "choco upgrade -y --accept-license --no-progress git",
|
|
522
523
|
"macos:ports": "sudo port -N upgrade git",
|
|
523
|
-
"macos:brew": "
|
|
524
|
+
"macos:brew": "brew upgrade git",
|
|
524
525
|
"linux:apt": "sudo apt install --only-upgrade -y git",
|
|
525
526
|
"linux:apk": "sudo apk upgrade --no-interactive git"
|
|
526
527
|
})
|
|
@@ -530,16 +531,16 @@ const actionUpdate = async (capsula: boolean): Promise<void> => {
|
|
|
530
531
|
"windows:winget": "winget upgrade --accept-package-agreements --accept-source-agreements --silent -e --id OpenJS.NodeJS.LTS",
|
|
531
532
|
"windows:choco": "choco upgrade -y --accept-license --no-progress nodejs",
|
|
532
533
|
"macos:ports": "sudo port -N upgrade nodejs26 npm11",
|
|
533
|
-
"macos:brew": "
|
|
534
|
+
"macos:brew": "brew upgrade node",
|
|
534
535
|
"linux:apt": "sudo apt install --only-upgrade -y nodejs",
|
|
535
536
|
"linux:apk": "sudo apk upgrade --no-interactive nodejs npm"
|
|
536
537
|
})
|
|
537
538
|
|
|
538
539
|
info("update ANSI-Recolor")
|
|
539
540
|
executeCommand({
|
|
540
|
-
"windows:*": "npm install -g ansi-recolor",
|
|
541
|
-
"macos:*": "sudo npm install -g ansi-recolor",
|
|
542
|
-
"linux:*": "sudo npm install -g ansi-recolor"
|
|
541
|
+
"windows:*": "npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor",
|
|
542
|
+
"macos:*": "sudo npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor",
|
|
543
|
+
"linux:*": "sudo npm install -g --allow-scripts=node-pty,tty-attr ansi-recolor"
|
|
543
544
|
})
|
|
544
545
|
|
|
545
546
|
info("update TypeScript-Language-Server")
|
|
@@ -680,9 +681,8 @@ const actionInternalShell = (_opts: TopOpts, args: string[]): never => {
|
|
|
680
681
|
/* action: internal "ase-task-edit" -- edit the ASE task associated with the current tmux pane */
|
|
681
682
|
const actionInternalAseTaskEdit = async (_opts: TopOpts): Promise<void> => {
|
|
682
683
|
ensureTool("ase")
|
|
683
|
-
let tid = ""
|
|
684
684
|
const r1 = execaSync("tmux", [ "display-message", "-p", "#{@ase_task_id}" ], { reject: false })
|
|
685
|
-
tid = (r1.stdout ?? "").trim()
|
|
685
|
+
const tid = (r1.stdout ?? "").trim()
|
|
686
686
|
if (tid !== "")
|
|
687
687
|
execInherit("ase", [ "task", "edit", tid ])
|
|
688
688
|
else {
|
|
@@ -854,10 +854,9 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
|
|
|
854
854
|
session = opts.tmux
|
|
855
855
|
else
|
|
856
856
|
session = detectSessionName()
|
|
857
|
-
const rest = args
|
|
858
857
|
|
|
859
858
|
/* build the in-pane self-invocation */
|
|
860
|
-
const inPane = shQ.quote([ "node" /* process.execPath is not valid inside container! */, selfPathJS, ...innerFlags, ...
|
|
859
|
+
const inPane = shQ.quote([ "node" /* process.execPath is not valid inside container! */, selfPathJS, ...innerFlags, ...args ])
|
|
861
860
|
|
|
862
861
|
/* propagate the chosen pass-through flags to subsequent in-pane
|
|
863
862
|
"claudex" invocations via the CLAUDEX_FLAGS env var (honored by
|
|
@@ -1010,8 +1009,11 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
|
|
|
1010
1009
|
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context
|
|
1011
1010
|
env.DISABLE_LOGIN_COMMAND = "1"
|
|
1012
1011
|
env.DISABLE_LOGOUT_COMMAND = "1"
|
|
1012
|
+
env.ENABLE_TOOL_SEARCH = "auto"
|
|
1013
1013
|
}
|
|
1014
1014
|
else if (/^openrouter:/.test(claudeModel)) {
|
|
1015
|
+
if (!process.env.OPENROUTER_API_KEY)
|
|
1016
|
+
fatal("CLAUDE_MODEL uses \"openrouter:\" but the OPENROUTER_API_KEY environment variable is not set")
|
|
1015
1017
|
/* parse openrouter:<model>[?[context=<size>],[capabilities=<list>]] */
|
|
1016
1018
|
const remainder = claudeModel.slice("openrouter:".length)
|
|
1017
1019
|
const qIdx = remainder.indexOf("?")
|
|
@@ -1045,11 +1047,12 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
|
|
|
1045
1047
|
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context
|
|
1046
1048
|
env.DISABLE_LOGIN_COMMAND = "1"
|
|
1047
1049
|
env.DISABLE_LOGOUT_COMMAND = "1"
|
|
1050
|
+
env.ENABLE_TOOL_SEARCH = "auto"
|
|
1048
1051
|
}
|
|
1049
1052
|
else if (claudeModel !== "")
|
|
1050
|
-
|
|
1053
|
+
fatal(`invalid CLAUDE_MODEL "${claudeModel}" ` +
|
|
1051
1054
|
"(supports only: \"ollama[://<host>[:<port>]]/<model>[?[context=<size>],[capabilities=<list>]]\" " +
|
|
1052
|
-
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\"")
|
|
1055
|
+
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\")")
|
|
1053
1056
|
|
|
1054
1057
|
/* override ASE configuration (for its diagram rendering) */
|
|
1055
1058
|
if (opts.ase) {
|
|
@@ -1069,7 +1072,7 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
|
|
|
1069
1072
|
colorMode = "ansi256"
|
|
1070
1073
|
else if (depth >= 4)
|
|
1071
1074
|
colorMode = "ansi16"
|
|
1072
|
-
env.ASE_TERM_COLORS =
|
|
1075
|
+
env.ASE_TERM_COLORS = colorMode
|
|
1073
1076
|
}
|
|
1074
1077
|
if (args.includes("-p") || args.includes("--print"))
|
|
1075
1078
|
env.ASE_HEADLESS = "true"
|
|
@@ -1193,7 +1196,7 @@ const main = async (): Promise<void> => {
|
|
|
1193
1196
|
invoked with any of these options, as the corresponding
|
|
1194
1197
|
non-interactive or session-related modes are incompatible
|
|
1195
1198
|
with wrapping claude inside a Tmux session */
|
|
1196
|
-
const noTmuxOpts = [ "-p" ]
|
|
1199
|
+
const noTmuxOpts = [ "-p", "--print" ]
|
|
1197
1200
|
const skipTmux = topArgs.some((a) => noTmuxOpts.includes(a))
|
|
1198
1201
|
const filtered: string[] = []
|
|
1199
1202
|
for (let i = 0; i < tokens.length; i++) {
|
|
@@ -1228,7 +1231,7 @@ const main = async (): Promise<void> => {
|
|
|
1228
1231
|
program
|
|
1229
1232
|
.name("claudex")
|
|
1230
1233
|
.description("Claude Code eXtended")
|
|
1231
|
-
.version(JSON.parse(fs.readFileSync(path.join(basedir, "package.json"), "utf8")).version, "-V, --version")
|
|
1234
|
+
.version((JSON.parse(fs.readFileSync(path.join(basedir, "package.json"), "utf8")) as { version: string }).version, "-V, --version")
|
|
1232
1235
|
.enablePositionalOptions()
|
|
1233
1236
|
.passThroughOptions()
|
|
1234
1237
|
.allowUnknownOption()
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rse/claudex",
|
|
3
3
|
"publishConfig": { "access": "public" },
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.12",
|
|
5
5
|
"description": "Claude Code eXtended",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [ "claude", "code", "extension", "wrapper" ],
|
|
@@ -17,28 +17,28 @@
|
|
|
17
17
|
"bin": { "claudex": "claudex.js" },
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"which": "7.0.0",
|
|
20
|
-
"execa": "
|
|
21
|
-
"chalk": "
|
|
20
|
+
"execa": "10.0.1",
|
|
21
|
+
"chalk": "6.0.0",
|
|
22
22
|
"commander": "15.0.0",
|
|
23
23
|
"deepmerge": "4.3.1",
|
|
24
|
-
"shescape": "
|
|
25
|
-
"shell-quote": "1.
|
|
24
|
+
"shescape": "3.0.2",
|
|
25
|
+
"shell-quote": "1.10.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "6.0.3",
|
|
29
|
-
"@types/node": "
|
|
29
|
+
"@types/node": "26.1.2",
|
|
30
30
|
"@types/which": "3.0.4",
|
|
31
31
|
"@types/shell-quote": "1.7.5",
|
|
32
32
|
|
|
33
|
-
"@rse/stx": "1.1.
|
|
34
|
-
"eslint": "9.39.
|
|
35
|
-
"@eslint/js": "9.39.
|
|
36
|
-
"typescript-eslint": "8.
|
|
37
|
-
"@typescript-eslint/parser": "8.
|
|
33
|
+
"@rse/stx": "1.1.6",
|
|
34
|
+
"eslint": "9.39.5",
|
|
35
|
+
"@eslint/js": "9.39.5",
|
|
36
|
+
"typescript-eslint": "8.65.0",
|
|
37
|
+
"@typescript-eslint/parser": "8.65.0",
|
|
38
38
|
"eslint-plugin-promise": "7.3.0",
|
|
39
39
|
"eslint-plugin-import": "2.32.0",
|
|
40
40
|
"neostandard": "0.13.0",
|
|
41
|
-
"globals": "17.
|
|
41
|
+
"globals": "17.8.0",
|
|
42
42
|
"shx": "0.4.0"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|