klaudiak 2.1.89 → 2.1.91

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/klaudiak.js CHANGED
@@ -175,21 +175,35 @@ function printUsage() {
175
175
  'Klaudia Kode CLI',
176
176
  '',
177
177
  'Usage:',
178
- ' klaudiak',
179
- ' klaudiak --profile=<name>',
180
- ' klaudiak --port=<port>',
178
+ ' klaudiak [agentArgs...]',
179
+ ' klaudiak [agentArgs...] --profile=<name>',
180
+ ' klaudiak [agentArgs...] --defaults=<name>',
181
+ ' klaudiak [agentArgs...] --port=<port>',
182
+ ' klaudiak [agentArgs...] --port <port>',
181
183
  ' klaudiak defaults <list|show|create|delete|set|unset>',
182
- ' klaudiak proxy <model> key <apiKey> --port=<port>',
184
+ ' klaudiak proxy',
185
+ ' klaudiak proxy --profile=<name>',
186
+ ' klaudiak proxy <model> key <apiKey> [--port=<port>|--port <port>]',
183
187
  '',
184
188
  'Examples:',
185
189
  ' klaudiak',
190
+ ' klaudiak -p "say hi"',
186
191
  ' klaudiak --profile=gemini',
192
+ ' klaudiak --defaults=gemini',
187
193
  ' klaudiak --port=10000',
194
+ ' klaudiak --port 10000',
195
+ ' klaudiak proxy',
196
+ ' klaudiak proxy --profile=default',
188
197
  ' klaudiak defaults create gemini',
198
+ ' klaudiak defaults list',
199
+ ' klaudiak defaults show gemini',
189
200
  ' klaudiak defaults set gemini type proxy',
190
201
  ' klaudiak defaults set gemini openrouterModel google/gemini-2.5-pro',
191
202
  ' klaudiak defaults set gemini openrouterApiKey sk-or-v1-...',
203
+ ' klaudiak defaults unset gemini anthropicApiKey',
204
+ ' klaudiak defaults delete gemini',
192
205
  ' klaudiak proxy deepseek/deepseek-chat-v3-0324 key sk-or-v1-... --port=10000',
206
+ ' klaudiak proxy deepseek/deepseek-chat-v3-0324 key sk-or-v1-... --port 10000',
193
207
  ].join('\n'));
194
208
  }
195
209
 
@@ -268,6 +282,30 @@ function runAgent(argv) {
268
282
  env.ANTHROPIC_BASE_URL = profile.anthropicBaseUrl || 'http://localhost:9090';
269
283
  }
270
284
 
285
+ // Force API-key mode for local proxy sessions so the CLI does not fall back
286
+ // to OAuth/login when no Anthropic credentials are configured.
287
+ if (
288
+ env.ANTHROPIC_BASE_URL &&
289
+ /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?(\/|$)/i.test(env.ANTHROPIC_BASE_URL) &&
290
+ !env.ANTHROPIC_API_KEY &&
291
+ !env.CLAUDE_CODE_OAUTH_TOKEN &&
292
+ !env.ANTHROPIC_AUTH_TOKEN
293
+ ) {
294
+ // Some bundled CLI builds derive auth status from different env variables.
295
+ // Set all local-only placeholders so proxy sessions never fall into /login.
296
+ env.ANTHROPIC_API_KEY = 'local-proxy-key';
297
+ env.CLAUDE_CODE_OAUTH_TOKEN = 'local-proxy-oauth';
298
+ env.ANTHROPIC_AUTH_TOKEN = 'local-proxy-auth';
299
+ }
300
+
301
+ if (
302
+ env.ANTHROPIC_BASE_URL &&
303
+ /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?(\/|$)/i.test(env.ANTHROPIC_BASE_URL) &&
304
+ !forwardArgs.includes('--bare')
305
+ ) {
306
+ forwardArgs.unshift('--bare');
307
+ }
308
+
271
309
  spawnNode(join(__dirname, 'cli.js'), forwardArgs, env);
272
310
  }
273
311
 
@@ -282,7 +320,8 @@ function runProxy(argv) {
282
320
 
283
321
  const effectiveArgs = filteredArgs;
284
322
  if (effectiveArgs.length < 3 || effectiveArgs[1] !== 'key') {
285
- if (effectiveArgs.length === 0 && profile.type === 'proxy' && profile.openrouterModel && profile.openrouterApiKey) {
323
+ const hasProfileProxyConfig = Boolean(profile.openrouterModel && profile.openrouterApiKey);
324
+ if (effectiveArgs.length === 0 && hasProfileProxyConfig) {
286
325
  const env = {
287
326
  ...process.env,
288
327
  OPENROUTER_MODEL: profile.openrouterModel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "klaudiak",
3
- "version": "2.1.89",
3
+ "version": "2.1.91",
4
4
  "bin": {
5
5
  "klaudiak": "klaudiak.js"
6
6
  },