subconscious-cli 4.0.9 → 4.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -4
- package/bin/cli.js +12 -10
- package/bin/native/subc-tui-darwin-amd64 +0 -0
- package/bin/native/subc-tui-darwin-arm64 +0 -0
- package/bin/native/subc-tui-linux-amd64 +0 -0
- package/bin/native/subc-tui-linux-arm64 +0 -0
- package/bin/native/subc-tui-windows-amd64.exe +0 -0
- package/bin/native/subc-tui-windows-arm64.exe +0 -0
- package/bin/profiles.js +23 -3
- package/bin/runbook/claude-code/install.sh +1 -1
- package/bin/tui.js +6 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -34,11 +34,19 @@ subc <agent> uninstall
|
|
|
34
34
|
Running `subc` with no arguments in a terminal opens the native Go TUI. Use
|
|
35
35
|
the arrow keys and Enter to launch agents or manage the active profile, `p` to
|
|
36
36
|
switch profiles, and `q` to quit. The menu includes dedicated **Create profile**,
|
|
37
|
-
**Set default model**, and **Update base URL** actions.
|
|
38
|
-
are validated and saved to the active profile without
|
|
37
|
+
**Set default model**, **Set subagent model**, and **Update base URL** actions.
|
|
38
|
+
Model and URL changes are validated and saved to the active profile without
|
|
39
|
+
leaving the TUI.
|
|
39
40
|
`subc help` and `subc --help` continue to print script-friendly command help.
|
|
40
41
|
Non-interactive `subc` also prints regular help.
|
|
41
42
|
|
|
43
|
+
Print the installed CLI version without performing an update or gateway check:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
subc --version
|
|
47
|
+
subc -v
|
|
48
|
+
```
|
|
49
|
+
|
|
42
50
|
Every command accepts `help` as a subcommand. These only read the selected
|
|
43
51
|
profile; they do not authenticate, install, configure, or launch anything:
|
|
44
52
|
|
|
@@ -142,6 +150,8 @@ subc config # list every profile and its file path
|
|
|
142
150
|
subc -p staging config create # create a profile with default settings
|
|
143
151
|
subc -p staging config # print that path and env file
|
|
144
152
|
subc -p staging config --model subconscious/glm-5.2
|
|
153
|
+
subc -p staging config --subagent-model subconscious/deepseek-v4-flash-marathon
|
|
154
|
+
subc -p staging config --subagent-model follow-default
|
|
145
155
|
subc config --gateway-url https://gateway.example
|
|
146
156
|
subc config path
|
|
147
157
|
subc config edit # open the selected profile in $VISUAL, $EDITOR, vim, or nano
|
|
@@ -154,8 +164,12 @@ prints that path, then the file (API keys and other secrets redacted). Extra
|
|
|
154
164
|
`KEY=value` lines in the file are passed through to launches and override
|
|
155
165
|
Subconscious-injected defaults; resolved login identity (`GATEWAY_URL`,
|
|
156
166
|
`API_KEY`, `MODEL`) still comes from login, `--model`, and the matching flags.
|
|
157
|
-
In scripts and CI, keep using `subc config --gateway-url`, `--api-key`,
|
|
158
|
-
`--model`.
|
|
167
|
+
In scripts and CI, keep using `subc config --gateway-url`, `--api-key`,
|
|
168
|
+
`--model`, and `--subagent-model`.
|
|
169
|
+
|
|
170
|
+
The subagent setting controls `CLAUDE_CODE_SUBAGENT_MODEL` for Claude Code.
|
|
171
|
+
Use `follow-default` to clear the override so subagents automatically follow
|
|
172
|
+
the profile's default model.
|
|
159
173
|
|
|
160
174
|
Each agent section can hold its own API key. An agent-specific key takes
|
|
161
175
|
precedence over the shared profile key and can be used on its own, so profiles
|
|
@@ -196,6 +210,7 @@ the environment:
|
|
|
196
210
|
```bash
|
|
197
211
|
subc codex --model subconscious/glm-5.2
|
|
198
212
|
subc config --model subconscious/deepseek-v4-flash-marathon
|
|
213
|
+
subc config --subagent-model subconscious/tim-qwen3.6-27b
|
|
199
214
|
export SUBCONSCIOUS_MODEL=subconscious/glm-5.2
|
|
200
215
|
```
|
|
201
216
|
|
package/bin/cli.js
CHANGED
|
@@ -226,13 +226,22 @@ function requireNamedProfile(profile) {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
async function main() {
|
|
229
|
-
const update = await showUpdateNotice();
|
|
230
|
-
if (update?.action === 'updated' || update?.action === 'cancel') return;
|
|
231
|
-
|
|
232
229
|
let parsed = extractProfile(process.argv.slice(2));
|
|
233
230
|
let { args, profileName, profileExplicit } = parsed;
|
|
234
231
|
let command = args[0];
|
|
235
232
|
|
|
233
|
+
// Version output must be fast and reliable even when npm or the gateway is
|
|
234
|
+
// unavailable, so handle it before the automatic update check.
|
|
235
|
+
if (command === '--version' || command === '-v') {
|
|
236
|
+
const pkgPath = new URL('../package.json', import.meta.url);
|
|
237
|
+
const pkg = JSON.parse(await fs.readFile(pkgPath, 'utf-8'));
|
|
238
|
+
console.log(pkg.version);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const update = await showUpdateNotice();
|
|
243
|
+
if (update?.action === 'updated' || update?.action === 'cancel') return;
|
|
244
|
+
|
|
236
245
|
if (!command && process.stdin.isTTY === true && process.stdout.isTTY === true && process.env.TERM !== 'dumb') {
|
|
237
246
|
const selection = await runTui({ profileName });
|
|
238
247
|
if (!selection?.args?.length) return;
|
|
@@ -261,13 +270,6 @@ async function main() {
|
|
|
261
270
|
return;
|
|
262
271
|
}
|
|
263
272
|
|
|
264
|
-
if (command === '--version' || command === '-v') {
|
|
265
|
-
const pkgPath = new URL('../package.json', import.meta.url);
|
|
266
|
-
const pkg = JSON.parse(await fs.readFile(pkgPath, 'utf-8'));
|
|
267
|
-
console.log(pkg.version);
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
273
|
if (command === 'setup') {
|
|
272
274
|
printRetiredSetup(args.slice(1));
|
|
273
275
|
process.exitCode = 1;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/profiles.js
CHANGED
|
@@ -37,6 +37,7 @@ export const RUNBOOK_DEFAULTS = {
|
|
|
37
37
|
GATEWAY_URL: registry.defaults.baseUrl,
|
|
38
38
|
API_KEY: '',
|
|
39
39
|
MODEL: registry.defaults.model,
|
|
40
|
+
CLAUDE_CODE_SUBAGENT_MODEL: '',
|
|
40
41
|
CLAUDE_GATEWAY_URL: '',
|
|
41
42
|
CLAUDE_CODE_API_KEY: '',
|
|
42
43
|
CODEX_API_KEY: '',
|
|
@@ -86,6 +87,13 @@ const SETTINGS = {
|
|
|
86
87
|
type: 'choice',
|
|
87
88
|
choices: SUPPORTED_MODELS,
|
|
88
89
|
},
|
|
90
|
+
CLAUDE_CODE_SUBAGENT_MODEL: {
|
|
91
|
+
key: 'CLAUDE_CODE_SUBAGENT_MODEL',
|
|
92
|
+
label: 'Subagent model',
|
|
93
|
+
description: 'Model used by Claude Code subagents; blank follows the default model.',
|
|
94
|
+
type: 'choice',
|
|
95
|
+
choices: SUPPORTED_MODELS,
|
|
96
|
+
},
|
|
89
97
|
CLAUDE_GATEWAY_URL: {
|
|
90
98
|
key: 'CLAUDE_GATEWAY_URL',
|
|
91
99
|
label: 'Claude gateway override',
|
|
@@ -267,6 +275,7 @@ const AGENT_SETTING_KEYS = {
|
|
|
267
275
|
'claude-code': [
|
|
268
276
|
'CLAUDE_GATEWAY_URL',
|
|
269
277
|
'CLAUDE_CODE_API_KEY',
|
|
278
|
+
'CLAUDE_CODE_SUBAGENT_MODEL',
|
|
270
279
|
'CLAUDE_CODE_AUTO_COMPACT_WINDOW',
|
|
271
280
|
'CLAUDE_CODE_MAX_CONTEXT_TOKENS',
|
|
272
281
|
'MAX_CONCURRENT_SUBAGENTS',
|
|
@@ -346,6 +355,8 @@ DEEPSEEK_HARNESS_API_KEY={DEEPSEEK_HARNESS_API_KEY}
|
|
|
346
355
|
# Claude Code
|
|
347
356
|
# Leave CLAUDE_GATEWAY_URL blank to use GATEWAY_URL above.
|
|
348
357
|
CLAUDE_GATEWAY_URL={CLAUDE_GATEWAY_URL}
|
|
358
|
+
# Leave blank to use MODEL above for Claude Code subagents.
|
|
359
|
+
CLAUDE_CODE_SUBAGENT_MODEL={CLAUDE_CODE_SUBAGENT_MODEL}
|
|
349
360
|
CLAUDE_CODE_AUTO_COMPACT_WINDOW={CLAUDE_CODE_AUTO_COMPACT_WINDOW}
|
|
350
361
|
CLAUDE_CODE_MAX_CONTEXT_TOKENS={CLAUDE_CODE_MAX_CONTEXT_TOKENS}
|
|
351
362
|
MAX_CONCURRENT_SUBAGENTS={MAX_CONCURRENT_SUBAGENTS}
|
|
@@ -680,6 +691,7 @@ Usage:
|
|
|
680
691
|
subc -p NAME config edit [vim|nano]
|
|
681
692
|
subc config [show|path|list|create|delete]
|
|
682
693
|
[--gateway-url URL] [--api-key KEY] [--model MODEL]
|
|
694
|
+
[--subagent-model MODEL|follow-default]
|
|
683
695
|
|
|
684
696
|
subc config List every profile and its file path
|
|
685
697
|
subc -p NAME config Print that profile's path and env file
|
|
@@ -718,15 +730,21 @@ export async function configCommand(argv, profileName = DEFAULT_PROFILE, options
|
|
|
718
730
|
return;
|
|
719
731
|
} else if (['show', 'path', 'list', 'create', 'delete', 'edit', 'interactive'].includes(arg)) {
|
|
720
732
|
action = arg === 'interactive' ? 'edit' : arg;
|
|
721
|
-
} else if (
|
|
733
|
+
} else if (
|
|
734
|
+
arg === '--gateway-url' ||
|
|
735
|
+
arg === '--api-key' ||
|
|
736
|
+
arg === '--model' ||
|
|
737
|
+
arg === '--subagent-model'
|
|
738
|
+
) {
|
|
722
739
|
const value = argv[++i];
|
|
723
740
|
if (!value) throw new Error(`${arg} requires a value`);
|
|
724
741
|
const key = {
|
|
725
742
|
'--gateway-url': 'GATEWAY_URL',
|
|
726
743
|
'--api-key': 'API_KEY',
|
|
727
744
|
'--model': 'MODEL',
|
|
745
|
+
'--subagent-model': 'CLAUDE_CODE_SUBAGENT_MODEL',
|
|
728
746
|
}[arg];
|
|
729
|
-
updates[key] = value;
|
|
747
|
+
updates[key] = arg === '--subagent-model' && value === 'follow-default' ? '' : value;
|
|
730
748
|
} else if (action === 'edit' && ALLOWED_EDITORS.has(arg)) {
|
|
731
749
|
if (editor) throw new Error('Specify only one editor (vim or nano)');
|
|
732
750
|
editor = arg;
|
|
@@ -739,7 +757,9 @@ export async function configCommand(argv, profileName = DEFAULT_PROFILE, options
|
|
|
739
757
|
|
|
740
758
|
if (action === 'edit') {
|
|
741
759
|
if (Object.keys(updates).length) {
|
|
742
|
-
throw new Error(
|
|
760
|
+
throw new Error(
|
|
761
|
+
'config edit cannot be combined with --gateway-url, --api-key, --model, or --subagent-model',
|
|
762
|
+
);
|
|
743
763
|
}
|
|
744
764
|
await editProfile(profileName, editor);
|
|
745
765
|
return;
|
|
@@ -163,7 +163,7 @@ export ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION="${SONNET_MODEL_DESCRIPTION}"
|
|
|
163
163
|
export ANTHROPIC_DEFAULT_HAIKU_MODEL="${HAIKU_MODEL}"
|
|
164
164
|
export ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME="${HAIKU_MODEL_NAME}"
|
|
165
165
|
export ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION="${HAIKU_MODEL_DESCRIPTION}"
|
|
166
|
-
export CLAUDE_CODE_SUBAGENT_MODEL="${MODEL}"
|
|
166
|
+
export CLAUDE_CODE_SUBAGENT_MODEL="${CLAUDE_CODE_SUBAGENT_MODEL:-$MODEL}"
|
|
167
167
|
export CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS="${MAX_CONCURRENT_SUBAGENTS}"
|
|
168
168
|
export CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH="${MAX_SUBAGENT_SPAWN_DEPTH}"
|
|
169
169
|
export CLAUDE_CODE_AUTO_COMPACT_WINDOW="${COMPACT_WINDOW}"
|
package/bin/tui.js
CHANGED
|
@@ -77,6 +77,10 @@ function selectedModelFor(profile) {
|
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
function subagentModelFor(profile) {
|
|
81
|
+
return profile.values.CLAUDE_CODE_SUBAGENT_MODEL?.trim() || '';
|
|
82
|
+
}
|
|
83
|
+
|
|
80
84
|
function gatewayFor(profile) {
|
|
81
85
|
return (
|
|
82
86
|
process.env.SUBCONSCIOUS_BASE_URL?.trim() ||
|
|
@@ -106,6 +110,7 @@ export async function createTuiState(profileName = DEFAULT_PROFILE, options = {}
|
|
|
106
110
|
return {
|
|
107
111
|
name,
|
|
108
112
|
model: selectedModelFor(profile),
|
|
113
|
+
subagentModel: subagentModelFor(profile),
|
|
109
114
|
authenticated: Boolean(auth?.key),
|
|
110
115
|
};
|
|
111
116
|
}),
|
|
@@ -128,6 +133,7 @@ export async function createTuiState(profileName = DEFAULT_PROFILE, options = {}
|
|
|
128
133
|
profiles,
|
|
129
134
|
models: catalog.models,
|
|
130
135
|
selectedModel,
|
|
136
|
+
subagentModel: subagentModelFor(activeProfile),
|
|
131
137
|
gatewayUrl,
|
|
132
138
|
savedGatewayUrl:
|
|
133
139
|
activeProfile.values.GATEWAY_URL?.trim().replace(/\/+$/, '') ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "subconscious-cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.11",
|
|
4
4
|
"description": "CLI for Subconscious — run Claude Code, Codex, OpenCode, DeepSeek Harness, Cursor, Copilot, and Pi",
|
|
5
5
|
"bin": {
|
|
6
6
|
"subc": "bin/cli.js"
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"build:tui:host": "node scripts/build-tui.js --host",
|
|
11
11
|
"test": "node --test",
|
|
12
12
|
"test:tui": "go -C tui test ./...",
|
|
13
|
-
"prepack": "npm run build:tui"
|
|
13
|
+
"prepack": "npm run build:tui",
|
|
14
|
+
"prepublishOnly": "node scripts/require-publish-script.js"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"bin"
|