claudmax 1.0.6 → 1.0.9

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.
Files changed (2) hide show
  1. package/index.js +14 -49
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -231,48 +231,12 @@ function configureSystem(apiKey) {
231
231
  apiKey,
232
232
  baseUrl: API_BASE,
233
233
  configuredAt: new Date().toISOString(),
234
- version: '1.0.5',
234
+ version: '1.0.9',
235
235
  });
236
236
  console.log(` ${CHECK} Saved config to ${C.magenta(CONFIG_FILE)}`);
237
+ console.log(` ${INFO} ${C.dim('Claude Code CLI uses settings.json — no shell profile modification needed.')}`);
237
238
 
238
- // 2. Write environment variables to shell profile
239
- const profile = getShellProfile();
240
-
241
- // Remove any existing ClaudMax/OpusCode/OpusMax blocks first
242
- const existing = fs.existsSync(profile) ? fs.readFileSync(profile, 'utf8') : '';
243
- let cleaned = existing
244
- .split('\n')
245
- .filter(line => {
246
- const trimmed = line.trim();
247
- return (
248
- !trimmed.startsWith('# ClaudMax') &&
249
- !trimmed.startsWith('export ANTHROPIC_API_KEY=') &&
250
- !trimmed.startsWith('export ANTHROPIC_BASE_URL=') &&
251
- !trimmed.startsWith('export OPUSCODE') &&
252
- !trimmed.startsWith('export OPUSMAX') &&
253
- !trimmed.startsWith('# OpusCode') &&
254
- !trimmed.startsWith('# OpusMax')
255
- );
256
- })
257
- .join('\n');
258
-
259
- const envBlock = [
260
- '# ClaudMax Configuration',
261
- `export ANTHROPIC_API_KEY="${apiKey}"`,
262
- `export ANTHROPIC_BASE_URL="${API_BASE}/v1/messages"`,
263
- '',
264
- ].join('\n');
265
-
266
- const newContent = cleaned.trimEnd() + '\n' + envBlock;
267
- fs.writeFileSync(profile, newContent);
268
- console.log(` ${CHECK} Updated environment variables in ${C.magenta(profile)}`);
269
- console.log(` ${INFO} ${C.dim('Run: source ' + profile + ' or restart your terminal')}`);
270
-
271
- // Set for current process too
272
- process.env.ANTHROPIC_API_KEY = apiKey;
273
- process.env.ANTHROPIC_BASE_URL = `${API_BASE}/v1/messages`;
274
-
275
- return profile;
239
+ return null;
276
240
  }
277
241
 
278
242
  // ── Claude Code CLI configuration ─────────────────────────────────────────────
@@ -284,19 +248,20 @@ function configureClaudeCLI(apiKey) {
284
248
 
285
249
  ensureDir(path.dirname(settingsPath));
286
250
 
287
- // settings.json — start fresh to override OpusCode settings
288
- const settings = {
251
+ // settings.json — use deepMerge to preserve OpusCode settings
252
+ const existing = readJson(settingsPath) || {};
253
+ const settings = deepMerge(existing, {
289
254
  env: {
290
255
  ANTHROPIC_AUTH_TOKEN: apiKey,
291
256
  ANTHROPIC_BASE_URL: `${API_BASE}/v1/messages`,
292
- ANTHROPIC_MODEL: 'claude-opus-4-6',
293
- ANTHROPIC_SMALL_FAST_MODEL: 'claude-haiku-4-5-20251001',
294
- ANTHROPIC_DEFAULT_SONNET_MODEL: 'claude-sonnet-4-6',
295
- ANTHROPIC_DEFAULT_OPUS_MODEL: 'claude-opus-4-6',
296
- ANTHROPIC_DEFAULT_HAIKU_MODEL: 'claude-haiku-4-5-20251001',
257
+ ANTHROPIC_MODEL: 'Opus 4.6',
258
+ ANTHROPIC_SMALL_FAST_MODEL: 'Haiku 4.5',
259
+ ANTHROPIC_DEFAULT_SONNET_MODEL: 'Sonnet 4.5',
260
+ ANTHROPIC_DEFAULT_OPUS_MODEL: 'Opus 4.6',
261
+ ANTHROPIC_DEFAULT_HAIKU_MODEL: 'Haiku 4.5',
297
262
  },
298
263
  hasCompletedOnboarding: true,
299
- };
264
+ });
300
265
  writeJson(settingsPath, settings);
301
266
  console.log(` ${CHECK} Wrote Claude Code settings: ${C.magenta(settingsPath)}`);
302
267
 
@@ -412,7 +377,7 @@ function installMCPServer() {
412
377
  return true;
413
378
  } catch (err) {
414
379
  const errMsg = String(err.stderr || err.message || '');
415
- console.log(` ${WARN} Could not install ${MCP_PKG}: ${C.dim(errMsg.trim())}`);
380
+ console.log(` ${WARN} Could not install ${MCP_PKG}: ${C.dim(String(errMsg).trim())}`);
416
381
  console.log(` ${INFO} Install manually later: ${C.bold('npm install -g ' + MCP_PKG)}`);
417
382
  return false;
418
383
  }
@@ -580,7 +545,7 @@ async function main() {
580
545
  console.log('');
581
546
 
582
547
  // ── Configure system ──────────────────────────────────────────────────────
583
- const profile = configureSystem(apiKey);
548
+ configureSystem(apiKey);
584
549
 
585
550
  // ── Step 2: IDE selection ─────────────────────────────────────────────────
586
551
  console.log(C.bold('Step 2: Select IDEs to configure\n'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudmax",
3
- "version": "1.0.6",
3
+ "version": "1.0.9",
4
4
  "description": "ClaudMax CLI — Configure Claude Code, Cursor, Windsurf, Cline, and Roo Code to use ClaudMax API gateway with one command",
5
5
  "main": "index.js",
6
6
  "bin": {