jbai-cli 1.2.4 → 1.2.5

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.
@@ -33,11 +33,14 @@ if (superMode) {
33
33
  }
34
34
 
35
35
  // Set environment for Claude Code
36
- // Only set API_KEY (not AUTH_TOKEN) to avoid conflicts
36
+ // Use ANTHROPIC_CUSTOM_HEADERS for the Grazie auth header
37
+ // Remove /v1 from endpoint - Claude Code adds it automatically
38
+ const baseUrl = endpoints.anthropic.replace(/\/v1$/, '');
37
39
  const env = {
38
40
  ...process.env,
39
- ANTHROPIC_BASE_URL: endpoints.anthropic,
40
- ANTHROPIC_API_KEY: token
41
+ ANTHROPIC_BASE_URL: baseUrl,
42
+ ANTHROPIC_API_KEY: 'placeholder',
43
+ ANTHROPIC_CUSTOM_HEADERS: `Grazie-Authenticate-JWT: ${token}`
41
44
  };
42
45
 
43
46
  // Remove any existing auth token that might conflict
@@ -55,11 +55,13 @@ if (!opencodeConfig.provider) {
55
55
  const envVarName = environment === 'staging' ? 'GRAZIE_STAGING_TOKEN' : 'GRAZIE_API_TOKEN';
56
56
 
57
57
  // Add/update JetBrains provider with custom header (using env var reference)
58
+ // Remove /v1 from endpoint - SDK adds it automatically
59
+ const baseUrl = endpoints.anthropic.replace(/\/v1$/, '');
58
60
  opencodeConfig.provider[providerName] = {
59
61
  npm: '@ai-sdk/anthropic',
60
62
  name: `JetBrains AI (${environment})`,
61
63
  options: {
62
- baseURL: endpoints.anthropic,
64
+ baseURL: baseUrl,
63
65
  apiKey: `{env:${envVarName}}`,
64
66
  headers: {
65
67
  'Grazie-Authenticate-JWT': `{env:${envVarName}}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jbai-cli",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "CLI wrappers to use AI coding tools (Claude Code, Codex, Aider, OpenCode) with JetBrains AI Platform",
5
5
  "keywords": [
6
6
  "jetbrains",