klaudiak 2.1.92 → 2.1.94

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.
Binary file
package/README.md CHANGED
@@ -2,26 +2,97 @@
2
2
 
3
3
  Klaudia Kode is a coding agent wrapper CLI that can run against many LLM providers through a local OpenRouter-compatible proxy.
4
4
 
5
+ ![klaudiak proxy screenshot](https://raw.githubusercontent.com/samuraicoderr/klaudia-kode/main/.docs/screenshots/klaudiak.png)
6
+
7
+
8
+ Use the CLI as `klaudiak`.
9
+
5
10
  ## Quick Start
6
11
 
7
- 1. Start the proxy in one terminal:
12
+ 1. Install and verify:
8
13
 
9
14
  ```bash
10
- npx klaudiak proxy deepseek/deepseek-chat-v3-0324 key sk-or-v1-... --port=10000
15
+ npm i -g klaudiak
16
+ klaudiak --help
11
17
  ```
12
18
 
13
- 2. Start the coding agent in another terminal:
19
+ 2. Start the proxy in one terminal:
14
20
 
15
21
  ```bash
16
- npx klaudiak --port=10000
22
+ klaudiak proxy deepseek/deepseek-chat-v3-0324 key sk-or-v1-... --port=10000
23
+ ```
24
+
25
+ 3. Start the coding agent in another terminal:
26
+
27
+ ```bash
28
+ klaudiak --port=10000
17
29
  ```
18
30
 
19
31
  If your proxy runs on default port 9090, you can simply run:
20
32
 
21
33
  ```bash
22
- npx klaudiak
34
+ klaudiak
35
+ ```
36
+
37
+ ## Laziest Setup (Two Commands)
38
+
39
+ If you want daily usage to be exactly:
40
+
41
+ ```bash
42
+ klaudiak proxy
43
+ klaudiak
44
+ ```
45
+
46
+ set the `default` profile once:
47
+
48
+ ```bash
49
+ klaudiak defaults set default type proxy
50
+ klaudiak defaults set default openrouterModel deepseek/deepseek-chat-v3-0324
51
+ klaudiak defaults set default openrouterApiKey sk-or-v1-...
52
+ klaudiak defaults set default proxyPort 9090
53
+ klaudiak defaults set default anthropicBaseUrl http://localhost:9090
54
+ ```
55
+
56
+ Then every day:
57
+
58
+ 1. Terminal A: `klaudiak proxy`
59
+ 2. Terminal B: `klaudiak`
60
+
61
+ If you choose another port, keep `proxyPort` and `anthropicBaseUrl` aligned to the same value.
62
+
63
+ Screenshots of this exact lazy flow:
64
+
65
+ ### `klaudiak proxy`
66
+
67
+ ![klaudiak proxy screenshot](https://raw.githubusercontent.com/samuraicoderr/klaudia-kode/main/.docs/screenshots/openrouter-proxy.png)
68
+
69
+ ### `klaudiak`
70
+
71
+ ![klaudiak screenshot](https://raw.githubusercontent.com/samuraicoderr/klaudia-kode/main/.docs/screenshots/klaudiak.png)
72
+
73
+ ## Recommended Daily Workflow
74
+
75
+ For repeat usage, set profile defaults once and then launch with short commands.
76
+
77
+ ```bash
78
+ # Create a dedicated profile
79
+ klaudiak defaults create deepseek
80
+
81
+ # Save proxy settings to that profile
82
+ klaudiak defaults set deepseek type proxy
83
+ klaudiak defaults set deepseek openrouterModel deepseek/deepseek-chat-v3-0324
84
+ klaudiak defaults set deepseek openrouterApiKey sk-or-v1-...
85
+ klaudiak defaults set deepseek proxyPort 10000
86
+
87
+ # Terminal A: run proxy from profile (no model/key arguments needed)
88
+ klaudiak proxy --profile=deepseek
89
+
90
+ # Terminal B: run agent against the same proxy port
91
+ klaudiak --profile=deepseek --port=10000
23
92
  ```
24
93
 
94
+ This gives you predictable, reusable setup with minimal typing.
95
+
25
96
  ## Command Reference
26
97
 
27
98
  ### Start agent
@@ -39,11 +110,17 @@ klaudiak --port <port>
39
110
  - Any additional args are forwarded to `cli.js` (for example `-p "..."`).
40
111
  - `--profile=<name>` loads settings from `~/.klaudiak` profile `<name>`.
41
112
  - `--defaults=<name>` is an alias of `--profile=<name>`.
42
- - `--port=<port>` sets `ANTHROPIC_BASE_URL=http://localhost:<port>` for this run when not already set.
113
+ - `--port=<port>` sets `ANTHROPIC_BASE_URL=http://localhost:<port>` for this run (overrides profile/env base URL).
43
114
  - `--port <port>` is also supported.
44
115
 
45
116
  When no profile flag is passed, Klaudiak always uses the `default` profile.
46
117
 
118
+ Behavior details that matter:
119
+
120
+ - Agent arguments are forwarded to `cli.js` after removing `--profile/--defaults` and `--port`.
121
+ - If running against `localhost`/`127.0.0.1`, Klaudiak auto-enables `--bare` unless you already passed it.
122
+ - If running against `localhost` and no Anthropic auth env vars are set, Klaudiak injects local placeholder auth values to avoid OAuth/login fallback.
123
+
47
124
  ### Start proxy
48
125
 
49
126
  ```bash
@@ -98,6 +175,22 @@ Supported fields:
98
175
  - `openrouterModel`
99
176
  - `openrouterApiKey`
100
177
 
178
+ Notes:
179
+
180
+ - Profile names must match `^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$`.
181
+ - `default` profile always exists and cannot be deleted.
182
+ - `klaudiak` auto-creates `~/.klaudiak` on first run.
183
+
184
+ ## Configuration Precedence
185
+
186
+ For agent startup, effective values follow this order:
187
+
188
+ 1. Existing environment variables (for example `ANTHROPIC_API_KEY`, `ANTHROPIC_MODEL`, `ANTHROPIC_BASE_URL`)
189
+ 2. Selected profile values from `~/.klaudiak`
190
+ 3. CLI `--port` (overrides base URL to `http://localhost:<port>`)
191
+
192
+ Practical rule: if you pass `--port`, that port wins for `ANTHROPIC_BASE_URL`.
193
+
101
194
  ## How It Works
102
195
 
103
196
  ```text
@@ -106,6 +199,13 @@ Klaudia Kode CLI --> local proxy (default :9090) --> OpenRouter/provider
106
199
 
107
200
  The agent speaks Anthropic-compatible protocol to the local proxy. The proxy translates and routes requests to the model/provider you selected.
108
201
 
202
+ ## Power Tips
203
+
204
+ - Use profiles per provider/model combo so you can switch quickly with `--profile=<name>`.
205
+ - Keep proxy and agent ports explicit when debugging: `klaudiak proxy ... --port=10000` and `klaudiak --port=10000`.
206
+ - Use `klaudiak defaults show <name>` to confirm values before running.
207
+ - Store secrets in profile only on trusted machines, and rotate keys periodically.
208
+
109
209
  ## Troubleshooting
110
210
 
111
211
  ### Proxy not running
@@ -131,12 +231,24 @@ Make sure:
131
231
  - API key starts with an OpenRouter key format such as `sk-or-v1-...`
132
232
  - Model string is valid for your provider account
133
233
 
234
+ ### Profile not found
235
+
236
+ If you pass `--profile=<name>` and get a not-found error:
237
+
238
+ 1. Check available profiles with `klaudiak defaults list`.
239
+ 2. Create it with `klaudiak defaults create <name>`.
240
+ 3. Set required fields using `klaudiak defaults set ...`.
241
+
242
+ ### Invalid profile file JSON
243
+
244
+ If `~/.klaudiak` contains invalid JSON, Klaudiak recreates it with defaults and prints a warning.
245
+
134
246
  ## Migration from Klaudiak
135
247
 
136
248
  - Package/command is now `klaudiak`
137
249
  - Legacy aliases are removed
138
250
  - Proxy command contract is standardized as:
139
- - `klaudiak proxy <model> key <apiKey> --port=<port>`
251
+ - `klaudiak proxy <model> key <apiKey> --port=<port>`
140
252
 
141
253
  ## Requirements
142
254
 
package/klaudiak-help.md CHANGED
@@ -1,14 +1,32 @@
1
1
  Klaudia Kode CLI
2
2
 
3
- install using
4
- $ npm install -g klaudiak
5
-
6
3
  Usage:
7
- klaudiak
8
- klaudiak --port=<port>
9
- klaudiak proxy <model> key <apiKey> --port=<port>
4
+ klaudiak [agentArgs...]
5
+ klaudiak [agentArgs...] --profile=<name>
6
+ klaudiak [agentArgs...] --defaults=<name>
7
+ klaudiak [agentArgs...] --port=<port>
8
+ klaudiak [agentArgs...] --port <port>
9
+ klaudiak defaults <list|show|create|delete|set|unset>
10
+ klaudiak proxy
11
+ klaudiak proxy --profile=<name>
12
+ klaudiak proxy <model> key <apiKey> [--port=<port>|--port <port>]
10
13
 
11
14
  Examples:
12
15
  klaudiak
16
+ klaudiak -p "say hi"
17
+ klaudiak --profile=gemini
18
+ klaudiak --defaults=gemini
13
19
  klaudiak --port=10000
20
+ klaudiak --port 10000
21
+ klaudiak proxy
22
+ klaudiak proxy --profile=default
23
+ klaudiak defaults create gemini
24
+ klaudiak defaults list
25
+ klaudiak defaults show gemini
26
+ klaudiak defaults set gemini type proxy
27
+ klaudiak defaults set gemini openrouterModel google/gemini-2.5-pro
28
+ klaudiak defaults set gemini openrouterApiKey sk-or-v1-...
29
+ klaudiak defaults unset gemini anthropicApiKey
30
+ klaudiak defaults delete gemini
14
31
  klaudiak proxy deepseek/deepseek-chat-v3-0324 key sk-or-v1-... --port=10000
32
+ klaudiak proxy deepseek/deepseek-chat-v3-0324 key sk-or-v1-... --port 10000
@@ -106,7 +106,7 @@ function sendToOpenRouter(url, payload) {
106
106
  'authorization': `Bearer ${OPENROUTER_API_KEY}`,
107
107
  'anthropic-version': '2023-06-01',
108
108
  'content-length': Buffer.byteLength(payload),
109
- 'http-referer': 'https://github.com/klaudia-kode/klaudiak',
109
+ 'http-referer': 'https://github.com/samuraicoderr/klaudia-kode',
110
110
  'x-title': 'Klaudia Kode',
111
111
  },
112
112
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "klaudiak",
3
- "version": "2.1.92",
3
+ "version": "2.1.94",
4
4
  "bin": {
5
5
  "klaudiak": "klaudiak.js"
6
6
  },
@@ -11,9 +11,13 @@
11
11
  "author": "Klaudia Kode Maintainers",
12
12
  "license": "SEE LICENSE IN README.md",
13
13
  "description": "Klaudia Kode is a production-grade coding agent that supports many LLMs through a local OpenRouter-compatible proxy.",
14
- "homepage": "https://github.com/klaudia-kode/klaudiak",
14
+ "homepage": "https://github.com/samuraicoderr/klaudia-kode",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/samuraicoderr/klaudia-kode.git"
18
+ },
15
19
  "bugs": {
16
- "url": "https://github.com/klaudia-kode/klaudiak/issues"
20
+ "url": "https://github.com/samuraicoderr/klaudia-kode/issues"
17
21
  },
18
22
  "scripts": {
19
23
  "prepare": "node -e \"if (!process.env.AUTHORIZED) { console.error('ERROR: Direct publishing is not allowed.\\nPlease see the release workflow documentation to publish this package.'); process.exit(1); }\""