jbai-cli 1.9.6 → 2.1.0
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/bin/jbai-claude-opus.js +6 -0
- package/bin/jbai-claude-sonnet.js +6 -0
- package/bin/jbai-codex-5.2.js +6 -0
- package/bin/jbai-codex-5.3.js +6 -0
- package/bin/jbai-codex-rockhopper.js +6 -0
- package/bin/jbai-gemini-3.1.js +6 -0
- package/bin/jbai-gemini-supernova.js +6 -0
- package/bin/jbai-opencode-deepseek.js +6 -0
- package/bin/jbai-opencode-grok.js +6 -0
- package/bin/jbai-opencode-rockhopper.js +6 -0
- package/bin/jbai.js +22 -1
- package/lib/completions.js +258 -0
- package/lib/config.js +19 -6
- package/lib/postinstall.js +3 -0
- package/lib/shortcut.js +47 -0
- package/package.json +11 -1
package/bin/jbai.js
CHANGED
|
@@ -9,6 +9,7 @@ const os = require('os');
|
|
|
9
9
|
const config = require('../lib/config');
|
|
10
10
|
const { createHandoff } = require('../lib/handoff');
|
|
11
11
|
const { getGroupsForTool, showModelsForTool } = require('../lib/model-list');
|
|
12
|
+
const completions = require('../lib/completions');
|
|
12
13
|
|
|
13
14
|
const TOOLS = {
|
|
14
15
|
claude: {
|
|
@@ -66,6 +67,9 @@ COMMANDS:
|
|
|
66
67
|
jbai install Install all AI tools (claude, codex, gemini, opencode, goose, continue)
|
|
67
68
|
jbai install claude Install specific tool
|
|
68
69
|
jbai doctor Check which tools are installed
|
|
70
|
+
jbai completions Print zsh completions to stdout
|
|
71
|
+
jbai completions --install Add completions to ~/.zshrc
|
|
72
|
+
jbai completions --bash Print bash completions
|
|
69
73
|
jbai help Show this help
|
|
70
74
|
|
|
71
75
|
PROXY (for Codex Desktop, Cursor, etc.):
|
|
@@ -81,17 +85,31 @@ TOOL WRAPPERS:
|
|
|
81
85
|
jbai-opencode Launch OpenCode with JetBrains AI
|
|
82
86
|
jbai-council Launch Claude + Codex + OpenCode in tmux council mode
|
|
83
87
|
|
|
88
|
+
MODEL SHORTCUTS (super mode by default):
|
|
89
|
+
jbai-claude-opus Claude Code + Opus 4.6
|
|
90
|
+
jbai-claude-sonnet Claude Code + Sonnet 4.6
|
|
91
|
+
jbai-codex-5.3 Codex + GPT-5.3
|
|
92
|
+
jbai-codex-5.2 Codex + GPT-5.2
|
|
93
|
+
jbai-codex-rockhopper Codex + Rockhopper Alpha (OpenAI EAP)
|
|
94
|
+
jbai-gemini-supernova Gemini + Supernova (Google EAP)
|
|
95
|
+
jbai-gemini-3.1 Gemini + 3.1 Pro Preview
|
|
96
|
+
jbai-opencode-rockhopper OpenCode + Rockhopper Alpha
|
|
97
|
+
jbai-opencode-grok OpenCode + Grok 4 (xAI)
|
|
98
|
+
jbai-opencode-deepseek OpenCode + DeepSeek R1
|
|
99
|
+
|
|
84
100
|
SUPER MODE:
|
|
85
101
|
Add --super (or --yolo or -s) to skip confirmations:
|
|
86
102
|
jbai-claude --super # Skip permission prompts
|
|
87
103
|
jbai-codex --super # Full auto mode
|
|
88
104
|
jbai-gemini --super # Auto-confirm changes
|
|
105
|
+
(All model shortcuts above run in super mode by default)
|
|
89
106
|
|
|
90
107
|
EXAMPLES:
|
|
91
108
|
jbai token set # Set your token
|
|
92
109
|
jbai-claude # Start Claude Code
|
|
93
110
|
jbai-codex exec "explain code" # Run Codex task
|
|
94
|
-
jbai-
|
|
111
|
+
jbai-codex-rockhopper # Codex with Rockhopper (super mode)
|
|
112
|
+
jbai-gemini-supernova # Gemini with Supernova (super mode)
|
|
95
113
|
jbai-council # Launch all 3 agents in tmux
|
|
96
114
|
jbai-council --super # All agents in super mode
|
|
97
115
|
jbai handoff --task "fix lint" # Handoff task to Orca Lab
|
|
@@ -688,6 +706,9 @@ switch (command) {
|
|
|
688
706
|
proxyMod.main();
|
|
689
707
|
break;
|
|
690
708
|
}
|
|
709
|
+
case 'completions':
|
|
710
|
+
completions.run(args);
|
|
711
|
+
break;
|
|
691
712
|
case 'help':
|
|
692
713
|
case '--help':
|
|
693
714
|
case '-h':
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell completions for jbai-cli.
|
|
3
|
+
*
|
|
4
|
+
* `jbai completions` — print zsh completion script to stdout
|
|
5
|
+
* `jbai completions --install` — append source line to ~/.zshrc
|
|
6
|
+
* `jbai completions --bash` — print bash completion script to stdout
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const os = require('os');
|
|
12
|
+
const config = require('./config');
|
|
13
|
+
|
|
14
|
+
// Read bin entries from package.json for the canonical list of commands.
|
|
15
|
+
const pkg = require('../package.json');
|
|
16
|
+
const ALL_BINS = Object.keys(pkg.bin).sort();
|
|
17
|
+
|
|
18
|
+
// Shortcuts = bins that have a dash after the tool name (jbai-codex-5.3, etc.)
|
|
19
|
+
const TOOLS = ['claude', 'codex', 'gemini', 'opencode', 'goose', 'continue', 'council', 'proxy'];
|
|
20
|
+
|
|
21
|
+
// jbai subcommands
|
|
22
|
+
const JBAI_SUBCOMMANDS = [
|
|
23
|
+
'token', 'test', 'handoff', 'env', 'models', 'install', 'doctor',
|
|
24
|
+
'status', 'proxy', 'help', 'version', 'completions',
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
const JBAI_TOKEN_SUBCOMMANDS = ['set', 'refresh'];
|
|
28
|
+
const JBAI_ENV_VALUES = ['staging', 'production'];
|
|
29
|
+
const JBAI_MODELS_VALUES = ['all', 'claude', 'codex', 'gemini', 'opencode', 'goose', 'continue'];
|
|
30
|
+
const JBAI_INSTALL_VALUES = ['all', 'claude', 'codex', 'gemini', 'opencode', 'goose', 'continue'];
|
|
31
|
+
const SUPER_FLAGS = ['--super', '--yolo', '-s'];
|
|
32
|
+
const COMMON_FLAGS = ['--model', '--models', '--help'];
|
|
33
|
+
|
|
34
|
+
// Collect all model names for --model completion
|
|
35
|
+
const ALL_MODELS = [
|
|
36
|
+
...config.MODELS.claude.available,
|
|
37
|
+
...config.MODELS.openai.available,
|
|
38
|
+
...config.MODELS.codex.available,
|
|
39
|
+
...config.MODELS.gemini.available,
|
|
40
|
+
...config.MODELS.grazie.available,
|
|
41
|
+
];
|
|
42
|
+
// Dedupe
|
|
43
|
+
const UNIQUE_MODELS = [...new Set(ALL_MODELS)].sort();
|
|
44
|
+
|
|
45
|
+
function generateZsh() {
|
|
46
|
+
// Group shortcuts by tool for descriptive completions
|
|
47
|
+
const shortcutDescriptions = {};
|
|
48
|
+
for (const bin of ALL_BINS) {
|
|
49
|
+
if (bin === 'jbai' || bin === 'jbai-proxy') continue;
|
|
50
|
+
// e.g. jbai-codex-rockhopper -> "Codex + Rockhopper Alpha"
|
|
51
|
+
shortcutDescriptions[bin] = bin;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return `#compdef jbai jbai-claude jbai-codex jbai-gemini jbai-opencode jbai-goose jbai-continue jbai-council jbai-proxy jbai-claude-opus jbai-claude-sonnet jbai-codex-5.2 jbai-codex-5.3 jbai-codex-rockhopper jbai-gemini-3.1 jbai-gemini-supernova jbai-opencode-rockhopper jbai-opencode-grok jbai-opencode-deepseek
|
|
55
|
+
# ─── jbai-cli zsh completions (auto-generated) ───
|
|
56
|
+
|
|
57
|
+
# Complete model names after --model flag
|
|
58
|
+
_jbai_models() {
|
|
59
|
+
local models=(
|
|
60
|
+
${UNIQUE_MODELS.map(m => ` '${m}'`).join('\n')}
|
|
61
|
+
)
|
|
62
|
+
_describe 'model' models
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
# Main jbai command completions
|
|
66
|
+
_jbai() {
|
|
67
|
+
local -a subcommands=(
|
|
68
|
+
'token:Show or manage authentication token'
|
|
69
|
+
'test:Test API endpoints'
|
|
70
|
+
'handoff:Continue task in Orca Lab'
|
|
71
|
+
'env:Switch environment (staging/production)'
|
|
72
|
+
'models:List available models'
|
|
73
|
+
'install:Install AI tools'
|
|
74
|
+
'doctor:Check installed tools'
|
|
75
|
+
'status:Check installed tools'
|
|
76
|
+
'proxy:Manage local proxy'
|
|
77
|
+
'help:Show help'
|
|
78
|
+
'version:Show version'
|
|
79
|
+
'completions:Shell completions'
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
if (( CURRENT == 2 )); then
|
|
83
|
+
_describe 'command' subcommands
|
|
84
|
+
return
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
case "\${words[2]}" in
|
|
88
|
+
token)
|
|
89
|
+
if (( CURRENT == 3 )); then
|
|
90
|
+
local -a token_cmds=('set:Set token interactively' 'refresh:Refresh token via API')
|
|
91
|
+
_describe 'token command' token_cmds
|
|
92
|
+
fi
|
|
93
|
+
;;
|
|
94
|
+
env)
|
|
95
|
+
if (( CURRENT == 3 )); then
|
|
96
|
+
local -a envs=('staging' 'production')
|
|
97
|
+
_describe 'environment' envs
|
|
98
|
+
fi
|
|
99
|
+
;;
|
|
100
|
+
models)
|
|
101
|
+
if (( CURRENT == 3 )); then
|
|
102
|
+
local -a tools=(${JBAI_MODELS_VALUES.map(v => `'${v}'`).join(' ')})
|
|
103
|
+
_describe 'tool filter' tools
|
|
104
|
+
fi
|
|
105
|
+
;;
|
|
106
|
+
install)
|
|
107
|
+
if (( CURRENT == 3 )); then
|
|
108
|
+
local -a tools=(${JBAI_INSTALL_VALUES.map(v => `'${v}'`).join(' ')})
|
|
109
|
+
_describe 'tool' tools
|
|
110
|
+
fi
|
|
111
|
+
;;
|
|
112
|
+
completions)
|
|
113
|
+
if (( CURRENT == 3 )); then
|
|
114
|
+
local -a opts=('--install:Add to ~/.zshrc' '--bash:Print bash completions')
|
|
115
|
+
_describe 'option' opts
|
|
116
|
+
fi
|
|
117
|
+
;;
|
|
118
|
+
esac
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
# Tool wrapper completions (jbai-claude, jbai-codex, etc.)
|
|
122
|
+
_jbai_tool_wrapper() {
|
|
123
|
+
_arguments -s \\
|
|
124
|
+
'--model[Model to use]:model:_jbai_models' \\
|
|
125
|
+
'-m[Model to use]:model:_jbai_models' \\
|
|
126
|
+
'--super[Enable super/auto mode]' \\
|
|
127
|
+
'--yolo[Enable super/auto mode]' \\
|
|
128
|
+
'-s[Enable super/auto mode]' \\
|
|
129
|
+
'--models[List available models]' \\
|
|
130
|
+
'--list-models[List available models]' \\
|
|
131
|
+
'--help[Show help]' \\
|
|
132
|
+
'models:List available models' \\
|
|
133
|
+
'*:pass-through:'
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
# Register completions
|
|
137
|
+
compdef _jbai jbai
|
|
138
|
+
compdef _jbai_tool_wrapper jbai-claude jbai-codex jbai-gemini jbai-opencode jbai-goose jbai-continue
|
|
139
|
+
compdef _jbai_tool_wrapper jbai-claude-opus jbai-claude-sonnet
|
|
140
|
+
compdef _jbai_tool_wrapper jbai-codex-5.2 jbai-codex-5.3 jbai-codex-rockhopper
|
|
141
|
+
compdef _jbai_tool_wrapper jbai-gemini-3.1 jbai-gemini-supernova
|
|
142
|
+
compdef _jbai_tool_wrapper jbai-opencode-rockhopper jbai-opencode-grok jbai-opencode-deepseek
|
|
143
|
+
`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function generateBash() {
|
|
147
|
+
return `# ─── jbai-cli bash completions (auto-generated) ───
|
|
148
|
+
|
|
149
|
+
_jbai_completions() {
|
|
150
|
+
local cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
151
|
+
local prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
152
|
+
|
|
153
|
+
# jbai subcommands
|
|
154
|
+
if [[ "\${COMP_WORDS[0]}" == "jbai" && \${COMP_CWORD} -eq 1 ]]; then
|
|
155
|
+
COMPREPLY=( $(compgen -W "${JBAI_SUBCOMMANDS.join(' ')}" -- "$cur") )
|
|
156
|
+
return
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
# jbai token <sub>
|
|
160
|
+
if [[ "\${COMP_WORDS[1]}" == "token" && \${COMP_CWORD} -eq 2 ]]; then
|
|
161
|
+
COMPREPLY=( $(compgen -W "${JBAI_TOKEN_SUBCOMMANDS.join(' ')}" -- "$cur") )
|
|
162
|
+
return
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
# jbai env <value>
|
|
166
|
+
if [[ "\${COMP_WORDS[1]}" == "env" && \${COMP_CWORD} -eq 2 ]]; then
|
|
167
|
+
COMPREPLY=( $(compgen -W "${JBAI_ENV_VALUES.join(' ')}" -- "$cur") )
|
|
168
|
+
return
|
|
169
|
+
fi
|
|
170
|
+
|
|
171
|
+
# jbai models <value>
|
|
172
|
+
if [[ "\${COMP_WORDS[1]}" == "models" && \${COMP_CWORD} -eq 2 ]]; then
|
|
173
|
+
COMPREPLY=( $(compgen -W "${JBAI_MODELS_VALUES.join(' ')}" -- "$cur") )
|
|
174
|
+
return
|
|
175
|
+
fi
|
|
176
|
+
|
|
177
|
+
# jbai install <value>
|
|
178
|
+
if [[ "\${COMP_WORDS[1]}" == "install" && \${COMP_CWORD} -eq 2 ]]; then
|
|
179
|
+
COMPREPLY=( $(compgen -W "${JBAI_INSTALL_VALUES.join(' ')}" -- "$cur") )
|
|
180
|
+
return
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
# --model completion
|
|
184
|
+
if [[ "$prev" == "--model" || "$prev" == "-m" ]]; then
|
|
185
|
+
COMPREPLY=( $(compgen -W "${UNIQUE_MODELS.join(' ')}" -- "$cur") )
|
|
186
|
+
return
|
|
187
|
+
fi
|
|
188
|
+
|
|
189
|
+
# Generic flags for tool wrappers
|
|
190
|
+
COMPREPLY=( $(compgen -W "--model --super --yolo --models --help models" -- "$cur") )
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
_jbai_tool_completions() {
|
|
194
|
+
local cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
195
|
+
local prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
196
|
+
|
|
197
|
+
if [[ "$prev" == "--model" || "$prev" == "-m" ]]; then
|
|
198
|
+
COMPREPLY=( $(compgen -W "${UNIQUE_MODELS.join(' ')}" -- "$cur") )
|
|
199
|
+
return
|
|
200
|
+
fi
|
|
201
|
+
|
|
202
|
+
COMPREPLY=( $(compgen -W "--model --super --yolo --models --help models" -- "$cur") )
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
complete -F _jbai_completions jbai
|
|
206
|
+
complete -F _jbai_tool_completions jbai-claude jbai-codex jbai-gemini jbai-opencode jbai-goose jbai-continue
|
|
207
|
+
complete -F _jbai_tool_completions jbai-claude-opus jbai-claude-sonnet
|
|
208
|
+
complete -F _jbai_tool_completions jbai-codex-5.2 jbai-codex-5.3 jbai-codex-rockhopper
|
|
209
|
+
complete -F _jbai_tool_completions jbai-gemini-3.1 jbai-gemini-supernova
|
|
210
|
+
complete -F _jbai_tool_completions jbai-opencode-rockhopper jbai-opencode-grok jbai-opencode-deepseek
|
|
211
|
+
`;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function getCompletionFilePath() {
|
|
215
|
+
return path.join(config.CONFIG_DIR, 'completions.zsh');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function installZsh() {
|
|
219
|
+
const completionFile = getCompletionFilePath();
|
|
220
|
+
const zshrc = path.join(os.homedir(), '.zshrc');
|
|
221
|
+
|
|
222
|
+
// Write completion file
|
|
223
|
+
config.ensureConfigDir();
|
|
224
|
+
fs.writeFileSync(completionFile, generateZsh(), { mode: 0o644 });
|
|
225
|
+
console.log(`Written: ${completionFile}`);
|
|
226
|
+
|
|
227
|
+
// Check if already sourced in .zshrc
|
|
228
|
+
const sourceLine = `[ -f "${completionFile}" ] && source "${completionFile}"`;
|
|
229
|
+
|
|
230
|
+
if (fs.existsSync(zshrc)) {
|
|
231
|
+
const content = fs.readFileSync(zshrc, 'utf-8');
|
|
232
|
+
if (content.includes('jbai') && content.includes('completions.zsh')) {
|
|
233
|
+
console.log('Already in ~/.zshrc — updating completion file only');
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
fs.appendFileSync(zshrc, `\n# jbai-cli completions\n${sourceLine}\n`);
|
|
239
|
+
console.log('Added to ~/.zshrc');
|
|
240
|
+
console.log('\nRun: source ~/.zshrc (or open a new terminal)');
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function run(args) {
|
|
244
|
+
if (args.includes('--install')) {
|
|
245
|
+
installZsh();
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (args.includes('--bash')) {
|
|
250
|
+
process.stdout.write(generateBash());
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Default: print zsh completions to stdout
|
|
255
|
+
process.stdout.write(generateZsh());
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
module.exports = { run, generateZsh, generateBash, installZsh, getCompletionFilePath };
|
package/lib/config.js
CHANGED
|
@@ -35,6 +35,7 @@ const MODELS = {
|
|
|
35
35
|
available: [
|
|
36
36
|
// Claude 4.6 series (latest)
|
|
37
37
|
'claude-opus-4-6',
|
|
38
|
+
'claude-sonnet-4-6',
|
|
38
39
|
// Claude 4.5 series
|
|
39
40
|
'claude-opus-4-5-20251101',
|
|
40
41
|
'claude-sonnet-4-5-20250929',
|
|
@@ -83,9 +84,11 @@ const MODELS = {
|
|
|
83
84
|
codex: {
|
|
84
85
|
default: 'gpt-5.3-codex',
|
|
85
86
|
available: [
|
|
87
|
+
// Hidden/EAP models (JB internal NDA)
|
|
88
|
+
'rockhopper-alpha',
|
|
89
|
+
'gpt-5.3-codex-api-preview',
|
|
86
90
|
// Codex-specific models (responses API only, NOT available via chat/completions)
|
|
87
91
|
'gpt-5.3-codex',
|
|
88
|
-
'gpt-5.3-codex-api-preview',
|
|
89
92
|
// GPT-5.x chat models (also work via responses API)
|
|
90
93
|
'gpt-5.2-2025-12-11',
|
|
91
94
|
'gpt-5.2',
|
|
@@ -105,6 +108,9 @@ const MODELS = {
|
|
|
105
108
|
gemini: {
|
|
106
109
|
default: 'gemini-2.5-flash',
|
|
107
110
|
available: [
|
|
111
|
+
// Hidden/EAP models (JB internal NDA)
|
|
112
|
+
'supernova',
|
|
113
|
+
'gemini-3.1-pro-preview',
|
|
108
114
|
// Gemini 3.x (preview)
|
|
109
115
|
'gemini-3-pro-preview',
|
|
110
116
|
'gemini-3-flash-preview',
|
|
@@ -125,24 +131,31 @@ const MODELS = {
|
|
|
125
131
|
// Google
|
|
126
132
|
'google-gemini-3-1-pro',
|
|
127
133
|
'google-gemini-3-0-flash',
|
|
134
|
+
'google-gemini-3-0-pro-snowball',
|
|
128
135
|
'google-chat-gemini-pro-2.5',
|
|
129
136
|
'google-gemini-2.5-flash',
|
|
130
137
|
// DeepSeek
|
|
131
138
|
'deepseek-r1',
|
|
132
|
-
'deepseek-
|
|
139
|
+
'openrouter-deepseek-v3-2',
|
|
133
140
|
// Mistral
|
|
134
141
|
'mistral-large',
|
|
135
142
|
'mistral-small',
|
|
143
|
+
'openrouter-mistral-large-2512',
|
|
136
144
|
// xAI / Grok
|
|
137
145
|
'xai-grok-4',
|
|
138
146
|
'xai-grok-4-1-fast',
|
|
139
|
-
'xai-grok-
|
|
147
|
+
'xai-grok-code-fast-1',
|
|
140
148
|
// Qwen
|
|
141
149
|
'qwen-max',
|
|
142
150
|
'qwen-plus',
|
|
143
|
-
//
|
|
144
|
-
'openrouter-
|
|
145
|
-
'openrouter-
|
|
151
|
+
// Kimi
|
|
152
|
+
'openrouter-kimi-k2-5',
|
|
153
|
+
'openrouter-kimi-k2-thinking',
|
|
154
|
+
// MiniMax
|
|
155
|
+
'openrouter-minimax-m2-1',
|
|
156
|
+
// ZhipuAI
|
|
157
|
+
'openrouter-zhipuai-glm-4-7',
|
|
158
|
+
'openrouter-zhipuai-glm-4-7-flash',
|
|
146
159
|
]
|
|
147
160
|
}
|
|
148
161
|
};
|
package/lib/postinstall.js
CHANGED
package/lib/shortcut.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared logic for per-model shortcut scripts.
|
|
3
|
+
*
|
|
4
|
+
* Each shortcut (e.g. jbai-codex-rockhopper) is a thin wrapper that calls
|
|
5
|
+
* the base tool wrapper (jbai-codex, jbai-claude, …) with a fixed model
|
|
6
|
+
* and super mode enabled by default.
|
|
7
|
+
*
|
|
8
|
+
* Usage in a shortcut script:
|
|
9
|
+
* require('../lib/shortcut').run({
|
|
10
|
+
* tool: 'codex', // base wrapper to delegate to
|
|
11
|
+
* model: 'rockhopper-alpha',
|
|
12
|
+
* label: 'Rockhopper Alpha',
|
|
13
|
+
* });
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const { spawn } = require('child_process');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
|
|
19
|
+
function run({ tool, model, label }) {
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
|
|
22
|
+
// Already force super mode + the pinned model
|
|
23
|
+
const extraArgs = ['--super', '--model', model];
|
|
24
|
+
|
|
25
|
+
// If user already passed --model, skip our default
|
|
26
|
+
if (args.includes('--model') || args.includes('-m')) {
|
|
27
|
+
extraArgs.splice(extraArgs.indexOf('--model'), 2);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const wrapperScript = path.join(__dirname, '..', 'bin', `jbai-${tool}.js`);
|
|
31
|
+
const finalArgs = [wrapperScript, ...extraArgs, ...args];
|
|
32
|
+
|
|
33
|
+
console.log(`⚡ ${label || model} (super mode)`);
|
|
34
|
+
|
|
35
|
+
const child = spawn(process.execPath, finalArgs, {
|
|
36
|
+
stdio: 'inherit',
|
|
37
|
+
env: process.env,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
child.on('exit', (code) => process.exit(code || 0));
|
|
41
|
+
child.on('error', (err) => {
|
|
42
|
+
console.error(`Error: ${err.message}`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = { run };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jbai-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "CLI wrappers to use AI coding tools (Claude Code, Codex, Gemini CLI, OpenCode, Goose, Continue) with JetBrains AI Platform",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jetbrains",
|
|
@@ -30,9 +30,19 @@
|
|
|
30
30
|
"jbai": "bin/jbai.js",
|
|
31
31
|
"jbai-proxy": "bin/jbai-proxy.js",
|
|
32
32
|
"jbai-claude": "bin/jbai-claude.js",
|
|
33
|
+
"jbai-claude-opus": "bin/jbai-claude-opus.js",
|
|
34
|
+
"jbai-claude-sonnet": "bin/jbai-claude-sonnet.js",
|
|
33
35
|
"jbai-codex": "bin/jbai-codex.js",
|
|
36
|
+
"jbai-codex-5.2": "bin/jbai-codex-5.2.js",
|
|
37
|
+
"jbai-codex-5.3": "bin/jbai-codex-5.3.js",
|
|
38
|
+
"jbai-codex-rockhopper": "bin/jbai-codex-rockhopper.js",
|
|
34
39
|
"jbai-gemini": "bin/jbai-gemini.js",
|
|
40
|
+
"jbai-gemini-3.1": "bin/jbai-gemini-3.1.js",
|
|
41
|
+
"jbai-gemini-supernova": "bin/jbai-gemini-supernova.js",
|
|
35
42
|
"jbai-opencode": "bin/jbai-opencode.js",
|
|
43
|
+
"jbai-opencode-rockhopper": "bin/jbai-opencode-rockhopper.js",
|
|
44
|
+
"jbai-opencode-grok": "bin/jbai-opencode-grok.js",
|
|
45
|
+
"jbai-opencode-deepseek": "bin/jbai-opencode-deepseek.js",
|
|
36
46
|
"jbai-goose": "bin/jbai-goose.js",
|
|
37
47
|
"jbai-continue": "bin/jbai-continue.js",
|
|
38
48
|
"jbai-council": "bin/jbai-council.js"
|