kl
Lists the commands and options of kl, the command-line program inside a workspace.
Last updated
On this page
Commands
The CLI inside a workspace or a capsule, with no install or login: it uses the credentials of the workspace. In a capsule, kd pkg uses a credential for that capsule's packages alone. Builds run in the workspace and push to your registry. On your laptop, use kode.
The reference below is generated from the command definitions; kl --help prints the same.
kd
the kode command inside a workspace: build on your builder, push to your registries
kd container
Container images: build, push (copy a tag the registry already has), prune the build cache
kd container build
Build in this workspace and push to a connected registry: kd container build -t hello:1 .
| Argument | Help |
|---|---|
--tag | Image name, repeatable: hello:1 is {host}/{namespace}/hello:1 of the chosen registry; a name that starts with a connected host is taken whole |
--registry | The registry connector to push to; needed when several are connected and none is yours alone |
--file | Dockerfile path |
--build-arg | Build argument as KEY=VALUE, repeatable |
--platform | Target platform, for example linux/amd64 |
--no-cache | Skip the build cache |
<context> | Build context directory |
kd container push
Copy an image the registry already has to another name: kd container push hello:1 hello:latest
| Argument | Help |
|---|---|
--registry | The registry connector both names are in |
<src> | The image the registry already holds |
<dst> | The new names to copy it to |
kd container prune
Free buildkit's build cache; --all also drops what a later build would reuse
| Argument | Help |
|---|---|
--all |
kd container images
What a connected registry holds under its namespace: every image and its tags
| Argument | Help |
|---|---|
--registry | The registry connector to list |
--owner | Another namespace to list instead of the connector's own; an empty one lists everything the credential sees |
<name> | List only this image's tags, without walking the catalog |
kd pkg
The packages of this workspace or capsule
kd pkg list
The declared packages with the versions they are locked at
kd pkg add
Declare packages: kd pkg add jq nodejs@20 (attr or attr@version)
| Argument | Help |
|---|---|
<entries> | Package attributes, optionally pinned as attr@version |
kd pkg rm
Undeclare packages by name; a version suffix on the argument is ignored
| Argument | Help |
|---|---|
<entries> | Package names to remove |
kd pkg update
Re-resolve every pinned entry against the index
kd env
The desk this workspace is in and its environment (read-only)
Notes
A build pushes as it finishes. There is no local image and no separate push step. Use kd container push only to give another name to an image that the registry already holds. kl hf needs the program first: kd pkg add python3Packages.huggingface-hub; without it, kl hf says so and exits.
kd git-credential is the git credential helper. Git runs it, you do not. It asks Kode for a read-only credential for github.com and gitlab.com over HTTPS. A credential that it gets keeps working until it expires, up to one hour. Nothing revokes it. See Code in a job.
Outside a workspace kd stops with a message ending kl runs inside a kode workspace: it reads the credentials that the platform gives to the workspace. On your laptop use kode.
kd reads the workspace token from /etc/kode/ssh/workspace-token. The exec tool of an agent runs in a capsule that hides /etc/kode, so exec cannot run kd. An agent uses the matching tools instead: workspace with get, packages, container_build, and container_push. See Agent tools.
A workspace has no container engine, so docker run, docker pull, and docker ps do not apply. The first build starts buildkit inside the workspace; it keeps its cache under ~/.cache/buildkit and stops with the workspace. After a build, kd prints each pushed name as NAME@sha256:DIGEST. With one registry connector, kd uses it. With several, it uses the one that is yours alone, or refuses and asks for --registry. See Container registries.
Other programs run the hidden verbs: kd ide serve is the tool server, kd credential-helper get gives registry logins to docker-credential-kd, and kl capsule run is the command of a capsule.
| Message | Cause | Action |
|---|---|---|
no workspace credential at /etc/kode/ssh/workspace-token — kl runs inside a kode workspace | The platform has not written the credential file yet. | Wait a short time and run the command again. |
jq: not in the package list | kd pkg rm names a package that the list does not hold. | Use a name from kd pkg list. |
no registry is configured | You and your team have no connected container registry. | Connect a container registry. |
several registries are connected: NAMES; pass --registry | More than one registry fits and none is yours alone. | Add --registry with one of the names. |
no registry named NAME; connected: NAMES | --registry names a connector that you cannot use. | Use one of the names in the message. |