@klok-integration/cli 0.6.245 → 0.7.248
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 +1 -0
- package/assets/agents/AGENTS.workspace.md +12 -4
- package/assets/agents/skills/klok-cli/SKILL.md +57 -0
- package/assets/agents/skills/klok-cli/reference.md +1096 -0
- package/assets/agents/skills/klok-docs/SKILL.md +6 -1
- package/assets/agents/skills/klok-worktree/SKILL.md +2 -1
- package/dist/cli.js +7 -7
- package/package.json +1 -1
|
@@ -0,0 +1,1096 @@
|
|
|
1
|
+
# klok command reference
|
|
2
|
+
|
|
3
|
+
Generated from the `klok` program of this klok-cli version by `npm run reference -w @klok/cli`; do not edit it by
|
|
4
|
+
hand. Every command also takes `-h, --help`, and the global options below go before or after the command.
|
|
5
|
+
|
|
6
|
+
Local proxy to the Klok Integration Agent. Interactive terminal UI when run in a terminal; headless JSON output when piped, in CI, or with --json.
|
|
7
|
+
|
|
8
|
+
## Global options
|
|
9
|
+
|
|
10
|
+
| Option | Description |
|
|
11
|
+
|---|---|
|
|
12
|
+
| `-V, --version` | output the version number |
|
|
13
|
+
| `--json` | Headless mode: one JSON document on stdout, messages on stderr |
|
|
14
|
+
| `--no-tui` | Disable the terminal UI (same as --json without pretty output) |
|
|
15
|
+
| `--stream` | Headless mode: NDJSON task events on stdout, then the result document |
|
|
16
|
+
| `--tenant <slug>` | Tenant to act in (overrides config and KLOK_TENANT) |
|
|
17
|
+
| `--domain <slug>` | Default domain scope for tasks |
|
|
18
|
+
| `--agent-url <url>` | Agent service URL (overrides config and KLOK_AGENT_URL) |
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Exit codes:
|
|
22
|
+
0 ok
|
|
23
|
+
1 error
|
|
24
|
+
2 task needs input (see the question in the JSON document, answer with `klok agent answer`)
|
|
25
|
+
3 denied by policy (the JSON document lists the capability decisions)
|
|
26
|
+
4 not authenticated (run `klok login`)
|
|
27
|
+
5 managed files are outdated (klok agents update --check); a deployed service is stale (klok fleet status)
|
|
28
|
+
|
|
29
|
+
Examples:
|
|
30
|
+
klok login
|
|
31
|
+
klok agent ask "Which legs consume InvoiceV1?"
|
|
32
|
+
klok agent ask "..." --json | jq .task.resultSummary
|
|
33
|
+
klok agent impact InvoiceV1 --change major --json
|
|
34
|
+
klok agent plan KLK001 --change-request change.md
|
|
35
|
+
klok agent serve
|
|
36
|
+
klok bead report fortnox-egress-1 --status done --message "Merged MR !12"
|
|
37
|
+
klok agents init # KLOK-AGENTS.md, harness rows, platform and tenant skills, the session hook
|
|
38
|
+
klok agents update # fetch the platform and tenant catalogs, write what moved, prune by marker
|
|
39
|
+
klok agents update --check # exit 5 when a catalog is outdated or missing, write nothing
|
|
40
|
+
klok agents status # per managed file and per catalog: current, outdated, missing, unreachable
|
|
41
|
+
klok agents init --global # ~/.klok/agents/KLOK-AGENTS.md, every tenant of your token, the global hook
|
|
42
|
+
klok catalog publish-agents # write this CLI's agent assets and version into the platform catalog
|
|
43
|
+
klok docs publish # build this repository's znai tree and upload it to docs.klok.dev
|
|
44
|
+
klok docs publish --dry-run # show the doc id, source root and portal, upload nothing
|
|
45
|
+
klok fleet status # every deployed service: built from main? with the catalog's broker client?
|
|
46
|
+
klok fleet status --broker # and every producer and consumer on the broker (needs your Vault login)
|
|
47
|
+
klok fleet rebuild --stale --dry-run # which main pipelines a rebuild of the stale services would start
|
|
48
|
+
klok manifest update # set this pipeline's image in its deploy manifest, commit and push
|
|
49
|
+
klok manifest update --dry-run # clone and edit the manifest, print the diff, push nothing
|
|
50
|
+
klok pin update --repo <infra repo> --file <vars.yml> --version-key <key> --sha256-key <key> \
|
|
51
|
+
--sha256-of '{maven-central}.nar' # open a merge request that pins this pipeline's release
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## klok login
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
klok login [options]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Log in to Keycloak (device flow by default; --browser for the browser flow)
|
|
61
|
+
|
|
62
|
+
| Option | Description |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `--browser` | Use the browser authorization code flow instead of the device flow |
|
|
65
|
+
| `--no-open` | Do not open the browser automatically |
|
|
66
|
+
|
|
67
|
+
## klok logout
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
klok logout [options]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Remove stored credentials
|
|
74
|
+
|
|
75
|
+
## klok whoami
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
klok whoami [options]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Show the logged-in user and tenant
|
|
82
|
+
|
|
83
|
+
## klok config
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
klok config [options] [command]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Read and write ~/.config/klok/config.json
|
|
90
|
+
|
|
91
|
+
### klok config list
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
klok config list [options]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Show effective configuration and where each value comes from; secrets show as ****
|
|
98
|
+
|
|
99
|
+
### klok config get
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
klok config get [options] <key>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Print one effective configuration value; secrets show as **** unless --reveal
|
|
106
|
+
|
|
107
|
+
| Argument | Description |
|
|
108
|
+
|---|---|
|
|
109
|
+
| `<key>` | required |
|
|
110
|
+
|
|
111
|
+
| Option | Description |
|
|
112
|
+
|---|---|
|
|
113
|
+
| `--reveal` | Print the real value of a secret |
|
|
114
|
+
|
|
115
|
+
### klok config set
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
klok config set [options] <key> [value]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Set a value. Keys: agentUrl, tenant, klokDevUrl, keycloakIssuer, keycloakClientId, protocol, domain, gitUrl, workspace, klokerBasePath, klokerUrl, klokerModel, summaryLanguage, klokApiKey. Leave out the value of a secret (klokApiKey) to type it at a hidden prompt or pipe it in, so it stays out of the shell history
|
|
122
|
+
|
|
123
|
+
| Argument | Description |
|
|
124
|
+
|---|---|
|
|
125
|
+
| `<key>` | required |
|
|
126
|
+
| `[value]` | optional |
|
|
127
|
+
|
|
128
|
+
### klok config delete
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
klok config delete [options] <key>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Remove a value from the config file
|
|
135
|
+
|
|
136
|
+
| Argument | Description |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `<key>` | required |
|
|
139
|
+
|
|
140
|
+
## klok agent
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
klok agent [options] [command]
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Run tasks on the Klok Integration Agent
|
|
147
|
+
|
|
148
|
+
### klok agent ask
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
klok agent ask [options] <question>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Ask a question about the integration landscape
|
|
155
|
+
|
|
156
|
+
| Argument | Description |
|
|
157
|
+
|---|---|
|
|
158
|
+
| `<question>` | required |
|
|
159
|
+
|
|
160
|
+
| Option | Description |
|
|
161
|
+
|---|---|
|
|
162
|
+
| `--focus <nodeId...>` | Focus node ids from the context graph |
|
|
163
|
+
| `--session <id>` | Continue a conversation session |
|
|
164
|
+
| `--no-wait` | Create the task and return immediately |
|
|
165
|
+
|
|
166
|
+
### klok agent impact
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
klok agent impact [options] <target>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Impact analysis for a node id or datamodel name
|
|
173
|
+
|
|
174
|
+
| Argument | Description |
|
|
175
|
+
|---|---|
|
|
176
|
+
| `<target>` | required |
|
|
177
|
+
|
|
178
|
+
| Option | Description |
|
|
179
|
+
|---|---|
|
|
180
|
+
| `--change <kind>` | minor \| major \| remove |
|
|
181
|
+
| `--description <text>` | What the change is |
|
|
182
|
+
| `--no-wait` | Create the task and return immediately |
|
|
183
|
+
|
|
184
|
+
### klok agent plan
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
klok agent plan [options] <solutionKey>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Plan a solution change from a change request file (or - for stdin)
|
|
191
|
+
|
|
192
|
+
| Argument | Description |
|
|
193
|
+
|---|---|
|
|
194
|
+
| `<solutionKey>` | required |
|
|
195
|
+
|
|
196
|
+
| Option | Description |
|
|
197
|
+
|---|---|
|
|
198
|
+
| `--change-request <file>` | Path to the change request text, or - for stdin |
|
|
199
|
+
| `--answer <questionId=text...>` | Clarification answers |
|
|
200
|
+
| `--no-wait` | Create the task and return immediately |
|
|
201
|
+
|
|
202
|
+
### klok agent implement
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
klok agent implement [options] <beadId>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Implement a bead with a coding agent in the sandbox and deliver a merge request
|
|
209
|
+
|
|
210
|
+
| Argument | Description |
|
|
211
|
+
|---|---|
|
|
212
|
+
| `<beadId>` | required |
|
|
213
|
+
|
|
214
|
+
| Option | Description |
|
|
215
|
+
|---|---|
|
|
216
|
+
| `--repo-path <path>` | Repository the bead lives in (default: the origin of the current repository) |
|
|
217
|
+
| `--agent <id>` | Coding agent: opencode \| claude-code \| codex (default: `opencode`) |
|
|
218
|
+
| `--model <model>` | Model on the Klok LLM gateway |
|
|
219
|
+
| `--max-minutes <n>` | Wall-clock budget for the agent and the build (default: `90`) |
|
|
220
|
+
| `--max-build-attempts <n>` | How many times the agent may fix a failing build (default: `2`) |
|
|
221
|
+
| `--no-wait` | Create the task and return immediately |
|
|
222
|
+
|
|
223
|
+
### klok agent tasks
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
klok agent tasks [options]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
List tasks in the tenant
|
|
230
|
+
|
|
231
|
+
| Option | Description |
|
|
232
|
+
|---|---|
|
|
233
|
+
| `--status <status>` | submitted \| working \| input-required \| completed \| failed \| canceled |
|
|
234
|
+
| `--type <taskType>` | landscape-question \| impact-analysis \| integration-plan \| erp-change-plan \| issue-creation \| bead-creation \| project-scaffold \| datamodel-proposal \| repo-index \| bead-implementation |
|
|
235
|
+
| `--limit <n>` | Maximum number of tasks (default: `50`) |
|
|
236
|
+
|
|
237
|
+
### klok agent open
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
klok agent open [options] <taskId>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Open the task in klok.dev
|
|
244
|
+
|
|
245
|
+
| Argument | Description |
|
|
246
|
+
|---|---|
|
|
247
|
+
| `<taskId>` | required |
|
|
248
|
+
|
|
249
|
+
### klok agent answer
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
klok agent answer [options] <taskId>
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Answer an input-required question
|
|
256
|
+
|
|
257
|
+
| Argument | Description |
|
|
258
|
+
|---|---|
|
|
259
|
+
| `<taskId>` | required |
|
|
260
|
+
|
|
261
|
+
| Option | Description |
|
|
262
|
+
|---|---|
|
|
263
|
+
| `--question <questionId>` | Question id from the task |
|
|
264
|
+
| `--text <answer>` | Answer text |
|
|
265
|
+
| `--no-wait` | Do not wait for the task to continue |
|
|
266
|
+
|
|
267
|
+
### klok agent cancel
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
klok agent cancel [options] <taskId>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Cancel a task
|
|
274
|
+
|
|
275
|
+
| Argument | Description |
|
|
276
|
+
|---|---|
|
|
277
|
+
| `<taskId>` | required |
|
|
278
|
+
|
|
279
|
+
### klok agent serve
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
klok agent serve [options]
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Start the loopback MCP and A2A proxy for IDEs and other agents
|
|
286
|
+
|
|
287
|
+
| Option | Description |
|
|
288
|
+
|---|---|
|
|
289
|
+
| `--port <port>` | Port on 127.0.0.1 (default: `3091`) |
|
|
290
|
+
| `--host <host>` | Bind address (default: `127.0.0.1`) |
|
|
291
|
+
|
|
292
|
+
## klok bead
|
|
293
|
+
|
|
294
|
+
```
|
|
295
|
+
klok bead [options] [command]
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Work with .beads/*.json files in the current repository
|
|
299
|
+
|
|
300
|
+
### klok bead list
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
klok bead list [options]
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
List beads in the current repository
|
|
307
|
+
|
|
308
|
+
| Option | Description |
|
|
309
|
+
|---|---|
|
|
310
|
+
| `--status <status>` | open \| blocked \| in_progress \| needs_review \| done \| cancelled |
|
|
311
|
+
|
|
312
|
+
### klok bead show
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
klok bead show [options] <beadId>
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Print one bead
|
|
319
|
+
|
|
320
|
+
| Argument | Description |
|
|
321
|
+
|---|---|
|
|
322
|
+
| `<beadId>` | required |
|
|
323
|
+
|
|
324
|
+
### klok bead report
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
klok bead report [options] <beadId>
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Append progress to a bead and report it to klok.dev
|
|
331
|
+
|
|
332
|
+
| Argument | Description |
|
|
333
|
+
|---|---|
|
|
334
|
+
| `<beadId>` | required |
|
|
335
|
+
|
|
336
|
+
| Option | Description |
|
|
337
|
+
|---|---|
|
|
338
|
+
| `--status <status>` | open \| blocked \| in_progress \| needs_review \| done \| cancelled |
|
|
339
|
+
| `--message <text>` | What happened |
|
|
340
|
+
| `--by <name>` | Reporter name; defaults to the logged-in user |
|
|
341
|
+
| `--repo-path <path>` | GitLab project path, when it cannot be derived from the origin remote |
|
|
342
|
+
| `--local-only` | Update the bead file without reporting to klok.dev |
|
|
343
|
+
|
|
344
|
+
## klok agents
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
klok agents [options] [command]
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Install and keep current the Klok agent instructions (KLOK-AGENTS.md plus one managed row in every harness file), the platform skills and your tenant’s skills
|
|
351
|
+
|
|
352
|
+
### klok agents init
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
klok agents init [options]
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Write KLOK-AGENTS.md, knowledge/ and the skills into a repository, with --workspace into the workspace root, or with --global into the home folder, and put one managed row into AGENTS.md, CLAUDE.md, GEMINI.md and the other harness files. The platform assets come from the platform catalog on GitLab (the copy bundled with this CLI with --offline); the tenant skills come from the tenant catalog when a GitLab token is at hand, are installed next to the platform skills and kept out of git. Klok’s own files are replaced wholesale; every other file keeps its content and only has its single klok-agents row created or replaced. Retired skills are removed by their marker. A Claude Code SessionStart hook keeps the skills fresh.
|
|
359
|
+
|
|
360
|
+
| Option | Description |
|
|
361
|
+
|---|---|
|
|
362
|
+
| `-g, --global` | Initialise the home folder (~/.klok/agents/KLOK-AGENTS.md, the harness files that point at it, and the skills of every tenant your token belongs to) |
|
|
363
|
+
| `-w, --workspace [path]` | Initialise the workspace root (default: config workspace, ~/devklok) with the shared rules and pointer files, no skills |
|
|
364
|
+
| `-d, --dir <path>` | Repository directory (default: current directory) |
|
|
365
|
+
| `-t, --type <type>` | Project type: integration, datamodel, documentation, application, framework (default: detected) |
|
|
366
|
+
| `--tools <list>` | Comma separated harnesses or "all": claude, codex, opencode, cursor, gemini, antigravity, cline, copilot (default: `all`) |
|
|
367
|
+
| `--tenant <slug>` | Install this tenant’s skills (repeatable; default: the tenant of the origin remote, or every root group of the token with --global) |
|
|
368
|
+
| `--no-tenant` | Platform skills only |
|
|
369
|
+
| `--token <token>` | GitLab token with read_api (default: KLOK_GIT_APIKEY, then config klokApiKey) |
|
|
370
|
+
| `--offline` | Use the assets bundled with this CLI and reach no catalog |
|
|
371
|
+
| `--no-skills` | Do not write the skill files |
|
|
372
|
+
| `--no-hooks` | Do not write the Claude Code SessionStart hook |
|
|
373
|
+
| `--dry-run` | Show what would change without writing |
|
|
374
|
+
|
|
375
|
+
### klok agents update
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
klok agents update [options]
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Fetch the platform catalog and your tenant catalog(s), write the files that moved, prune retired skills by their marker and keep tenant skills out of git. Nothing is written when the catalogs did not move. --check reports and exits 5 when a catalog is outdated or missing; --quiet prints one line only when something changed, which is what the Claude Code hook runs.
|
|
382
|
+
|
|
383
|
+
| Option | Description |
|
|
384
|
+
|---|---|
|
|
385
|
+
| `-g, --global` | Update the home folder instead of a repository |
|
|
386
|
+
| `-d, --dir <path>` | Repository directory (default: current directory) |
|
|
387
|
+
| `--tenant <slug>` | Update this tenant’s skills (repeatable; default: detected) |
|
|
388
|
+
| `--no-tenant` | Platform assets only |
|
|
389
|
+
| `--token <token>` | GitLab token with read_api (default: KLOK_GIT_APIKEY, then config klokApiKey) |
|
|
390
|
+
| `--check` | Compare only: exit 5 when a catalog is outdated or missing, write nothing |
|
|
391
|
+
| `--max-age <duration>` | Skip a catalog checked less than this long ago (30s, 10m, 2h, 1d) |
|
|
392
|
+
| `-q, --quiet` | Print one line only when something changed; an unreachable catalog is not an error |
|
|
393
|
+
| `--dry-run` | Show what would change without writing |
|
|
394
|
+
| `--tools <list>` | Comma separated harnesses or "all" (default: as installed) |
|
|
395
|
+
| `-t, --type <type>` | Project type (default: as installed, else detected) |
|
|
396
|
+
| `--offline` | Use the assets bundled with this CLI and reach no catalog |
|
|
397
|
+
|
|
398
|
+
### klok agents status
|
|
399
|
+
|
|
400
|
+
```
|
|
401
|
+
klok agents status [options]
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
Show, per managed file and per catalog, whether the instructions of a repository (with --global the home folder, with --workspace the workspace root) are current, outdated, missing or unreachable, and whether the session hook is installed
|
|
405
|
+
|
|
406
|
+
| Option | Description |
|
|
407
|
+
|---|---|
|
|
408
|
+
| `-g, --global` | Check the home folder instead of a repository |
|
|
409
|
+
| `-w, --workspace [path]` | Check the workspace root instead of a repository (default: config workspace) |
|
|
410
|
+
| `-d, --dir <path>` | Repository directory (default: current directory) |
|
|
411
|
+
| `-t, --type <type>` | Project type (default: detected) |
|
|
412
|
+
| `--tools <list>` | Comma separated harnesses or "all" (default: `all`) |
|
|
413
|
+
| `--tenant <slug>` | Check this tenant’s skills (repeatable; default: detected) |
|
|
414
|
+
| `--no-tenant` | Platform only |
|
|
415
|
+
| `--token <token>` | GitLab token with read_api (default: KLOK_GIT_APIKEY, then config klokApiKey) |
|
|
416
|
+
| `--offline` | Compare with the assets bundled with this CLI and reach no catalog |
|
|
417
|
+
|
|
418
|
+
### klok agents propose
|
|
419
|
+
|
|
420
|
+
```
|
|
421
|
+
klok agents propose [options]
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
Update the committed agent instructions of a repository from the platform catalog and offer the result as a merge request. Meant for a scheduled pipeline: when the files already match it does nothing, it never writes to the default branch, and it never commits tenant skills.
|
|
425
|
+
|
|
426
|
+
| Option | Description |
|
|
427
|
+
|---|---|
|
|
428
|
+
| `-d, --dir <path>` | Repository directory (default: current directory) |
|
|
429
|
+
| `-t, --type <type>` | Project type (default: detected) |
|
|
430
|
+
| `--tools <list>` | Comma separated harnesses or "all" (default: `all`) |
|
|
431
|
+
| `--no-skills` | Do not write the skill files |
|
|
432
|
+
| `--offline` | Use the assets bundled with this CLI instead of the platform catalog |
|
|
433
|
+
| `--branch <name>` | Branch to propose from (default: klok/agents-refresh) (default: `klok/agents-refresh`) |
|
|
434
|
+
|
|
435
|
+
### klok agents list
|
|
436
|
+
|
|
437
|
+
```
|
|
438
|
+
klok agents list [options]
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
List the project types, harnesses and platform skills this CLI version installs, and the tenant skills installed here
|
|
442
|
+
|
|
443
|
+
| Option | Description |
|
|
444
|
+
|---|---|
|
|
445
|
+
| `-g, --global` | List the tenant skills installed in the home folder |
|
|
446
|
+
| `-d, --dir <path>` | Repository directory (default: current directory) |
|
|
447
|
+
|
|
448
|
+
## klok catalog
|
|
449
|
+
|
|
450
|
+
```
|
|
451
|
+
klok catalog [options] [command]
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
The platform dependency catalog, which Gradle, klok-cli and klok.dev install from
|
|
455
|
+
|
|
456
|
+
### klok catalog publish-agents
|
|
457
|
+
|
|
458
|
+
```
|
|
459
|
+
klok catalog publish-agents [options]
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
Write this CLI's agent assets into the catalog's agents/ and klok-agents.zip, with its version when they changed, then commit and push
|
|
463
|
+
|
|
464
|
+
| Option | Description |
|
|
465
|
+
|---|---|
|
|
466
|
+
| `--repo <path-or-url>` | GitLab path or git URL of the catalog (default: KLOK_AGENTS_CATALOG_REPO, then klok/framework/klok-gradle-dependency-catalog) |
|
|
467
|
+
| `--branch <name>` | Branch to push to (default: KLOK_AGENTS_CATALOG_BRANCH, then main) |
|
|
468
|
+
| `-n, --dry-run` | Clone and write the assets, print what would change, commit and push nothing |
|
|
469
|
+
|
|
470
|
+
```
|
|
471
|
+
The files are the assets bundled in this CLI (assets/agents). When they differ from the catalog's, agents/VERSION
|
|
472
|
+
becomes this CLI's version, so the catalog names the build that last changed its assets; when they are the same,
|
|
473
|
+
nothing is committed, because every installed file carries that version in its marker. Only a released build
|
|
474
|
+
(<x.y.z>-build.<yyMMddHHmmss>) is published, and a catalog that already has a newer build is left alone. When
|
|
475
|
+
RELEASED_KLOK_CLI_VERSION is set (the release pipeline sets it), the command refuses to run from an older build,
|
|
476
|
+
because the image was then not rebuilt; the same build or a later one is published, since pipelines on main queue
|
|
477
|
+
and the image can already carry the CLI of a release made after this pipeline's.
|
|
478
|
+
|
|
479
|
+
Credentials: in CI the job logs in to Vault with its identity token (VAULT_ID_TOKEN) and the role
|
|
480
|
+
<tenant>-ci-protected (KLOK_VAULT_DEPLOY_KEY_ROLE overrides it), which only pipelines of a protected branch or tag
|
|
481
|
+
can use, and reads the deploy key and the pinned host key from secret/<tenant>/CICD_KEY and
|
|
482
|
+
secret/<tenant>/KNOWN_HOSTS. By hand,
|
|
483
|
+
your ssh-agent (SSH_AUTH_SOCK) or GIT_SSH_COMMAND is used as it is.
|
|
484
|
+
|
|
485
|
+
Examples:
|
|
486
|
+
klok catalog publish-agents # in klok-integration-agent's main pipeline, after the release
|
|
487
|
+
klok catalog publish-agents --dry-run # clone and write, show what would change, push nothing
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### klok catalog release-dependents
|
|
491
|
+
|
|
492
|
+
```
|
|
493
|
+
klok catalog release-dependents [options]
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
After a library reached the platform catalog, start the default branch pipeline of every framework library whose newest release was built against an older version of it, so that it is released again against the catalog
|
|
497
|
+
|
|
498
|
+
| Option | Description |
|
|
499
|
+
|---|---|
|
|
500
|
+
| `--library <artifact>` | The released library, by Maven artifact id (repeatable; default: the build/klok-release.properties files of this directory) |
|
|
501
|
+
| `--catalog <path>` | GitLab path of the catalog (default: klok/framework/klok-gradle-dependency-catalog) |
|
|
502
|
+
| `--catalog-file <file>` | Versions file in the catalog (default: klok-libs.versions.toml) |
|
|
503
|
+
| `--catalog-ref <ref>` | Read the catalog at this branch or commit (default: main); an older commit shows what would have happened then |
|
|
504
|
+
| `-n, --dry-run` | Say what would be started; start nothing |
|
|
505
|
+
| `--git-url <url>` | GitLab base URL (default: in CI the job's server, else config gitUrl) |
|
|
506
|
+
| `--token <token>` | GitLab access token (default: in CI the job token, else KLOK_GIT_APIKEY, then config klokApiKey) |
|
|
507
|
+
|
|
508
|
+
```
|
|
509
|
+
For each framework library (Maven group dev.klok.framework) in the catalog, the POM of the version the catalog names
|
|
510
|
+
says which version of the released library it was built against. One that is older than the catalog's version is
|
|
511
|
+
behind, and gets its default branch pipeline started when its repository has gradle/klok-libs.versions.toml (the build
|
|
512
|
+
refreshes it from the catalog, so the new pipeline builds against the new version). Its release reaches the catalog,
|
|
513
|
+
where the same job runs again: klok-common, then the broker client, then the Quarkus extension, one hop at a time.
|
|
514
|
+
|
|
515
|
+
States per dependent:
|
|
516
|
+
current its newest release already declares the catalog's version; nothing to do (this ends the chain)
|
|
517
|
+
started its default branch pipeline was started
|
|
518
|
+
would start the same, in a dry run
|
|
519
|
+
already running a pipeline on its default branch, created after the version reached the catalog, will release it
|
|
520
|
+
waits it also declares another library that is started now; that release starts it
|
|
521
|
+
pinned it is behind but has no gradle/klok-libs.versions.toml: it pins versions itself; a WARNING, raise them by hand
|
|
522
|
+
not started GitLab refused the start; the command exits 1
|
|
523
|
+
unknown no POM of its catalog version in its package registry; a WARNING
|
|
524
|
+
|
|
525
|
+
The project of a framework library is <tenant>/framework/<artifact>. Nothing is ever cancelled.
|
|
526
|
+
|
|
527
|
+
In CI (the update_klok_catalog job of build-template-java.yml, after the catalog push) it uses the job token: the
|
|
528
|
+
pipeline is started with POST /projects/:id/trigger/pipeline, which GitLab accepts when the dependent's job token
|
|
529
|
+
allowlist holds the releasing project or its group, and runs as the user of the releasing pipeline. It starts
|
|
530
|
+
pipelines only from a pipeline on the default branch and not when KLOK_CATALOG_UPDATE_DRY_RUN is true (the catalog
|
|
531
|
+
update's dry run), and does nothing for a tenant other than the platform's.
|
|
532
|
+
|
|
533
|
+
Examples:
|
|
534
|
+
klok catalog release-dependents --library klok-brokerclient-java --dry-run
|
|
535
|
+
klok catalog release-dependents --library klok-brokerclient-java --catalog-ref <catalog sha> --dry-run
|
|
536
|
+
klok catalog release-dependents # in CI: what this pipeline released
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
## klok ci
|
|
540
|
+
|
|
541
|
+
```
|
|
542
|
+
klok ci [options] [command]
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
The CI job klok-cli runs in, and where CI time goes
|
|
546
|
+
|
|
547
|
+
### klok ci env
|
|
548
|
+
|
|
549
|
+
```
|
|
550
|
+
klok ci env [options]
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
Print what klok-cli detected about this CI job, and which variable each value came from
|
|
554
|
+
|
|
555
|
+
### klok ci docs-only
|
|
556
|
+
|
|
557
|
+
```
|
|
558
|
+
klok ci docs-only [options]
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
Fail unless this change touches only documentation (klok-docs/, root Markdown files, .beads/): the guard of the pipeline path a `docs` commit takes, which skips the build
|
|
562
|
+
|
|
563
|
+
| Option | Description |
|
|
564
|
+
|---|---|
|
|
565
|
+
| `--base <ref>` | Compare against this ref (default: the merge request target; on the default branch, the commit before the push) |
|
|
566
|
+
|
|
567
|
+
```
|
|
568
|
+
The Klok templates run it in a pipeline whose merge request title or commit is typed docs (Conventional Commits), where
|
|
569
|
+
the build, the image, the release and the deployment are skipped: klok-docs/ci/docs-only.md.
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### klok ci timings
|
|
573
|
+
|
|
574
|
+
```
|
|
575
|
+
klok ci timings [options]
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
Where CI time goes on GitLab: pipeline wall clock, waits per runner, and each job's phases (image, git, cache, artifacts, script) from its log. Saves a snapshot and compares it with a baseline.
|
|
579
|
+
|
|
580
|
+
| Option | Description |
|
|
581
|
+
|---|---|
|
|
582
|
+
| `--since <date>` | Start of the window, ISO 8601 (default: 30 days before --until) |
|
|
583
|
+
| `--until <date>` | End of the window, exclusive (default: now) |
|
|
584
|
+
| `--project <glob>` | Only projects whose path matches, for example "klok/integration/*" or "jttl/**" (repeatable) (default: ``) |
|
|
585
|
+
| `--out <file>` | Write the snapshot as JSON, to compare a later run with |
|
|
586
|
+
| `--compare <file>` | Compare with a snapshot written earlier by --out |
|
|
587
|
+
| `--no-logs` | Skip the job logs: no phase breakdown, but much faster |
|
|
588
|
+
| `--git-url <url>` | GitLab base URL (default: config gitUrl) |
|
|
589
|
+
| `--token <token>` | GitLab token with read_api (default: KLOK_GIT_APIKEY, then config klokApiKey); an administrator's sees every project |
|
|
590
|
+
| `-j, --jobs <n>` | Parallel requests to GitLab (default: `8`) |
|
|
591
|
+
|
|
592
|
+
```
|
|
593
|
+
The metrics and how to read them: klok-docs/ci/timings.md. A snapshot has a version; --compare refuses one written
|
|
594
|
+
with other metric definitions.
|
|
595
|
+
|
|
596
|
+
Examples:
|
|
597
|
+
klok ci timings --since 2026-08-27 --until 2026-09-26 --out ci-baseline.json
|
|
598
|
+
klok ci timings --since 2026-10-20 --compare ci-baseline.json
|
|
599
|
+
klok ci timings --project "klok/integration/*" --no-logs
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
## klok datamodel
|
|
603
|
+
|
|
604
|
+
```
|
|
605
|
+
klok datamodel [options] [command]
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
The names and checks of a Klok datamodel (XSD first, one repository per model and major version)
|
|
609
|
+
|
|
610
|
+
### klok datamodel names
|
|
611
|
+
|
|
612
|
+
```
|
|
613
|
+
klok datamodel names [options]
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
Print the repository, file, root element, type and namespace a model gets from its class and name
|
|
617
|
+
|
|
618
|
+
| Option | Description |
|
|
619
|
+
|---|---|
|
|
620
|
+
| `--class <A|B|C|X>` | A public, B common (tenant wide), C domain, X system |
|
|
621
|
+
| `--system <slug>` | External system of a class X model |
|
|
622
|
+
| `--name <PascalCase>` | Model name without the version, e.g. SupplierInvoice |
|
|
623
|
+
| `--major <n>` | Major version, 1 or higher |
|
|
624
|
+
|
|
625
|
+
```
|
|
626
|
+
The tenant is the global --tenant (or the configured one); a class C model takes its domain from the global
|
|
627
|
+
--domain. The same rules name the repository klok.dev creates and the template's placeholders
|
|
628
|
+
(klok/environment/project-template-datamodel). Example:
|
|
629
|
+
|
|
630
|
+
klok datamodel names --tenant acme --class C --domain finance --name SupplierInvoice --major 1
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
### klok datamodel validate
|
|
634
|
+
|
|
635
|
+
```
|
|
636
|
+
klok datamodel validate [options] [files...]
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
Check XSDs the way the datamodel pipeline does before avrotize: well formed, every prefix declared, every referenced type defined, every name a Java/Avro identifier; warn about the conventions
|
|
640
|
+
|
|
641
|
+
| Argument | Description |
|
|
642
|
+
|---|---|
|
|
643
|
+
| `[files...]` | XSD files (default: every *.xsd in schema-definition-xsd/) |
|
|
644
|
+
|
|
645
|
+
```
|
|
646
|
+
Exit code 1 when a file is invalid; warnings never fail. The rules and their fixtures are shared with
|
|
647
|
+
scripts/validate-xsd.py in build-ci-templates and with klok.dev (datamodel-fixtures.json).
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
## klok docs
|
|
651
|
+
|
|
652
|
+
```
|
|
653
|
+
klok docs [options] [command]
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
Read the platform documentation on docs.klok.dev, and publish this repository’s znai documentation there
|
|
657
|
+
|
|
658
|
+
### klok docs read
|
|
659
|
+
|
|
660
|
+
```
|
|
661
|
+
klok docs read [options] <doc-id>
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
Print the llm.txt of a documentation project on docs.klok.dev, the one markdown file with its whole content, read with your GitLab token. Cached under ~/.cache/klok/docs with the ETag, so a second read is one conditional request; without network the cache is served with a warning. With --json the document carries the content and where it came from; otherwise the content goes to stdout and one status line to stderr.
|
|
665
|
+
|
|
666
|
+
| Argument | Description |
|
|
667
|
+
|---|---|
|
|
668
|
+
| `<doc-id>` | required |
|
|
669
|
+
|
|
670
|
+
| Option | Description |
|
|
671
|
+
|---|---|
|
|
672
|
+
| `--out <file>` | Write the content to this file instead of stdout |
|
|
673
|
+
| `--refresh` | Fetch again even when the cache is current |
|
|
674
|
+
| `--token <token>` | GitLab personal access token with read_api (default: KLOK_GIT_APIKEY, then config klokApiKey) |
|
|
675
|
+
|
|
676
|
+
### klok docs list
|
|
677
|
+
|
|
678
|
+
```
|
|
679
|
+
klok docs list [options]
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
List the documentation projects on docs.klok.dev that your GitLab account may read, from the portal’s index: one line per project, its doc id (what `klok docs read` takes), title and description. With --json the document carries every field of the index.
|
|
683
|
+
|
|
684
|
+
| Option | Description |
|
|
685
|
+
|---|---|
|
|
686
|
+
| `--token <token>` | GitLab personal access token with read_api (default: KLOK_GIT_APIKEY, then config klokApiKey) |
|
|
687
|
+
|
|
688
|
+
### klok docs id
|
|
689
|
+
|
|
690
|
+
```
|
|
691
|
+
klok docs id [options] [path]
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
The doc id and documentation identity of a repository path (default: this repository, from CI_PROJECT_PATH or the git remote)
|
|
695
|
+
|
|
696
|
+
| Argument | Description |
|
|
697
|
+
|---|---|
|
|
698
|
+
| `[path]` | optional |
|
|
699
|
+
|
|
700
|
+
### klok docs lint
|
|
701
|
+
|
|
702
|
+
```
|
|
703
|
+
klok docs lint [options]
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
Check a znai documentation project: table of contents, links and metadata
|
|
707
|
+
|
|
708
|
+
| Option | Description |
|
|
709
|
+
|---|---|
|
|
710
|
+
| `--source-root <dir>` | Directory holding toc and meta.json (default: docs, then the repository root) |
|
|
711
|
+
|
|
712
|
+
### klok docs verify
|
|
713
|
+
|
|
714
|
+
```
|
|
715
|
+
klok docs verify [options]
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
Check that this repository’s klok-docs/ describes what it builds, before the merge request
|
|
719
|
+
|
|
720
|
+
| Option | Description |
|
|
721
|
+
|---|---|
|
|
722
|
+
| `--payload <file>` | The documentation payload (default: build/klok-docs/project-documentation.json) |
|
|
723
|
+
| `--base <ref>` | Compare against this ref (default: the merge request target, else origin/main) |
|
|
724
|
+
| `--strict` | Fail on warnings too |
|
|
725
|
+
|
|
726
|
+
### klok docs build
|
|
727
|
+
|
|
728
|
+
```
|
|
729
|
+
klok docs build [options]
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
Build this repository’s klok-docs/ with znai the way its documentation project will, upload nothing
|
|
733
|
+
|
|
734
|
+
| Option | Description |
|
|
735
|
+
|---|---|
|
|
736
|
+
| `--repo-path <path>` | Repository path the doc id is derived from (default: CI_PROJECT_PATH or the git remote) |
|
|
737
|
+
| `--znai <path>` | The znai executable (default: znai on PATH) |
|
|
738
|
+
|
|
739
|
+
### klok docs send
|
|
740
|
+
|
|
741
|
+
```
|
|
742
|
+
klok docs send [options]
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
Publish this repository’s klok-docs/ to the documentation chain (projects not built with the Klok Gradle plugin)
|
|
746
|
+
|
|
747
|
+
| Option | Description |
|
|
748
|
+
|---|---|
|
|
749
|
+
| `--repo-path <path>` | Repository path the identity is derived from (default: the CI project path or the git remote) |
|
|
750
|
+
| `--any-branch` | Publish outside CI or from a branch other than the default one, deliberately |
|
|
751
|
+
| `-n, --dry-run` | Build the payload and say what would be sent; publish nothing |
|
|
752
|
+
|
|
753
|
+
### klok docs publish
|
|
754
|
+
|
|
755
|
+
```
|
|
756
|
+
klok docs publish [options]
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
Build the znai project and upload it under this project’s doc id
|
|
760
|
+
|
|
761
|
+
| Option | Description |
|
|
762
|
+
|---|---|
|
|
763
|
+
| `--source-root <dir>` | Directory holding toc and meta.json (default: docs, then the repository root) |
|
|
764
|
+
| `--doc-id <id>` | Publish under this doc id instead of the derived one |
|
|
765
|
+
| `--repo-path <path>` | Repository path to derive from (default: CI_PROJECT_PATH or the git remote) |
|
|
766
|
+
| `--znai <path>` | The znai executable (default: znai on PATH) |
|
|
767
|
+
| `-n, --dry-run` | Resolve what would be published and build it with znai, upload nothing |
|
|
768
|
+
| `--no-build` | With --dry-run: only resolve the plan, do not run znai |
|
|
769
|
+
|
|
770
|
+
## klok fleet
|
|
771
|
+
|
|
772
|
+
```
|
|
773
|
+
klok fleet [options] [command]
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
Every deployed service: what it was built from, whether that is the latest, and rebuilding the ones that are not
|
|
777
|
+
|
|
778
|
+
### klok fleet status
|
|
779
|
+
|
|
780
|
+
```
|
|
781
|
+
klok fleet status [options]
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
One row per deployed workload: deployed tag, main, the last main pipeline, the broker client its build used against the catalog, and a verdict; --broker adds every producer and consumer on the broker
|
|
785
|
+
|
|
786
|
+
| Option | Description |
|
|
787
|
+
|---|---|
|
|
788
|
+
| `--manifests-repo <path>` | GitLab path of the deploy manifests repository (default: KLOK_MANIFEST_REPO, then klok/environment/ipaas/ipaas-service-deploy-manifests) |
|
|
789
|
+
| `--git-url <url>` | GitLab base URL (default: config gitUrl) |
|
|
790
|
+
| `--token <token>` | GitLab personal access token (default: KLOK_GIT_APIKEY, then config klokApiKey) |
|
|
791
|
+
| `-j, --jobs <n>` | Parallel requests to GitLab and the broker (default: `8`) |
|
|
792
|
+
| `--broker` | Also read every producer and consumer on the broker (needs your Vault login) |
|
|
793
|
+
| `--no-consumers` | Skip the search for broker client users that are not deployed |
|
|
794
|
+
| `--admin-url <url>` | Pulsar admin URL (default: KLOK_PULSAR_ADMIN_URL, then https://broker1.ipaas.se:8443) |
|
|
795
|
+
| `--token-url <url>` | Keycloak token endpoint of the broker superuser client (default: https://auth.ipaas.se/auth/realms/klok/protocol/openid-connect/token) |
|
|
796
|
+
| `--vault-addr <url>` | Vault (default: VAULT_ADDR, then https://vault.ipaas.se:8200) |
|
|
797
|
+
|
|
798
|
+
```
|
|
799
|
+
Verdicts, most urgent first:
|
|
800
|
+
stale: old broker client running (--broker only) the broker shows a connection of the service without Klok
|
|
801
|
+
metadata; overrules everything Git says
|
|
802
|
+
build failing the last pipeline on the default branch failed
|
|
803
|
+
stale: main ahead the default branch has commits the deployed image was not built from
|
|
804
|
+
stale: rebuilt, not rolled out (tag-only)
|
|
805
|
+
a later pipeline rebuilt the deployed commit under the same tag; the manifest did
|
|
806
|
+
not change, so the cluster still runs the deploying build
|
|
807
|
+
stale: catalog the deploying build used another broker client, Quarkus extension or klok-common
|
|
808
|
+
than the catalog has now (npm and Python: than the registry's latest)
|
|
809
|
+
unknown the deploying build, or its versions, could not be found
|
|
810
|
+
current none of the above
|
|
811
|
+
|
|
812
|
+
The deploying build: the newest commit of the manifests repository that set the image (its message names the
|
|
813
|
+
pipeline; an older commit is matched by its diff and the last pipeline of the commit before it). A digest-pinned
|
|
814
|
+
image (<tag>@sha256:<digest>) is matched to the pipeline whose image job kept that digest in its image-digest
|
|
815
|
+
artifact. Its versions: the gradle/klok-libs.versions.toml artifact of its build_java_job (or build_job); when it
|
|
816
|
+
has expired, the jars on the classpath in that job's log, or the catalog commit the log names. npm and Python
|
|
817
|
+
services: package-lock.json, uv.lock, poetry.lock or the requirements at the deployed commit.
|
|
818
|
+
|
|
819
|
+
--broker reads the superuser client from Vault (secret/klok/environment/pulsar/klok-broker) with your own Vault
|
|
820
|
+
token (VAULT_TOKEN or ~/.vault-token from `vault login`; in CI the job's login), trusts the Klok Root CA from
|
|
821
|
+
Vault's pki/ca/pem, and only reads. Vault's own certificate is self-signed: set VAULT_CACERT (as for the vault CLI)
|
|
822
|
+
or NODE_EXTRA_CA_CERTS. KLOK_PULSAR_TOKEN and KLOK_PULSAR_CA_FILE replace the Vault reads when you have them.
|
|
823
|
+
|
|
824
|
+
Broker client versions: Java integrations do not declare the broker client; it comes with the Quarkus extension.
|
|
825
|
+
The version shown is the resolved one: the classpath the build's documentation scan prints in the build log
|
|
826
|
+
("resolved"), else computed from the build's catalog snapshot and the POMs of what the project declares, the
|
|
827
|
+
highest of each library ("computed"). When the catalog's extension itself depends on an older broker client than
|
|
828
|
+
the catalog names, a WARNING says so: rebuilding integrations cannot help until the extension is released.
|
|
829
|
+
|
|
830
|
+
--broker also lists durable reply-subscriber-* subscriptions: broker clients before 0.3.7 made reply subscriptions
|
|
831
|
+
durable (klok-brokerclient-java#10). One with consumers makes its service "stale: old broker client running"; ones
|
|
832
|
+
without consumers are left behind, counted with their backlog, and never removed by this command.
|
|
833
|
+
|
|
834
|
+
Exit codes: 0 everything is current; 5 a workload is stale or its build is failing, or (with --broker) a connection
|
|
835
|
+
has no metadata or a durable reply subscription has consumers; 1 error. "unknown" alone does not fail. Use it as a
|
|
836
|
+
gate after a rebuild.
|
|
837
|
+
|
|
838
|
+
Examples:
|
|
839
|
+
klok fleet status # every tenant in the manifests repository
|
|
840
|
+
klok fleet status --tenant klok --no-consumers # one tenant, without the repository search
|
|
841
|
+
klok fleet status --broker # and who is connected to the broker
|
|
842
|
+
klok fleet status --json | jq '.status.rows[] | select(.verdict != "current") | .project'
|
|
843
|
+
```
|
|
844
|
+
|
|
845
|
+
### klok fleet rebuild
|
|
846
|
+
|
|
847
|
+
```
|
|
848
|
+
klok fleet rebuild [options]
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
Start the default branch pipeline of each selected project, wait for it and report how it ended; never cancels or retries
|
|
852
|
+
|
|
853
|
+
| Option | Description |
|
|
854
|
+
|---|---|
|
|
855
|
+
| `--manifests-repo <path>` | GitLab path of the deploy manifests repository (default: KLOK_MANIFEST_REPO, then klok/environment/ipaas/ipaas-service-deploy-manifests) |
|
|
856
|
+
| `--git-url <url>` | GitLab base URL (default: config gitUrl) |
|
|
857
|
+
| `--token <token>` | GitLab personal access token (default: KLOK_GIT_APIKEY, then config klokApiKey) |
|
|
858
|
+
| `-j, --jobs <n>` | Parallel requests to GitLab and the broker (default: `8`) |
|
|
859
|
+
| `--stale` | Every project whose workload `klok fleet status` calls stale (main ahead, rebuilt but not rolled out, an old catalog) |
|
|
860
|
+
| `--project <path>` | A GitLab project path to rebuild; repeatable |
|
|
861
|
+
| `-n, --dry-run` | Print what would be started, start nothing |
|
|
862
|
+
| `--parallel <n>` | Pipelines to run at the same time (default: `1`) |
|
|
863
|
+
| `--timeout <minutes>` | How long to wait for one pipeline before reporting it as still running (default: `60`) |
|
|
864
|
+
|
|
865
|
+
```
|
|
866
|
+
What it does: for each project, POST /projects/:id/pipeline on its default branch (a pipeline started through the
|
|
867
|
+
API runs in full, also when the last commit was typed docs), wait until it ends, print the result and, when it
|
|
868
|
+
failed, the failing job and the last lines of its log; then the next project. It never cancels, retries or deletes
|
|
869
|
+
a pipeline: one that runs past --timeout is reported as still running and left alone. "build failing" projects are
|
|
870
|
+
not part of --stale: fix the build first, then name them with --project. The token needs the api scope.
|
|
871
|
+
|
|
872
|
+
Redeploying: after each successful pipeline the command reads the deploy job's result (`klok manifest update`)
|
|
873
|
+
and says whether the manifest got a new image ("rolled out: <old> -> <new>") or kept its image ("unchanged"). A
|
|
874
|
+
deploy job that pins the digest (`--digest-file`, the integration template) rolls out every rebuild; one that writes
|
|
875
|
+
the tag alone rolls out nothing when the commit did not change.
|
|
876
|
+
|
|
877
|
+
Exit codes: 0 every pipeline succeeded (or --dry-run); 1 any did not, or an error.
|
|
878
|
+
|
|
879
|
+
Examples:
|
|
880
|
+
klok fleet rebuild --stale --dry-run # what would be started
|
|
881
|
+
klok fleet rebuild --stale # one at a time, waiting for each
|
|
882
|
+
klok fleet rebuild --project klok/integration/klok-api-odl --project klok/integration/klok-api-ai --parallel 2
|
|
883
|
+
klok fleet status # afterwards: is everything current?
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
## klok manifest
|
|
887
|
+
|
|
888
|
+
```
|
|
889
|
+
klok manifest [options] [command]
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
Deployment manifests in the GitOps repository that Argo CD applies
|
|
893
|
+
|
|
894
|
+
### klok manifest update
|
|
895
|
+
|
|
896
|
+
```
|
|
897
|
+
klok manifest update [options]
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
Set the image of one container in one manifest file, then commit and push it
|
|
901
|
+
|
|
902
|
+
| Option | Description |
|
|
903
|
+
|---|---|
|
|
904
|
+
| `--image <ref>` | Image to deploy, with its tag (default: KLOK_CONTAINER_IMAGE_SHA) |
|
|
905
|
+
| `--digest <sha256:hex>` | Pin the image to this digest: <image>:<tag>@<digest> (default: KLOK_IMAGE_DIGEST) |
|
|
906
|
+
| `--digest-file <path>` | Read the digest from this file, as kaniko --digest-file writes it; missing or empty is an error (default: KLOK_IMAGE_DIGEST_FILE) |
|
|
907
|
+
| `--file <path>` | Manifest in the repository (default: KLOK_MANIFEST_FILE, MANIFEST_DEPLOYMENT_FILE, then <CI_PROJECT_PATH>/<CI_PROJECT_NAME>-crds.yaml) |
|
|
908
|
+
| `--repo <path-or-url>` | GitLab path or git URL of the manifests repository (default: KLOK_MANIFEST_REPO, MANIFEST_REPO_URL, then klok/environment/ipaas/ipaas-service-deploy-manifests) |
|
|
909
|
+
| `--container <name>` | Container to update (default: KLOK_MANIFEST_CONTAINER, else the only one in the file) |
|
|
910
|
+
| `--workload <name>` | [<kind>/]<name> of the workload, when the container name repeats (default: KLOK_MANIFEST_WORKLOAD) |
|
|
911
|
+
| `--branch <name>` | Branch to push to (default: KLOK_MANIFEST_BRANCH, then main) |
|
|
912
|
+
| `-n, --dry-run` | Clone and edit, print the diff, commit and push nothing |
|
|
913
|
+
|
|
914
|
+
```
|
|
915
|
+
Digest: with --digest or --digest-file the manifest gets <image>:<tag>@sha256:<digest>. The tag stays for people;
|
|
916
|
+
the runtime pulls by the digest. A rebuild under the same tag (a rerun on the same commit, say for a new dependency
|
|
917
|
+
catalog) is then a new reference that Argo CD rolls out, while an image that came out byte for byte the same has
|
|
918
|
+
the same digest and changes nothing. Without a digest the manifest says only the tag, and a new image under an old tag is
|
|
919
|
+
never rolled out: nodes keep the copy they cached.
|
|
920
|
+
|
|
921
|
+
Credentials: in CI the job logs in to Vault with its identity token (VAULT_ID_TOKEN) and the role
|
|
922
|
+
<tenant>-ci-protected (KLOK_VAULT_DEPLOY_KEY_ROLE overrides it), which only pipelines of a protected branch or tag
|
|
923
|
+
can use, and reads the deploy key and the pinned host key from secret/<tenant>/CICD_KEY and
|
|
924
|
+
secret/<tenant>/KNOWN_HOSTS, where the tenant is KLOK_TENANT or the GitLab top level group. A tenant without that
|
|
925
|
+
role falls back to VAULT_AUTH_ROLE with a warning. --dry-run clones with the key too. By hand, your ssh-agent (SSH_AUTH_SOCK) or GIT_SSH_COMMAND
|
|
926
|
+
is used as it is. Commits are made as Klok CI unless GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL are set.
|
|
927
|
+
|
|
928
|
+
Examples:
|
|
929
|
+
klok manifest update # in an integration pipeline: everything from CI variables
|
|
930
|
+
klok manifest update --dry-run # clone, edit and show the diff; commit nothing
|
|
931
|
+
klok manifest update --digest-file image-digest # pin to the digest the image job wrote
|
|
932
|
+
klok manifest update --image repo.klok.dev/jttl/application/biljett-shop/biljett-shop:62b24af3 \
|
|
933
|
+
--file jttl/application/biljett-shop.yaml
|
|
934
|
+
klok manifest update --file jttl/application/quickrace-com-cronjobs.yaml \
|
|
935
|
+
--workload quickrace-com-payouts --container curl --image curlimages/curl:8.12.1
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
## klok pin
|
|
939
|
+
|
|
940
|
+
```
|
|
941
|
+
klok pin [options] [command]
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
Pins of released artifacts in infrastructure repositories, changed through a merge request
|
|
945
|
+
|
|
946
|
+
### klok pin update
|
|
947
|
+
|
|
948
|
+
```
|
|
949
|
+
klok pin update [options]
|
|
950
|
+
```
|
|
951
|
+
|
|
952
|
+
Set keys of a YAML file (a version, the sha256 of the released file) on a new branch and open a merge request
|
|
953
|
+
|
|
954
|
+
| Option | Description |
|
|
955
|
+
|---|---|
|
|
956
|
+
| `--repo <path-or-url>` | GitLab path or git URL of the infrastructure repository (or KLOK_PIN_REPO) |
|
|
957
|
+
| `--file <path>` | YAML file in that repository whose top-level keys hold the pin (or KLOK_PIN_FILE) |
|
|
958
|
+
| `--set <key=value>` | Set a top-level key; repeatable; the value may use placeholders |
|
|
959
|
+
| `--version-key <key>` | Set this key to the release version, the same as --set <key>={version} (or KLOK_PIN_VERSION_KEY) |
|
|
960
|
+
| `--sha256-of <url-or-file>` | Download (or read) this file and put its sha256 in --sha256-key; placeholders allowed (or KLOK_PIN_SHA256_OF) |
|
|
961
|
+
| `--sha256-key <key>` | The key that gets the sha256 (or KLOK_PIN_SHA256_KEY) |
|
|
962
|
+
| `--release <file>` | Release file with group=, artifact=, version= (or KLOK_PIN_RELEASE; default build/klok-release.properties, read when a value uses a placeholder) |
|
|
963
|
+
| `--name <name>` | What is pinned, for the branch and the title (or KLOK_PIN_NAME; default: the release artifact) |
|
|
964
|
+
| `--scope <scope>` | Conventional Commits scope of the commit and the merge request title (or KLOK_PIN_SCOPE) |
|
|
965
|
+
| `--docs-page <path>` | Page in the repository that says what to do after the merge; linked from the description (or KLOK_PIN_DOCS_PAGE) |
|
|
966
|
+
| `--download-attempts <n>` | Download attempts before giving up (or KLOK_PIN_DOWNLOAD_ATTEMPTS; default 30) |
|
|
967
|
+
| `--download-interval <seconds>` | Pause between download attempts (or KLOK_PIN_DOWNLOAD_INTERVAL; default 30) |
|
|
968
|
+
| `-n, --dry-run` | Hash, clone and edit, print the diff and the merge request; push nothing |
|
|
969
|
+
|
|
970
|
+
```
|
|
971
|
+
Placeholders, filled in from the release file:
|
|
972
|
+
{group} {group-path} {artifact} {version}
|
|
973
|
+
{version-url} the version URL-encoded (+ as %2B), for download URLs
|
|
974
|
+
{maven-central} https://repo1.maven.org/maven2/{group-path}/{artifact}/{version-url}/{artifact}-{version-url}
|
|
975
|
+
|
|
976
|
+
What it does: computes the values (the sha256 is of the downloaded file, retried while Maven Central's CDN catches
|
|
977
|
+
up with the release), clones the repository's default branch, changes only the named keys' values in place
|
|
978
|
+
(comments, order and quoting stay; a key the file does not have is an error), and pushes a new branch
|
|
979
|
+
klok/pin/<artifact>-<version> whose push options make GitLab open the merge request. No API token is needed.
|
|
980
|
+
When the default branch already has the values, or the branch already exists, it says so and exits 0.
|
|
981
|
+
It refuses to push to the default branch and never force pushes; a person merges the merge request.
|
|
982
|
+
|
|
983
|
+
Credentials: in CI the job logs in to Vault with its identity token (VAULT_ID_TOKEN) and the role
|
|
984
|
+
<tenant>-ci-protected (KLOK_VAULT_DEPLOY_KEY_ROLE overrides it), which only pipelines of a protected branch or tag
|
|
985
|
+
can use, and reads the tenant deploy key and the pinned host key from secret/<tenant>/CICD_KEY and
|
|
986
|
+
secret/<tenant>/KNOWN_HOSTS. The key needs write access to the repository, and the merge request is opened as the
|
|
987
|
+
GitLab user who added the key. What the key reaches and who can read it:
|
|
988
|
+
https://docs.klok.dev/klok-environment-build-ci-templates/ci/authentication, "What the deploy key reaches, and
|
|
989
|
+
why it is shared". By hand, your ssh-agent (SSH_AUTH_SOCK) or GIT_SSH_COMMAND is used.
|
|
990
|
+
|
|
991
|
+
Examples:
|
|
992
|
+
# The entry filter's release pipeline, after release_and_publish_job:
|
|
993
|
+
klok pin update --repo klok/environment/klok-environment-setup \
|
|
994
|
+
--file ansible-master/playbooks/group_vars/all/pulsar_entry_filters.yml \
|
|
995
|
+
--version-key pulsar_entry_filters_version \
|
|
996
|
+
--sha256-key pulsar_entry_filters_sha256 --sha256-of '{maven-central}.nar' \
|
|
997
|
+
--scope pulsar --docs-page klok-docs/pulsar/entry-filters.md
|
|
998
|
+
|
|
999
|
+
# By hand, a dry run against a release file you have:
|
|
1000
|
+
klok pin update --dry-run --release build/klok-release.properties --repo ... --file ... --version-key ...
|
|
1001
|
+
|
|
1002
|
+
# Without a release file:
|
|
1003
|
+
klok pin update --repo ... --file vars.yml --name my-tool --set my_tool_version=1.2.3
|
|
1004
|
+
```
|
|
1005
|
+
|
|
1006
|
+
## klok solutions
|
|
1007
|
+
|
|
1008
|
+
```
|
|
1009
|
+
klok solutions [options] [command]
|
|
1010
|
+
```
|
|
1011
|
+
|
|
1012
|
+
The integration solution registry (<tenant>/integration-solutions)
|
|
1013
|
+
|
|
1014
|
+
### klok solutions validate
|
|
1015
|
+
|
|
1016
|
+
```
|
|
1017
|
+
klok solutions validate [options]
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
Check every solutions/<SOLUTIONID>_<slug>/solution.meta.json against the descriptor contract
|
|
1021
|
+
|
|
1022
|
+
| Option | Description |
|
|
1023
|
+
|---|---|
|
|
1024
|
+
| `--root <dir>` | Checkout of the registry (default: the current directory) |
|
|
1025
|
+
|
|
1026
|
+
### klok solutions check
|
|
1027
|
+
|
|
1028
|
+
```
|
|
1029
|
+
klok solutions check [options]
|
|
1030
|
+
```
|
|
1031
|
+
|
|
1032
|
+
Compare the solution documents with the route classes on the default branch of every repository of the tenant in the workspace
|
|
1033
|
+
|
|
1034
|
+
| Option | Description |
|
|
1035
|
+
|---|---|
|
|
1036
|
+
| `--root <dir>` | Checkout of the registry (default: the current directory) |
|
|
1037
|
+
| `--workspace <dir>` | Workspace root that `klok sync` mirrors into (default: the configured workspace) |
|
|
1038
|
+
| `--tenant-short <short>` | Route id prefix of the tenant (default: the one the registry's solution ids share) |
|
|
1039
|
+
|
|
1040
|
+
## klok sync
|
|
1041
|
+
|
|
1042
|
+
```
|
|
1043
|
+
klok sync [options] [command]
|
|
1044
|
+
```
|
|
1045
|
+
|
|
1046
|
+
Mirror the GitLab repositories you can see into a local workspace
|
|
1047
|
+
|
|
1048
|
+
### klok sync clone
|
|
1049
|
+
|
|
1050
|
+
```
|
|
1051
|
+
klok sync clone [options]
|
|
1052
|
+
```
|
|
1053
|
+
|
|
1054
|
+
Discover every repository you can see and clone the missing ones
|
|
1055
|
+
|
|
1056
|
+
| Option | Description |
|
|
1057
|
+
|---|---|
|
|
1058
|
+
| `--git-url <url>` | GitLab base URL (default: config gitUrl) |
|
|
1059
|
+
| `-n, --dry-run` | Show what would happen and change nothing |
|
|
1060
|
+
| `-y, --yes` | Do not ask for confirmation |
|
|
1061
|
+
| `-w, --workspace <path>` | Workspace directory (default: config workspace) |
|
|
1062
|
+
| `--token <token>` | GitLab token (default: KLOK_GIT_APIKEY, then config klokApiKey) |
|
|
1063
|
+
| `-j, --jobs <n>` | Parallel git operations (default: `6`) |
|
|
1064
|
+
| `--no-summary` | Skip the Kloker summaries |
|
|
1065
|
+
| `--summary-jobs <n>` | Parallel summary calls (default: `8`) |
|
|
1066
|
+
|
|
1067
|
+
### klok sync pull
|
|
1068
|
+
|
|
1069
|
+
```
|
|
1070
|
+
klok sync pull [options]
|
|
1071
|
+
```
|
|
1072
|
+
|
|
1073
|
+
Fast-forward every repository in the workspace
|
|
1074
|
+
|
|
1075
|
+
| Option | Description |
|
|
1076
|
+
|---|---|
|
|
1077
|
+
| `-w, --workspace <path>` | Workspace directory (default: config workspace) |
|
|
1078
|
+
| `--token <token>` | GitLab token (default: KLOK_GIT_APIKEY, then config klokApiKey) |
|
|
1079
|
+
| `-j, --jobs <n>` | Parallel git operations (default: `6`) |
|
|
1080
|
+
| `--no-summary` | Skip the Kloker summaries |
|
|
1081
|
+
| `--summary-jobs <n>` | Parallel summary calls (default: `8`) |
|
|
1082
|
+
|
|
1083
|
+
### klok sync status
|
|
1084
|
+
|
|
1085
|
+
```
|
|
1086
|
+
klok sync status [options]
|
|
1087
|
+
```
|
|
1088
|
+
|
|
1089
|
+
Show dirty trees, unpushed commits and branches behind their remote (as of the last fetch)
|
|
1090
|
+
|
|
1091
|
+
| Option | Description |
|
|
1092
|
+
|---|---|
|
|
1093
|
+
| `-w, --workspace <path>` | Workspace directory (default: config workspace) |
|
|
1094
|
+
| `-j, --jobs <n>` | Parallel git operations (default: `12`) |
|
|
1095
|
+
| `-a, --all` | List every repository, not only the ones needing attention |
|
|
1096
|
+
| `--fetch` | Fetch every repository first, so "behind" is current |
|