@rse/claudex 1.0.8 → 1.0.10
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 +13 -0
- package/README.md +6 -1
- package/ansi-recolor.conf +2 -0
- package/claude-settings.json +0 -5
- package/claudex.js +51 -12
- package/claudex.ts +50 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
ChangeLog
|
|
3
3
|
=========
|
|
4
4
|
|
|
5
|
+
1.0.10 (2026-07-11)
|
|
6
|
+
-------------------
|
|
7
|
+
|
|
8
|
+
- IMPROVEMENT: provide statusline via `ase setup statusline`
|
|
9
|
+
- IMPROVEMENT: add more usage examples to README
|
|
10
|
+
- BUGFIX: fix `CLAUDE_MODEL` passing into tmux session
|
|
11
|
+
|
|
12
|
+
1.0.9 (2026-06-15)
|
|
13
|
+
------------------
|
|
14
|
+
|
|
15
|
+
- FEATURE: add support for OpenRouter-based LLM usage via `openrouter:` `CLAUDE_MODEL`
|
|
16
|
+
- IMPROVEMENT: support text selection in `tmux` fullscreen mode via `ansi-recolor.conf`
|
|
17
|
+
|
|
5
18
|
1.0.8 (2026-05-29)
|
|
6
19
|
------------------
|
|
7
20
|
|
package/README.md
CHANGED
|
@@ -81,10 +81,15 @@ $ claudex
|
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
```sh
|
|
84
|
-
# example: run Claude Code with Gemma 4 31B MTP under Ollama
|
|
84
|
+
# example: run Claude Code with Gemma 4 31B MTP under local Ollama
|
|
85
85
|
$ CLAUDE_MODEL="ollama:/gemma4:31b-coding-mtp-bf16?context=262K" claudex -T -R -A
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
```sh
|
|
89
|
+
# example: run Claude Code with Google Gemini 3.5 Flash via remote OpenRouter
|
|
90
|
+
$ CLAUDE_MODEL="openrouter:google/gemini-3.5-flash?context=1000000" claudex -T -R -A
|
|
91
|
+
```
|
|
92
|
+
|
|
88
93
|
See Also
|
|
89
94
|
--------
|
|
90
95
|
|
package/ansi-recolor.conf
CHANGED
package/claude-settings.json
CHANGED
|
@@ -6,11 +6,6 @@
|
|
|
6
6
|
"DISABLE_ERROR_REPORTING": "1",
|
|
7
7
|
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
|
|
8
8
|
},
|
|
9
|
-
"statusLine": {
|
|
10
|
-
"type": "command",
|
|
11
|
-
"command": "ase statusline -w 0 -m 2 '<blue>%u</blue> <red>%p</red> <black>%T</black> %s' '%m %e %t' '%P %c'",
|
|
12
|
-
"padding": 0
|
|
13
|
-
},
|
|
14
9
|
"verbose": false,
|
|
15
10
|
"teammateMode": "tmux",
|
|
16
11
|
"preferences": {
|
package/claudex.js
CHANGED
|
@@ -540,6 +540,17 @@ const actionInternalTmux = (opts, args) => {
|
|
|
540
540
|
"bind-key s display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Shell )▶\" claudex internal shell\n" +
|
|
541
541
|
(opts.ase ? "bind-key q display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Task Edit (ase task edit) )▶\" claudex internal ase-task-edit\n" : "");
|
|
542
542
|
}
|
|
543
|
+
/* propagate model-selection environment variables into the tmux
|
|
544
|
+
server's global environment, so that they survive into every pane
|
|
545
|
+
(tmux does not carry arbitrary variables across the client/server
|
|
546
|
+
boundary -- only those listed in "update-environment" -- hence the
|
|
547
|
+
externally set CLAUDE_MODEL/OPENROUTER_API_KEY would otherwise be
|
|
548
|
+
lost before actionDefault reads them) */
|
|
549
|
+
for (const name of ["CLAUDE_MODEL", "OPENROUTER_API_KEY"]) {
|
|
550
|
+
const val = process.env[name];
|
|
551
|
+
if (val !== undefined && val !== "")
|
|
552
|
+
conf += `set-environment -g ${name} ${shQ.quote([val])}\n`;
|
|
553
|
+
}
|
|
543
554
|
conf = conf.replace(/@USER@/g, USER);
|
|
544
555
|
const confFile = path.join(os.tmpdir(), `claudex-tmux-${process.pid}.conf`);
|
|
545
556
|
fs.writeFileSync(confFile, conf, { mode: 0o600 });
|
|
@@ -898,15 +909,52 @@ const actionDefault = (opts, args) => {
|
|
|
898
909
|
env.ANTHROPIC_DEFAULT_HAIKU_MODEL = model;
|
|
899
910
|
env.ANTHROPIC_DEFAULT_OPUS_MODEL = model;
|
|
900
911
|
env.ANTHROPIC_DEFAULT_SONNET_MODEL = model;
|
|
912
|
+
env.CLAUDE_CODE_SUBAGENT_MODEL = model;
|
|
901
913
|
env.CLAUDE_CODE_ATTRIBUTION_HEADER = "0";
|
|
902
914
|
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context;
|
|
915
|
+
env.DISABLE_LOGIN_COMMAND = "1";
|
|
916
|
+
env.DISABLE_LOGOUT_COMMAND = "1";
|
|
917
|
+
}
|
|
918
|
+
else if (/^openrouter:/.test(claudeModel)) {
|
|
919
|
+
/* parse openrouter:<model>[?[context=<size>],[capabilities=<list>]] */
|
|
920
|
+
const remainder = claudeModel.slice("openrouter:".length);
|
|
921
|
+
const qIdx = remainder.indexOf("?");
|
|
922
|
+
const model = qIdx >= 0 ? remainder.slice(0, qIdx) : remainder;
|
|
923
|
+
if (model === "")
|
|
924
|
+
fatal("invalid CLAUDE_MODEL: missing model name in " +
|
|
925
|
+
`"${claudeModel}" (expected: openrouter:<model>[?...])`);
|
|
926
|
+
let context = "200k";
|
|
927
|
+
let capabilities = "";
|
|
928
|
+
if (qIdx >= 0) {
|
|
929
|
+
const query = remainder.slice(qIdx + 1);
|
|
930
|
+
for (const pair of query.split(",")) {
|
|
931
|
+
const eq = pair.indexOf("=");
|
|
932
|
+
const key = eq >= 0 ? pair.slice(0, eq) : pair;
|
|
933
|
+
const val = eq >= 0 ? pair.slice(eq + 1) : "";
|
|
934
|
+
if (key === "context")
|
|
935
|
+
context = val;
|
|
936
|
+
else if (key === "capabilities")
|
|
937
|
+
capabilities = val;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
/* override Claude Code configuration */
|
|
941
|
+
env.ANTHROPIC_API_KEY = "";
|
|
942
|
+
env.ANTHROPIC_AUTH_TOKEN = process.env.OPENROUTER_API_KEY;
|
|
943
|
+
env.ANTHROPIC_BASE_URL = "https://openrouter.ai/api";
|
|
944
|
+
env.ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES = capabilities;
|
|
945
|
+
env.ANTHROPIC_DEFAULT_HAIKU_MODEL = model;
|
|
946
|
+
env.ANTHROPIC_DEFAULT_OPUS_MODEL = model;
|
|
947
|
+
env.ANTHROPIC_DEFAULT_SONNET_MODEL = model;
|
|
903
948
|
env.CLAUDE_CODE_SUBAGENT_MODEL = model;
|
|
949
|
+
env.CLAUDE_CODE_ATTRIBUTION_HEADER = "0";
|
|
950
|
+
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context;
|
|
904
951
|
env.DISABLE_LOGIN_COMMAND = "1";
|
|
905
952
|
env.DISABLE_LOGOUT_COMMAND = "1";
|
|
906
953
|
}
|
|
907
954
|
else if (claudeModel !== "")
|
|
908
955
|
throw new Error(`invalid CLAUDE_MODEL "${claudeModel}" ` +
|
|
909
|
-
"(supports only: \"ollama[://<host>[:<port>]]/<model>[?[context=<size>],[capabilities=<list>]]\""
|
|
956
|
+
"(supports only: \"ollama[://<host>[:<port>]]/<model>[?[context=<size>],[capabilities=<list>]]\" " +
|
|
957
|
+
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\"");
|
|
910
958
|
/* override ASE configuration (for its diagram rendering) */
|
|
911
959
|
if (opts.ase) {
|
|
912
960
|
if (env.ASE_TERM_WIDTH === undefined) {
|
|
@@ -948,15 +996,6 @@ const actionDefault = (opts, args) => {
|
|
|
948
996
|
]
|
|
949
997
|
}
|
|
950
998
|
};
|
|
951
|
-
if (opts.ase) {
|
|
952
|
-
claudeSettings = deepmerge(claudeSettings, {
|
|
953
|
-
"statusLine": {
|
|
954
|
-
"type": "command",
|
|
955
|
-
"command": "ase statusline -w 0 -m 2 '<blue>%u</blue> <red>%p</red> <black>%T</black> %s' '%m %e %t' '%P %c'",
|
|
956
|
-
"padding": 0
|
|
957
|
-
}
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
999
|
if (opts.tmux) {
|
|
961
1000
|
claudeSettings = deepmerge(claudeSettings, {
|
|
962
1001
|
"env": {
|
|
@@ -1001,7 +1040,7 @@ const actionHelp = () => {
|
|
|
1001
1040
|
" -C, --capsula execute Claude Code inside a Capsula sandbox container\n" +
|
|
1002
1041
|
" -T, --tmux [session] wrap Claude Code in a Tmux terminal multiplexing session (optional session name)\n" +
|
|
1003
1042
|
" -R, --recolor wrap Claude Code with ANSI recoloring for improved theming\n" +
|
|
1004
|
-
" -A, --ase enable ASE-specific
|
|
1043
|
+
" -A, --ase enable ASE-specific ASE_* environment variables and Tmux settings\n" +
|
|
1005
1044
|
"\n" +
|
|
1006
1045
|
"claudeX extension subcommands (honored before claude):\n" +
|
|
1007
1046
|
" install install host-side or in-container dependencies\n" +
|
|
@@ -1089,7 +1128,7 @@ const main = async () => {
|
|
|
1089
1128
|
.option("-C, --capsula", "execute Claude Code inside a Capsula sandbox container")
|
|
1090
1129
|
.option("-T, --tmux [session]", "wrap Claude Code in a Tmux terminal multiplexing session (optional session name)")
|
|
1091
1130
|
.option("-R, --recolor", "wrap Claude Code with ANSI recoloring for improved theming")
|
|
1092
|
-
.option("-A, --ase", "enable ASE-specific
|
|
1131
|
+
.option("-A, --ase", "enable ASE-specific ASE_* environment variables and Tmux settings")
|
|
1093
1132
|
.argument("[args...]", "arguments passed unparsed to Claude Code")
|
|
1094
1133
|
.action((args, opts) => {
|
|
1095
1134
|
actionDefault(opts, args);
|
package/claudex.ts
CHANGED
|
@@ -619,6 +619,17 @@ const actionInternalTmux = (opts: TopOpts, args: string[]): never => {
|
|
|
619
619
|
"bind-key s display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Shell )▶\" claudex internal shell\n" +
|
|
620
620
|
(opts.ase ? "bind-key q display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Task Edit (ase task edit) )▶\" claudex internal ase-task-edit\n" : "")
|
|
621
621
|
}
|
|
622
|
+
/* propagate model-selection environment variables into the tmux
|
|
623
|
+
server's global environment, so that they survive into every pane
|
|
624
|
+
(tmux does not carry arbitrary variables across the client/server
|
|
625
|
+
boundary -- only those listed in "update-environment" -- hence the
|
|
626
|
+
externally set CLAUDE_MODEL/OPENROUTER_API_KEY would otherwise be
|
|
627
|
+
lost before actionDefault reads them) */
|
|
628
|
+
for (const name of [ "CLAUDE_MODEL", "OPENROUTER_API_KEY" ]) {
|
|
629
|
+
const val = process.env[name]
|
|
630
|
+
if (val !== undefined && val !== "")
|
|
631
|
+
conf += `set-environment -g ${name} ${shQ.quote([ val ])}\n`
|
|
632
|
+
}
|
|
622
633
|
conf = conf.replace(/@USER@/g, USER)
|
|
623
634
|
const confFile = path.join(os.tmpdir(), `claudex-tmux-${process.pid}.conf`)
|
|
624
635
|
fs.writeFileSync(confFile, conf, { mode: 0o600 })
|
|
@@ -994,15 +1005,51 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
|
|
|
994
1005
|
env.ANTHROPIC_DEFAULT_HAIKU_MODEL = model
|
|
995
1006
|
env.ANTHROPIC_DEFAULT_OPUS_MODEL = model
|
|
996
1007
|
env.ANTHROPIC_DEFAULT_SONNET_MODEL = model
|
|
1008
|
+
env.CLAUDE_CODE_SUBAGENT_MODEL = model
|
|
997
1009
|
env.CLAUDE_CODE_ATTRIBUTION_HEADER = "0"
|
|
998
1010
|
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context
|
|
1011
|
+
env.DISABLE_LOGIN_COMMAND = "1"
|
|
1012
|
+
env.DISABLE_LOGOUT_COMMAND = "1"
|
|
1013
|
+
}
|
|
1014
|
+
else if (/^openrouter:/.test(claudeModel)) {
|
|
1015
|
+
/* parse openrouter:<model>[?[context=<size>],[capabilities=<list>]] */
|
|
1016
|
+
const remainder = claudeModel.slice("openrouter:".length)
|
|
1017
|
+
const qIdx = remainder.indexOf("?")
|
|
1018
|
+
const model = qIdx >= 0 ? remainder.slice(0, qIdx) : remainder
|
|
1019
|
+
if (model === "")
|
|
1020
|
+
fatal("invalid CLAUDE_MODEL: missing model name in " +
|
|
1021
|
+
`"${claudeModel}" (expected: openrouter:<model>[?...])`)
|
|
1022
|
+
let context = "200k"
|
|
1023
|
+
let capabilities = ""
|
|
1024
|
+
if (qIdx >= 0) {
|
|
1025
|
+
const query = remainder.slice(qIdx + 1)
|
|
1026
|
+
for (const pair of query.split(",")) {
|
|
1027
|
+
const eq = pair.indexOf("=")
|
|
1028
|
+
const key = eq >= 0 ? pair.slice(0, eq) : pair
|
|
1029
|
+
const val = eq >= 0 ? pair.slice(eq + 1) : ""
|
|
1030
|
+
if (key === "context") context = val
|
|
1031
|
+
else if (key === "capabilities") capabilities = val
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/* override Claude Code configuration */
|
|
1036
|
+
env.ANTHROPIC_API_KEY = ""
|
|
1037
|
+
env.ANTHROPIC_AUTH_TOKEN = process.env.OPENROUTER_API_KEY
|
|
1038
|
+
env.ANTHROPIC_BASE_URL = "https://openrouter.ai/api"
|
|
1039
|
+
env.ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES = capabilities
|
|
1040
|
+
env.ANTHROPIC_DEFAULT_HAIKU_MODEL = model
|
|
1041
|
+
env.ANTHROPIC_DEFAULT_OPUS_MODEL = model
|
|
1042
|
+
env.ANTHROPIC_DEFAULT_SONNET_MODEL = model
|
|
999
1043
|
env.CLAUDE_CODE_SUBAGENT_MODEL = model
|
|
1044
|
+
env.CLAUDE_CODE_ATTRIBUTION_HEADER = "0"
|
|
1045
|
+
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = context
|
|
1000
1046
|
env.DISABLE_LOGIN_COMMAND = "1"
|
|
1001
1047
|
env.DISABLE_LOGOUT_COMMAND = "1"
|
|
1002
1048
|
}
|
|
1003
1049
|
else if (claudeModel !== "")
|
|
1004
1050
|
throw new Error(`invalid CLAUDE_MODEL "${claudeModel}" ` +
|
|
1005
|
-
"(supports only: \"ollama[://<host>[:<port>]]/<model>[?[context=<size>],[capabilities=<list>]]\""
|
|
1051
|
+
"(supports only: \"ollama[://<host>[:<port>]]/<model>[?[context=<size>],[capabilities=<list>]]\" " +
|
|
1052
|
+
"and \"openrouter:<model>[?[context=<size>],[capabilities=<list>]]\"")
|
|
1006
1053
|
|
|
1007
1054
|
/* override ASE configuration (for its diagram rendering) */
|
|
1008
1055
|
if (opts.ase) {
|
|
@@ -1046,15 +1093,6 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
|
|
|
1046
1093
|
]
|
|
1047
1094
|
}
|
|
1048
1095
|
} as Record<string, unknown>
|
|
1049
|
-
if (opts.ase) {
|
|
1050
|
-
claudeSettings = deepmerge(claudeSettings, {
|
|
1051
|
-
"statusLine": {
|
|
1052
|
-
"type": "command",
|
|
1053
|
-
"command": "ase statusline -w 0 -m 2 '<blue>%u</blue> <red>%p</red> <black>%T</black> %s' '%m %e %t' '%P %c'",
|
|
1054
|
-
"padding": 0
|
|
1055
|
-
}
|
|
1056
|
-
})
|
|
1057
|
-
}
|
|
1058
1096
|
if (opts.tmux) {
|
|
1059
1097
|
claudeSettings = deepmerge(claudeSettings, {
|
|
1060
1098
|
"env": {
|
|
@@ -1103,7 +1141,7 @@ const actionHelp = (): never => {
|
|
|
1103
1141
|
" -C, --capsula execute Claude Code inside a Capsula sandbox container\n" +
|
|
1104
1142
|
" -T, --tmux [session] wrap Claude Code in a Tmux terminal multiplexing session (optional session name)\n" +
|
|
1105
1143
|
" -R, --recolor wrap Claude Code with ANSI recoloring for improved theming\n" +
|
|
1106
|
-
" -A, --ase enable ASE-specific
|
|
1144
|
+
" -A, --ase enable ASE-specific ASE_* environment variables and Tmux settings\n" +
|
|
1107
1145
|
"\n" +
|
|
1108
1146
|
"claudeX extension subcommands (honored before claude):\n" +
|
|
1109
1147
|
" install install host-side or in-container dependencies\n" +
|
|
@@ -1198,7 +1236,7 @@ const main = async (): Promise<void> => {
|
|
|
1198
1236
|
.option("-C, --capsula", "execute Claude Code inside a Capsula sandbox container")
|
|
1199
1237
|
.option("-T, --tmux [session]", "wrap Claude Code in a Tmux terminal multiplexing session (optional session name)")
|
|
1200
1238
|
.option("-R, --recolor", "wrap Claude Code with ANSI recoloring for improved theming")
|
|
1201
|
-
.option("-A, --ase", "enable ASE-specific
|
|
1239
|
+
.option("-A, --ase", "enable ASE-specific ASE_* environment variables and Tmux settings")
|
|
1202
1240
|
.argument("[args...]", "arguments passed unparsed to Claude Code")
|
|
1203
1241
|
.action((args: string[], opts: TopOpts) => {
|
|
1204
1242
|
actionDefault(opts, args)
|