@rse/claudex 1.0.11 → 1.0.13
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 +17 -0
- package/claudex.js +48 -33
- package/claudex.ts +50 -33
- package/lazygit.yaml +21 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
ChangeLog
|
|
3
3
|
=========
|
|
4
4
|
|
|
5
|
+
1.0.13 (2026-08-04)
|
|
6
|
+
-------------------
|
|
7
|
+
|
|
8
|
+
- IMPROVEMENT: pass-through --version option to Claude Code and just extend with own version information
|
|
9
|
+
|
|
10
|
+
1.0.12 (2026-08-02)
|
|
11
|
+
-------------------
|
|
12
|
+
|
|
13
|
+
- BUGFIX: allow NPM scripts for "ansi-recolor" (again)
|
|
14
|
+
- UPDATE: upgrade NPM dependencies
|
|
15
|
+
|
|
16
|
+
1.0.11 (2026-07-26)
|
|
17
|
+
-------------------
|
|
18
|
+
|
|
19
|
+
- BUGFIX: allow NPM scripts for "ansi-recolor"
|
|
20
|
+
- UPDATE: upgrade NPM dependencies
|
|
21
|
+
|
|
5
22
|
1.0.10 (2026-07-11)
|
|
6
23
|
-------------------
|
|
7
24
|
|
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,7 +264,7 @@ 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
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");
|
|
@@ -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
|
}
|
|
@@ -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()) */
|
|
@@ -917,6 +916,8 @@ const actionDefault = (opts, args) => {
|
|
|
917
916
|
env.ENABLE_TOOL_SEARCH = "auto";
|
|
918
917
|
}
|
|
919
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");
|
|
920
921
|
/* parse openrouter:<model>[?[context=<size>],[capabilities=<list>]] */
|
|
921
922
|
const remainder = claudeModel.slice("openrouter:".length);
|
|
922
923
|
const qIdx = remainder.indexOf("?");
|
|
@@ -954,9 +955,9 @@ const actionDefault = (opts, args) => {
|
|
|
954
955
|
env.ENABLE_TOOL_SEARCH = "auto";
|
|
955
956
|
}
|
|
956
957
|
else if (claudeModel !== "")
|
|
957
|
-
|
|
958
|
+
fatal(`invalid CLAUDE_MODEL "${claudeModel}" ` +
|
|
958
959
|
"(supports only: \"ollama[://<host>[:<port>]]/<model>[?[context=<size>],[capabilities=<list>]]\" " +
|
|
959
|
-
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\"");
|
|
960
|
+
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\")");
|
|
960
961
|
/* override ASE configuration (for its diagram rendering) */
|
|
961
962
|
if (opts.ase) {
|
|
962
963
|
if (env.ASE_TERM_WIDTH === undefined) {
|
|
@@ -975,7 +976,7 @@ const actionDefault = (opts, args) => {
|
|
|
975
976
|
colorMode = "ansi256";
|
|
976
977
|
else if (depth >= 4)
|
|
977
978
|
colorMode = "ansi16";
|
|
978
|
-
env.ASE_TERM_COLORS =
|
|
979
|
+
env.ASE_TERM_COLORS = colorMode;
|
|
979
980
|
}
|
|
980
981
|
if (args.includes("-p") || args.includes("--print"))
|
|
981
982
|
env.ASE_HEADLESS = "true";
|
|
@@ -1051,6 +1052,18 @@ const actionHelp = () => {
|
|
|
1051
1052
|
" internal … internal command dispatcher (internal use only)\n");
|
|
1052
1053
|
process.exit(0);
|
|
1053
1054
|
};
|
|
1055
|
+
/* action: top-level "-v/-V/--version" */
|
|
1056
|
+
const actionVersion = () => {
|
|
1057
|
+
/* run "claude --version" */
|
|
1058
|
+
process.env.PATH = `${HOME}/.local/bin:${process.env.PATH ?? ""}`;
|
|
1059
|
+
ensureTool("claude");
|
|
1060
|
+
const claudeBin = path.join(HOME, ".local/bin/claude");
|
|
1061
|
+
execaSync(claudeBin, ["--version"], { reject: false, stdio: ["ignore", "inherit", "inherit"] });
|
|
1062
|
+
/* append our claudeX extension information */
|
|
1063
|
+
const version = JSON.parse(fs.readFileSync(path.join(basedir, "package.json"), "utf8")).version;
|
|
1064
|
+
process.stdout.write(`${version} (claudeX)\n`);
|
|
1065
|
+
process.exit(0);
|
|
1066
|
+
};
|
|
1054
1067
|
/* the main procedure -- builds and dispatches according to options and commands */
|
|
1055
1068
|
const main = async () => {
|
|
1056
1069
|
/* honor the external CLAUDEX_FLAGS environment variable as a way to set
|
|
@@ -1090,7 +1103,7 @@ const main = async () => {
|
|
|
1090
1103
|
invoked with any of these options, as the corresponding
|
|
1091
1104
|
non-interactive or session-related modes are incompatible
|
|
1092
1105
|
with wrapping claude inside a Tmux session */
|
|
1093
|
-
const noTmuxOpts = ["-p"];
|
|
1106
|
+
const noTmuxOpts = ["-p", "--print"];
|
|
1094
1107
|
const skipTmux = topArgs.some((a) => noTmuxOpts.includes(a));
|
|
1095
1108
|
const filtered = [];
|
|
1096
1109
|
for (let i = 0; i < tokens.length; i++) {
|
|
@@ -1108,8 +1121,8 @@ const main = async () => {
|
|
|
1108
1121
|
process.argv.splice(2, 0, ...toInsert);
|
|
1109
1122
|
}
|
|
1110
1123
|
}
|
|
1111
|
-
/* intercept top-level "-h/--help" before commander
|
|
1112
|
-
pass-through to "claude
|
|
1124
|
+
/* intercept top-level "-h/--help" and "-v/-V/--version" before commander
|
|
1125
|
+
grabs them, so we can pass-through to "claude" and append our extension info */
|
|
1113
1126
|
const topArgs = process.argv.slice(2);
|
|
1114
1127
|
const firstNonFlag = topArgs.findIndex((a) => !a.startsWith("-"));
|
|
1115
1128
|
const headFlags = firstNonFlag < 0 ? topArgs : topArgs.slice(0, firstNonFlag);
|
|
@@ -1117,12 +1130,14 @@ const main = async () => {
|
|
|
1117
1130
|
if ((headFlags.includes("-h") || headFlags.includes("--help"))
|
|
1118
1131
|
&& subcmd !== "install" && subcmd !== "update" && subcmd !== "internal")
|
|
1119
1132
|
actionHelp();
|
|
1133
|
+
if ((headFlags.includes("-v") || headFlags.includes("-V") || headFlags.includes("--version"))
|
|
1134
|
+
&& subcmd !== "install" && subcmd !== "update" && subcmd !== "internal")
|
|
1135
|
+
actionVersion();
|
|
1120
1136
|
/* dispatch main command */
|
|
1121
1137
|
const program = new Command();
|
|
1122
1138
|
program
|
|
1123
1139
|
.name("claudex")
|
|
1124
1140
|
.description("Claude Code eXtended")
|
|
1125
|
-
.version(JSON.parse(fs.readFileSync(path.join(basedir, "package.json"), "utf8")).version, "-V, --version")
|
|
1126
1141
|
.enablePositionalOptions()
|
|
1127
1142
|
.passThroughOptions()
|
|
1128
1143
|
.allowUnknownOption()
|
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,7 +303,7 @@ 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
309
|
await self("internal", "capsula", "-s", "sudo", "-E", "npm", "install", "-y", "-g", "--allow-scripts=node-pty,tty-attr", "ansi-recolor")
|
|
@@ -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
|
}
|
|
@@ -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
|
|
@@ -1013,6 +1012,8 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
|
|
|
1013
1012
|
env.ENABLE_TOOL_SEARCH = "auto"
|
|
1014
1013
|
}
|
|
1015
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")
|
|
1016
1017
|
/* parse openrouter:<model>[?[context=<size>],[capabilities=<list>]] */
|
|
1017
1018
|
const remainder = claudeModel.slice("openrouter:".length)
|
|
1018
1019
|
const qIdx = remainder.indexOf("?")
|
|
@@ -1049,9 +1050,9 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
|
|
|
1049
1050
|
env.ENABLE_TOOL_SEARCH = "auto"
|
|
1050
1051
|
}
|
|
1051
1052
|
else if (claudeModel !== "")
|
|
1052
|
-
|
|
1053
|
+
fatal(`invalid CLAUDE_MODEL "${claudeModel}" ` +
|
|
1053
1054
|
"(supports only: \"ollama[://<host>[:<port>]]/<model>[?[context=<size>],[capabilities=<list>]]\" " +
|
|
1054
|
-
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\"")
|
|
1055
|
+
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\")")
|
|
1055
1056
|
|
|
1056
1057
|
/* override ASE configuration (for its diagram rendering) */
|
|
1057
1058
|
if (opts.ase) {
|
|
@@ -1071,7 +1072,7 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
|
|
|
1071
1072
|
colorMode = "ansi256"
|
|
1072
1073
|
else if (depth >= 4)
|
|
1073
1074
|
colorMode = "ansi16"
|
|
1074
|
-
env.ASE_TERM_COLORS =
|
|
1075
|
+
env.ASE_TERM_COLORS = colorMode
|
|
1075
1076
|
}
|
|
1076
1077
|
if (args.includes("-p") || args.includes("--print"))
|
|
1077
1078
|
env.ASE_HEADLESS = "true"
|
|
@@ -1154,6 +1155,20 @@ const actionHelp = (): never => {
|
|
|
1154
1155
|
process.exit(0)
|
|
1155
1156
|
}
|
|
1156
1157
|
|
|
1158
|
+
/* action: top-level "-v/-V/--version" */
|
|
1159
|
+
const actionVersion = (): never => {
|
|
1160
|
+
/* run "claude --version" */
|
|
1161
|
+
process.env.PATH = `${HOME}/.local/bin:${process.env.PATH ?? ""}`
|
|
1162
|
+
ensureTool("claude")
|
|
1163
|
+
const claudeBin = path.join(HOME, ".local/bin/claude")
|
|
1164
|
+
execaSync(claudeBin, [ "--version" ], { reject: false, stdio: [ "ignore", "inherit", "inherit" ] })
|
|
1165
|
+
|
|
1166
|
+
/* append our claudeX extension information */
|
|
1167
|
+
const version = (JSON.parse(fs.readFileSync(path.join(basedir, "package.json"), "utf8")) as { version: string }).version
|
|
1168
|
+
process.stdout.write(`${version} (claudeX)\n`)
|
|
1169
|
+
process.exit(0)
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1157
1172
|
/* the main procedure -- builds and dispatches according to options and commands */
|
|
1158
1173
|
const main = async (): Promise<void> => {
|
|
1159
1174
|
/* honor the external CLAUDEX_FLAGS environment variable as a way to set
|
|
@@ -1195,7 +1210,7 @@ const main = async (): Promise<void> => {
|
|
|
1195
1210
|
invoked with any of these options, as the corresponding
|
|
1196
1211
|
non-interactive or session-related modes are incompatible
|
|
1197
1212
|
with wrapping claude inside a Tmux session */
|
|
1198
|
-
const noTmuxOpts = [ "-p" ]
|
|
1213
|
+
const noTmuxOpts = [ "-p", "--print" ]
|
|
1199
1214
|
const skipTmux = topArgs.some((a) => noTmuxOpts.includes(a))
|
|
1200
1215
|
const filtered: string[] = []
|
|
1201
1216
|
for (let i = 0; i < tokens.length; i++) {
|
|
@@ -1215,8 +1230,8 @@ const main = async (): Promise<void> => {
|
|
|
1215
1230
|
}
|
|
1216
1231
|
}
|
|
1217
1232
|
|
|
1218
|
-
/* intercept top-level "-h/--help" before commander
|
|
1219
|
-
pass-through to "claude
|
|
1233
|
+
/* intercept top-level "-h/--help" and "-v/-V/--version" before commander
|
|
1234
|
+
grabs them, so we can pass-through to "claude" and append our extension info */
|
|
1220
1235
|
const topArgs = process.argv.slice(2)
|
|
1221
1236
|
const firstNonFlag = topArgs.findIndex((a) => !a.startsWith("-"))
|
|
1222
1237
|
const headFlags = firstNonFlag < 0 ? topArgs : topArgs.slice(0, firstNonFlag)
|
|
@@ -1224,13 +1239,15 @@ const main = async (): Promise<void> => {
|
|
|
1224
1239
|
if ((headFlags.includes("-h") || headFlags.includes("--help"))
|
|
1225
1240
|
&& subcmd !== "install" && subcmd !== "update" && subcmd !== "internal")
|
|
1226
1241
|
actionHelp()
|
|
1242
|
+
if ((headFlags.includes("-v") || headFlags.includes("-V") || headFlags.includes("--version"))
|
|
1243
|
+
&& subcmd !== "install" && subcmd !== "update" && subcmd !== "internal")
|
|
1244
|
+
actionVersion()
|
|
1227
1245
|
|
|
1228
1246
|
/* dispatch main command */
|
|
1229
1247
|
const program = new Command()
|
|
1230
1248
|
program
|
|
1231
1249
|
.name("claudex")
|
|
1232
1250
|
.description("Claude Code eXtended")
|
|
1233
|
-
.version(JSON.parse(fs.readFileSync(path.join(basedir, "package.json"), "utf8")).version, "-V, --version")
|
|
1234
1251
|
.enablePositionalOptions()
|
|
1235
1252
|
.passThroughOptions()
|
|
1236
1253
|
.allowUnknownOption()
|
package/lazygit.yaml
CHANGED
|
@@ -26,6 +26,7 @@ gui:
|
|
|
26
26
|
commitHashLength: 0
|
|
27
27
|
expandFocusedSidePanel: true
|
|
28
28
|
expandedSidePanelWeight: 4
|
|
29
|
+
shrinkSidePanelsToContent: false
|
|
29
30
|
theme:
|
|
30
31
|
selectedLineBgColor:
|
|
31
32
|
- reverse
|
|
@@ -36,15 +37,33 @@ gui:
|
|
|
36
37
|
- white
|
|
37
38
|
optionsTextColor:
|
|
38
39
|
- blue
|
|
40
|
+
sidePanels:
|
|
41
|
+
- [ files ]
|
|
42
|
+
- [ worktrees ]
|
|
43
|
+
- [ branches, submodules ]
|
|
44
|
+
- [ commits, reflog, tags ]
|
|
45
|
+
- [ stash ]
|
|
46
|
+
spinner:
|
|
47
|
+
frames:
|
|
48
|
+
- ●∙∙∙
|
|
49
|
+
- ∙●∙∙
|
|
50
|
+
- ∙∙●∙
|
|
51
|
+
- ∙∙∙●
|
|
52
|
+
- ∙∙●∙
|
|
53
|
+
- ∙●∙∙
|
|
54
|
+
rate: 180
|
|
39
55
|
|
|
40
56
|
git:
|
|
41
57
|
autoFetch: false
|
|
42
58
|
autoRefresh: true
|
|
59
|
+
pagers:
|
|
60
|
+
- pager: delta --dark --paging=never
|
|
61
|
+
|
|
43
62
|
refresher:
|
|
44
|
-
refreshInterval:
|
|
63
|
+
refreshInterval: 2
|
|
45
64
|
|
|
46
65
|
update:
|
|
47
|
-
method:
|
|
66
|
+
method: never
|
|
48
67
|
days: 1
|
|
49
68
|
|
|
50
69
|
reporting: "off"
|
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.13",
|
|
5
5
|
"description": "Claude Code eXtended",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [ "claude", "code", "extension", "wrapper" ],
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"bin": { "claudex": "claudex.js" },
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"which": "7.0.0",
|
|
20
|
-
"execa": "10.0.
|
|
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": "3.0.
|
|
24
|
+
"shescape": "3.0.2",
|
|
25
25
|
"shell-quote": "1.10.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "6.0.3",
|
|
29
|
-
"@types/node": "26.1.
|
|
29
|
+
"@types/node": "26.1.2",
|
|
30
30
|
"@types/which": "3.0.4",
|
|
31
31
|
"@types/shell-quote": "1.7.5",
|
|
32
32
|
|
|
@@ -38,7 +38,7 @@
|
|
|
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": {
|