@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 CHANGED
@@ -48,6 +48,7 @@ Credentials are written to `~/.config/klok/credentials.json` with mode 0600.
48
48
  | `klok agents update [--check] [--global]` | Fetch what moved in the platform and tenant catalogs; `--check` writes nothing and exits 5 when something is outdated. |
49
49
  | `klok agents status` | Per file and per catalog: current, outdated, missing or unreachable. |
50
50
  | `klok bead list\|show\|report` | Progress beads in the current repository. |
51
+ | `klok docs list` | The documentation projects on docs.klok.dev you may read, by doc id. |
51
52
  | `klok docs read <doc-id>` | Print a documentation project's `llm.txt` from docs.klok.dev, read with your GitLab token and cached. |
52
53
  | `klok docs id [path]` | The doc id of a repository path. |
53
54
  | `klok docs publish` | Build this repository's znai documentation and upload it to the docs portal. |
@@ -12,11 +12,18 @@ Before anything else, run `klok agents update --check`. Exit 5 means the install
12
12
  run `klok agents update` and read the refreshed files. Exit 0 means they are current, and any other code names
13
13
  what went wrong (no token, no network); say so instead of guessing.
14
14
 
15
+ On a workstation, `klok sync pull` then brings the workspace current before you read it: it fast-forwards every
16
+ canonical checkout under the workspace root, never merges or resets one, and skips `<root>/worktrees`. It is the one
17
+ sanctioned update of a canonical checkout. A service never clones a repository just to read it: klok.dev and the agent
18
+ read through the GitLab API, docs.klok.dev and the integration context. The `klok-cli` skill says which klok command
19
+ does what.
20
+
15
21
  The platform documentation is published at https://docs.klok.dev, one documentation project per repository, each
16
22
  exposing its whole content as one markdown file. Read it with klok-cli, which sends your GitLab token and caches
17
- the answer:
23
+ the answer. `klok docs list` comes first when you do not know the doc id:
18
24
 
19
25
  ```
26
+ klok docs list # the documentation projects you may read, by doc id
20
27
  klok docs read <doc-id> # the markdown on stdout, one status line on stderr; --json adds fetchedAt
21
28
  klok docs id [tenant/group/.../repo] # the doc id of a repository, this one by default
22
29
  ```
@@ -46,7 +53,7 @@ The `klok-docs` skill describes the lookup in detail. Cite the doc id you relied
46
53
 
47
54
  ## Tenant skills
48
55
 
49
- Next to the platform skills (`klok-docs`, `klok-solution`, `klok-route`, `klok-datamodel`, `klok-release`,
56
+ Next to the platform skills (`klok-docs`, `klok-cli`, `klok-solution`, `klok-route`, `klok-datamodel`, `klok-release`,
50
57
  `klok-worktree`) the skill directories hold your tenant's own skills, generated by KlokDocumentationEgress from the
51
58
  tenant's documentation publishes and served from the tenant's private catalog. The egress reads only tenant klok's
52
59
  publishes today, so another tenant has no tenant skills yet:
@@ -124,8 +131,9 @@ step by step procedure; the contract every agent follows is:
124
131
  exists, use a new id; never delete, reset or force reuse it.
125
132
  * Leave the canonical checkout's branch, files and uncommitted changes exactly as found. Never run `checkout`,
126
133
  `switch`, `pull`, `reset`, `clean`, `stash`, rebase or merge in the canonical checkout or in another session's
127
- worktree. Dirty canonical files are not a blocker: a worktree starts from committed history and does not copy
128
- uncommitted or ignored files; if the task needs them, ask for an explicit handoff.
134
+ worktree. The one exception is `klok sync pull`, which only fast-forwards a canonical checkout and reports one it
135
+ cannot fast-forward. Dirty canonical files are not a blocker: a worktree starts from committed history and does
136
+ not copy uncommitted or ignored files; if the task needs them, ask for an explicit handoff.
129
137
  * Do every edit, build and test in the task worktree, with explicit working directories or `git -C`. Recreate
130
138
  dependencies there; do not copy or symlink `.env`, credentials, `node_modules` or build output from another
131
139
  checkout. A worktree is not a sandbox: use isolated ports, containers and output directories where parallel
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: klok-cli
3
+ description: Which klok command does what on the Klok platform (klok-cli, `@klok/cli`), with the full reference of every command and option in reference.md. Use before running a klok command you have not run in this task, when a task needs the local workspace current (`klok sync pull`), a list of the documentation (`klok docs list`), an answer about the integration landscape (`klok agent ask`), or a check of the solution registry, the deployed fleet, the catalog, a CI job, a deploy manifest, a pin, a bead or a datamodel.
4
+ ---
5
+
6
+ # The klok command line
7
+
8
+ `klok` is the Klok platform's command line tool. It reads with your GitLab token (`KLOK_GIT_APIKEY`, or `--token`)
9
+ and your Keycloak login (`klok login`), and every command takes `--json` for one machine-readable document on stdout.
10
+ This page says which command to reach for. `reference.md` next to it lists every command, option and example of this
11
+ CLI version, generated from the program itself; when it is missing (an installer that copies `SKILL.md` only), run
12
+ `klok --help` and `klok <command> --help`.
13
+
14
+ ## When to use what
15
+
16
+ | You need | Run |
17
+ |---|---|
18
+ | to know the agent instructions and skills are current, at the start of a task | `klok agents update --check` (exit 5: run `klok agents update`) |
19
+ | the local workspace current before you read it | `klok sync pull` |
20
+ | a repository you can see in GitLab but do not have locally | `klok sync clone --dry-run`, then `klok sync clone` |
21
+ | what is dirty, unpushed or behind in the workspace | `klok sync status` (`--fetch` for a current "behind") |
22
+ | the documentation projects you may read | `klok docs list` |
23
+ | one project's documentation | `klok docs read <doc-id>`; `klok docs id <tenant/group/.../repo>` derives a doc id |
24
+ | an answer about the integration landscape, with links | `klok agent ask "<question>"`; `--session <first task id>` for a follow-up |
25
+ | the impact of a datamodel change | `klok agent impact <datamodel> --change minor\|major\|remove` |
26
+ | the solution registry checked against its contract, or against the code | `klok solutions validate`, `klok solutions check` |
27
+ | whether the deployed services run what `main` and the catalog say | `klok fleet status` |
28
+ | the platform catalog's agent assets or its dependents | `klok catalog publish-agents`, `klok catalog release-dependents` (both run in CI) |
29
+ | what a CI job is, whether a change is documentation only, where CI time goes | `klok ci env`, `klok ci docs-only`, `klok ci timings` |
30
+ | a pipeline's image in its deploy manifest | `klok manifest update --dry-run` (CI runs it without) |
31
+ | a release pinned in an infrastructure repository | `klok pin update ... --dry-run` |
32
+ | the beads of the current repository | `klok bead list`, `klok bead show <id>`, `klok bead report <id>` |
33
+ | the repository, root element and namespace a datamodel's class and name give | `klok datamodel names` |
34
+ | an XSD checked the way the datamodel pipeline checks it | `klok datamodel validate` |
35
+ | this repository's `klok-docs/` checked before the merge request | `klok docs build`, `klok docs verify` |
36
+
37
+ ## The workspace
38
+
39
+ `klok sync pull` brings the workspace current before you read it: every repository under the workspace root (config
40
+ key `workspace`, `KLOK_GIT_LOCAL_WORKSPACE`, default `~/devklok`) is fetched and fast-forwarded (`git pull
41
+ --ff-only`). It never merges, rebases or resets, so a checkout with local commits or a diverged branch is reported,
42
+ not changed, and `<root>/worktrees` (the task worktrees) is skipped. It is the one sanctioned update of a canonical
43
+ checkout, made on a workstation. Edits still happen in a task worktree (the `klok-worktree` skill). A service never
44
+ clones a repository just to read it: klok.dev and the agent read through the GitLab API, docs.klok.dev and the
45
+ integration context.
46
+
47
+ ## Reading
48
+
49
+ `klok docs list`, then `klok docs read <doc-id>`, is how to read the platform's documentation; the `klok-docs` skill
50
+ has the doc ids that matter most and what a 401, 403 or 404 means. `klok agent ask` asks Kloker, which reads the
51
+ solution registry, the integration context and the documentation you may read, and answers with links; it is the
52
+ quickest way to find which project, leg or topic handles something.
53
+
54
+ ## Exit codes
55
+
56
+ `0` ok, `1` error, `2` a task waits for input, `3` denied by policy, `4` not authenticated, `5` outdated (instructions,
57
+ or a deployed service). With `--json`, the document says what happened; messages go to stderr.