jbai-cli 1.3.0 → 1.3.1

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 CHANGED
@@ -89,8 +89,8 @@ jbai-aider --super
89
89
  | Claude Code | `--dangerously-skip-permissions` |
90
90
  | Codex | `--full-auto` |
91
91
  | Aider | `--yes` |
92
- | Gemini CLI | `--yes` |
93
- | OpenCode | `--yes` |
92
+ | Gemini CLI | `--yolo` |
93
+ | OpenCode | N/A (run mode is already non-interactive) |
94
94
 
95
95
  ⚠️ **Use with caution** - super mode allows the AI to make changes without confirmation.
96
96
 
package/bin/jbai-aider.js CHANGED
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { spawn } = require('child_process');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const os = require('os');
7
+ const yaml = require('yaml');
4
8
  const config = require('../lib/config');
5
9
 
6
10
  const token = config.getToken();
@@ -15,6 +19,7 @@ if (config.isTokenExpired(token)) {
15
19
  }
16
20
 
17
21
  const endpoints = config.getEndpoints();
22
+ const environment = config.getEnvironment();
18
23
  let args = process.argv.slice(2);
19
24
 
20
25
  // Check for super mode (--super, --yolo, -s)
@@ -22,12 +27,39 @@ const superFlags = ['--super', '--yolo', '-s'];
22
27
  const superMode = args.some(a => superFlags.includes(a));
23
28
  args = args.filter(a => !superFlags.includes(a));
24
29
 
30
+ // Create model settings file with extra headers for JetBrains authentication
31
+ const configDir = path.join(os.homedir(), '.jbai');
32
+ const modelSettingsFile = path.join(configDir, 'aider-model-settings.yml');
33
+
34
+ // Ensure config directory exists
35
+ if (!fs.existsSync(configDir)) {
36
+ fs.mkdirSync(configDir, { recursive: true, mode: 0o700 });
37
+ }
38
+
39
+ // Create model settings with extra_headers for authentication
40
+ // Use aider/extra_params for global settings that apply to all models
41
+ const modelSettings = [
42
+ {
43
+ name: 'aider/extra_params',
44
+ extra_params: {
45
+ extra_headers: {
46
+ 'Grazie-Authenticate-JWT': token
47
+ }
48
+ }
49
+ }
50
+ ];
51
+
52
+ // Write model settings file
53
+ fs.writeFileSync(modelSettingsFile, yaml.stringify(modelSettings), { mode: 0o600 });
54
+
25
55
  // Build aider arguments
56
+ // Note: --no-stream is required because JetBrains proxy has stream_options issues
26
57
  const hasModel = args.includes('--model');
27
58
  const aiderArgs = [
28
59
  '--openai-api-base', endpoints.openai,
29
60
  '--openai-api-key', 'placeholder',
30
- '--extra-headers', JSON.stringify({ 'Grazie-Authenticate-JWT': token })
61
+ '--model-settings-file', modelSettingsFile,
62
+ '--no-stream'
31
63
  ];
32
64
 
33
65
  if (!hasModel) {
@@ -32,10 +32,10 @@ args = args.filter(a => !superFlags.includes(a));
32
32
  const hasModel = args.includes('--model') || args.includes('-m');
33
33
  let finalArgs = hasModel ? args : ['--model', config.MODELS.gemini.default, ...args];
34
34
 
35
- // Add super mode flags (auto-confirm)
35
+ // Add super mode flags (auto-confirm) - Gemini uses --yolo
36
36
  if (superMode) {
37
- finalArgs = ['--yes', ...finalArgs];
38
- console.log('🚀 Super mode: --yes (auto-confirm) enabled');
37
+ finalArgs = ['--yolo', ...finalArgs];
38
+ console.log('🚀 Super mode: --yolo (auto-confirm) enabled');
39
39
  }
40
40
 
41
41
  // Set environment for Gemini CLI
@@ -94,10 +94,9 @@ if (!hasModel) {
94
94
  finalArgs.push('--model', `${providerName}/${config.MODELS.openai.default}`);
95
95
  }
96
96
 
97
- // Add super mode flags
97
+ // Note: OpenCode run is already non-interactive, no super mode needed
98
98
  if (superMode) {
99
- finalArgs.push('--yes');
100
- console.log('🚀 Super mode: --yes (auto-confirm) enabled');
99
+ console.log('ℹ️ OpenCode run is already non-interactive (no super mode flag needed)');
101
100
  }
102
101
 
103
102
  finalArgs.push(...args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jbai-cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "CLI wrappers to use AI coding tools (Claude Code, Codex, Aider, Gemini CLI, OpenCode) with JetBrains AI Platform",
5
5
  "keywords": [
6
6
  "jetbrains",
@@ -41,6 +41,9 @@
41
41
  "engines": {
42
42
  "node": ">=18.0.0"
43
43
  },
44
+ "dependencies": {
45
+ "yaml": "^2.7.1"
46
+ },
44
47
  "scripts": {
45
48
  "postinstall": "node lib/postinstall.js",
46
49
  "test": "node bin/jbai.js test"