@rse/claudex 1.0.7 → 1.0.9
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 +14 -0
- package/README.md +5 -0
- package/ansi-recolor.conf +2 -0
- package/claudex.js +41 -1
- package/claudex.ts +40 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
ChangeLog
|
|
3
3
|
=========
|
|
4
4
|
|
|
5
|
+
1.0.9 (2026-06-15)
|
|
6
|
+
------------------
|
|
7
|
+
|
|
8
|
+
- FEATURE: add support for OpenRouter-based LLM usage via `openrouter:` `CLAUDE_MODEL`
|
|
9
|
+
- IMPROVEMENT: support text selection in `tmux` fullscreen mode via `ansi-recolor.conf`
|
|
10
|
+
|
|
11
|
+
1.0.8 (2026-05-29)
|
|
12
|
+
------------------
|
|
13
|
+
|
|
14
|
+
- IMPROVEMENT: document Ollama `CLAUDE_MODEL` usage example in README
|
|
15
|
+
- BUGFIX: validate `CLAUDE_MODEL` and throw on invalid (non-empty) value
|
|
16
|
+
- UPDATE: upgrade to Node 26 (once again)
|
|
17
|
+
- UPDATE: upgrade NPM dependencies
|
|
18
|
+
|
|
5
19
|
1.0.7 (2026-05-22)
|
|
6
20
|
------------------
|
|
7
21
|
|
package/README.md
CHANGED
|
@@ -80,6 +80,11 @@ $ claudex
|
|
|
80
80
|
[...options...] # arbitrary Claude Code options
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
```sh
|
|
84
|
+
# example: run Claude Code with Gemma 4 31B MTP under Ollama
|
|
85
|
+
$ CLAUDE_MODEL="ollama:/gemma4:31b-coding-mtp-bf16?context=262K" claudex -T -R -A
|
|
86
|
+
```
|
|
87
|
+
|
|
83
88
|
See Also
|
|
84
89
|
--------
|
|
85
90
|
|
package/ansi-recolor.conf
CHANGED
package/claudex.js
CHANGED
|
@@ -458,7 +458,7 @@ const actionUpdate = async (capsula) => {
|
|
|
458
458
|
executeCommand({
|
|
459
459
|
"windows:winget": "winget upgrade --accept-package-agreements --accept-source-agreements --silent -e --id OpenJS.NodeJS.LTS",
|
|
460
460
|
"windows:choco": "choco upgrade -y --accept-license --no-progress nodejs",
|
|
461
|
-
"macos:ports": "sudo port -N upgrade
|
|
461
|
+
"macos:ports": "sudo port -N upgrade nodejs26 npm11",
|
|
462
462
|
"macos:brew": "sudo brew upgrade node",
|
|
463
463
|
"linux:apt": "sudo apt install --only-upgrade -y nodejs",
|
|
464
464
|
"linux:apk": "sudo apk upgrade --no-interactive nodejs npm"
|
|
@@ -898,12 +898,52 @@ const actionDefault = (opts, args) => {
|
|
|
898
898
|
env.ANTHROPIC_DEFAULT_HAIKU_MODEL = model;
|
|
899
899
|
env.ANTHROPIC_DEFAULT_OPUS_MODEL = model;
|
|
900
900
|
env.ANTHROPIC_DEFAULT_SONNET_MODEL = model;
|
|
901
|
+
env.CLAUDE_CODE_SUBAGENT_MODEL = model;
|
|
901
902
|
env.CLAUDE_CODE_ATTRIBUTION_HEADER = "0";
|
|
902
903
|
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context;
|
|
904
|
+
env.DISABLE_LOGIN_COMMAND = "1";
|
|
905
|
+
env.DISABLE_LOGOUT_COMMAND = "1";
|
|
906
|
+
}
|
|
907
|
+
else if (/^openrouter:/.test(claudeModel)) {
|
|
908
|
+
/* parse openrouter:<model>[?[context=<size>],[capabilities=<list>]] */
|
|
909
|
+
const remainder = claudeModel.slice("openrouter:".length);
|
|
910
|
+
const qIdx = remainder.indexOf("?");
|
|
911
|
+
const model = qIdx >= 0 ? remainder.slice(0, qIdx) : remainder;
|
|
912
|
+
if (model === "")
|
|
913
|
+
fatal("invalid CLAUDE_MODEL: missing model name in " +
|
|
914
|
+
`"${claudeModel}" (expected: openrouter:<model>[?...])`);
|
|
915
|
+
let context = "200k";
|
|
916
|
+
let capabilities = "";
|
|
917
|
+
if (qIdx >= 0) {
|
|
918
|
+
const query = remainder.slice(qIdx + 1);
|
|
919
|
+
for (const pair of query.split(",")) {
|
|
920
|
+
const eq = pair.indexOf("=");
|
|
921
|
+
const key = eq >= 0 ? pair.slice(0, eq) : pair;
|
|
922
|
+
const val = eq >= 0 ? pair.slice(eq + 1) : "";
|
|
923
|
+
if (key === "context")
|
|
924
|
+
context = val;
|
|
925
|
+
else if (key === "capabilities")
|
|
926
|
+
capabilities = val;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
/* override Claude Code configuration */
|
|
930
|
+
env.ANTHROPIC_API_KEY = "";
|
|
931
|
+
env.ANTHROPIC_AUTH_TOKEN = process.env.OPENROUTER_API_KEY;
|
|
932
|
+
env.ANTHROPIC_BASE_URL = "https://openrouter.ai/api";
|
|
933
|
+
env.ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES = capabilities;
|
|
934
|
+
env.ANTHROPIC_DEFAULT_HAIKU_MODEL = model;
|
|
935
|
+
env.ANTHROPIC_DEFAULT_OPUS_MODEL = model;
|
|
936
|
+
env.ANTHROPIC_DEFAULT_SONNET_MODEL = model;
|
|
903
937
|
env.CLAUDE_CODE_SUBAGENT_MODEL = model;
|
|
938
|
+
env.CLAUDE_CODE_ATTRIBUTION_HEADER = "0";
|
|
939
|
+
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context;
|
|
904
940
|
env.DISABLE_LOGIN_COMMAND = "1";
|
|
905
941
|
env.DISABLE_LOGOUT_COMMAND = "1";
|
|
906
942
|
}
|
|
943
|
+
else if (claudeModel !== "")
|
|
944
|
+
throw new Error(`invalid CLAUDE_MODEL "${claudeModel}" ` +
|
|
945
|
+
"(supports only: \"ollama[://<host>[:<port>]]/<model>[?[context=<size>],[capabilities=<list>]]\" " +
|
|
946
|
+
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\"");
|
|
907
947
|
/* override ASE configuration (for its diagram rendering) */
|
|
908
948
|
if (opts.ase) {
|
|
909
949
|
if (env.ASE_TERM_WIDTH === undefined) {
|
package/claudex.ts
CHANGED
|
@@ -529,7 +529,7 @@ const actionUpdate = async (capsula: boolean): Promise<void> => {
|
|
|
529
529
|
executeCommand({
|
|
530
530
|
"windows:winget": "winget upgrade --accept-package-agreements --accept-source-agreements --silent -e --id OpenJS.NodeJS.LTS",
|
|
531
531
|
"windows:choco": "choco upgrade -y --accept-license --no-progress nodejs",
|
|
532
|
-
"macos:ports": "sudo port -N upgrade
|
|
532
|
+
"macos:ports": "sudo port -N upgrade nodejs26 npm11",
|
|
533
533
|
"macos:brew": "sudo brew upgrade node",
|
|
534
534
|
"linux:apt": "sudo apt install --only-upgrade -y nodejs",
|
|
535
535
|
"linux:apk": "sudo apk upgrade --no-interactive nodejs npm"
|
|
@@ -994,12 +994,51 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
|
|
|
994
994
|
env.ANTHROPIC_DEFAULT_HAIKU_MODEL = model
|
|
995
995
|
env.ANTHROPIC_DEFAULT_OPUS_MODEL = model
|
|
996
996
|
env.ANTHROPIC_DEFAULT_SONNET_MODEL = model
|
|
997
|
+
env.CLAUDE_CODE_SUBAGENT_MODEL = model
|
|
997
998
|
env.CLAUDE_CODE_ATTRIBUTION_HEADER = "0"
|
|
998
999
|
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context
|
|
1000
|
+
env.DISABLE_LOGIN_COMMAND = "1"
|
|
1001
|
+
env.DISABLE_LOGOUT_COMMAND = "1"
|
|
1002
|
+
}
|
|
1003
|
+
else if (/^openrouter:/.test(claudeModel)) {
|
|
1004
|
+
/* parse openrouter:<model>[?[context=<size>],[capabilities=<list>]] */
|
|
1005
|
+
const remainder = claudeModel.slice("openrouter:".length)
|
|
1006
|
+
const qIdx = remainder.indexOf("?")
|
|
1007
|
+
const model = qIdx >= 0 ? remainder.slice(0, qIdx) : remainder
|
|
1008
|
+
if (model === "")
|
|
1009
|
+
fatal("invalid CLAUDE_MODEL: missing model name in " +
|
|
1010
|
+
`"${claudeModel}" (expected: openrouter:<model>[?...])`)
|
|
1011
|
+
let context = "200k"
|
|
1012
|
+
let capabilities = ""
|
|
1013
|
+
if (qIdx >= 0) {
|
|
1014
|
+
const query = remainder.slice(qIdx + 1)
|
|
1015
|
+
for (const pair of query.split(",")) {
|
|
1016
|
+
const eq = pair.indexOf("=")
|
|
1017
|
+
const key = eq >= 0 ? pair.slice(0, eq) : pair
|
|
1018
|
+
const val = eq >= 0 ? pair.slice(eq + 1) : ""
|
|
1019
|
+
if (key === "context") context = val
|
|
1020
|
+
else if (key === "capabilities") capabilities = val
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
/* override Claude Code configuration */
|
|
1025
|
+
env.ANTHROPIC_API_KEY = ""
|
|
1026
|
+
env.ANTHROPIC_AUTH_TOKEN = process.env.OPENROUTER_API_KEY
|
|
1027
|
+
env.ANTHROPIC_BASE_URL = "https://openrouter.ai/api"
|
|
1028
|
+
env.ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES = capabilities
|
|
1029
|
+
env.ANTHROPIC_DEFAULT_HAIKU_MODEL = model
|
|
1030
|
+
env.ANTHROPIC_DEFAULT_OPUS_MODEL = model
|
|
1031
|
+
env.ANTHROPIC_DEFAULT_SONNET_MODEL = model
|
|
999
1032
|
env.CLAUDE_CODE_SUBAGENT_MODEL = model
|
|
1033
|
+
env.CLAUDE_CODE_ATTRIBUTION_HEADER = "0"
|
|
1034
|
+
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context
|
|
1000
1035
|
env.DISABLE_LOGIN_COMMAND = "1"
|
|
1001
1036
|
env.DISABLE_LOGOUT_COMMAND = "1"
|
|
1002
1037
|
}
|
|
1038
|
+
else if (claudeModel !== "")
|
|
1039
|
+
throw new Error(`invalid CLAUDE_MODEL "${claudeModel}" ` +
|
|
1040
|
+
"(supports only: \"ollama[://<host>[:<port>]]/<model>[?[context=<size>],[capabilities=<list>]]\" " +
|
|
1041
|
+
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\"")
|
|
1003
1042
|
|
|
1004
1043
|
/* override ASE configuration (for its diagram rendering) */
|
|
1005
1044
|
if (opts.ase) {
|
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.9",
|
|
5
5
|
"description": "Claude Code eXtended",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [ "claude", "code", "extension", "wrapper" ],
|
|
@@ -19,22 +19,22 @@
|
|
|
19
19
|
"which": "7.0.0",
|
|
20
20
|
"execa": "9.6.1",
|
|
21
21
|
"chalk": "5.6.2",
|
|
22
|
-
"commander": "
|
|
22
|
+
"commander": "15.0.0",
|
|
23
23
|
"deepmerge": "4.3.1",
|
|
24
24
|
"shescape": "2.1.12",
|
|
25
|
-
"shell-quote": "1.8.
|
|
25
|
+
"shell-quote": "1.8.4"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "6.0.3",
|
|
29
|
-
"@types/node": "25.
|
|
29
|
+
"@types/node": "25.9.1",
|
|
30
30
|
"@types/which": "3.0.4",
|
|
31
31
|
"@types/shell-quote": "1.7.5",
|
|
32
32
|
|
|
33
33
|
"@rse/stx": "1.1.5",
|
|
34
34
|
"eslint": "9.39.4",
|
|
35
35
|
"@eslint/js": "9.39.4",
|
|
36
|
-
"typescript-eslint": "8.
|
|
37
|
-
"@typescript-eslint/parser": "8.
|
|
36
|
+
"typescript-eslint": "8.60.0",
|
|
37
|
+
"@typescript-eslint/parser": "8.60.0",
|
|
38
38
|
"eslint-plugin-promise": "7.3.0",
|
|
39
39
|
"eslint-plugin-import": "2.32.0",
|
|
40
40
|
"neostandard": "0.13.0",
|