CLI
The CLI is a thin client over the server API; it does not talk to Docker directly, so a server must be running.
KAIO_ADDR (default 127.0.0.1:8080) says which server it talks to. Point it
elsewhere for one command with KAIO_ADDR=10.0.0.2:8080 kaio-cli status, or
reach a node of the cluster with node <name> run. unix:/run/kaio/kaio.sock
talks to a server on a Unix socket, and credentials in a URL
(https://ci:$TOKEN@kaio.example.net) are sent as Basic auth on every call,
the shell’s WebSocket included.

Global flags
Section titled “Global flags”| Flag | Effect |
|---|---|
--json |
Emit machine-readable JSON instead of formatted tables |
--version |
Print the CLI’s version and build SHA, then exit, without reaching the server |
-h, --help |
Describe the command and its arguments; on a group, list its subcommands |
General
Section titled “General”kaio-cli status # every container, grouped by stackkaio-cli health # health checkkaio-cli version # this CLI's version, and the server'skaio-cli events # recent historykaio-cli events --follow # live SSE tailkaio-cli tui # launch the interactive TUIstatus lists the containers under their stack. The stack’s own row sums the
CPU, memory and network traffic of its containers, and a last line gives the
totals of the containers listed, all of them or only those a filter kept, with
the share of the host’s cores when the server reports them. CPU
follows Docker’s scale, where 100% is one core.
kaio-cli status --sort cpu # heaviest stacks first, heaviest containers first insidekaio-cli status --filter blog # stacks, containers or images whose name holds "blog"
--sort takes attention (the default: stacks with a container not running,
an update waiting, variables pending or a critical CVE come first), name, cpu, memory,
net or vulns. With --json, status keeps printing the flat list of
containers, in that order and with that filter. container ls stays the flat
list, one row per container, in the server’s order, for scripts that read it.
version prints the CLI’s own version first, with the git SHA it was built
from in parentheses, then asks the server for its own, so a CLI left behind
after an upgrade shows up as two numbers that disagree:
cli: 0.8.0 (4af081d)server: 0.8.0The server line reads unreachable at <addr> when nothing answers there, and
version --json reports that as "server": null, with the SHA on its own
sha field. A build made outside a git checkout, and without KAIO_GIT_SHA
set, stamps dev instead of a SHA.
Containers
Section titled “Containers”kaio-cli container lskaio-cli container start <id>kaio-cli container stop <id>kaio-cli container restart <id>kaio-cli container pause <id>kaio-cli container unpause <id>kaio-cli container rm <id>kaio-cli container logs <id> [--follow] [--tail <n>]kaio-cli container shell <id> # interactive shell, Ctrl-] to exitStacks
Section titled “Stacks”kaio-cli stack ls # state, version, update, env, CVEs, host access, externalkaio-cli stack show <name>kaio-cli stack deploy <name> <compose_file> [--env-file .env [--secret KEY]] [--accept-risks] [--allow-port-clash] [--wait [--wait-timeout 120]] [--expected-version N] [--dry-run]kaio-cli stack rm <name>kaio-cli stack start <name>kaio-cli stack pause <name>kaio-cli stack unpause <name>kaio-cli stack recreate <name>kaio-cli stack update <name> [--wait [--wait-timeout 120]] [--expected-version N] [--dry-run]kaio-cli stack restart <name> [--accept-risks]kaio-cli stack logs <name> [--follow] [--tail <n>]kaio-cli stack scan <name> # Trivy vulnerability scankaio-cli stack check-update <name>kaio-cli stack versions <name>kaio-cli stack rollback <name> <version> [--accept-risks] [--allow-port-clash] [--wait [--wait-timeout 120]] [--expected-version N] [--dry-run]kaio-cli stack version-rm <name> <version>Copying a stack to another server
Section titled “Copying a stack to another server”kaio-cli stack copy <name> --to prod-02 # definition only, not startedkaio-cli stack copy <name> --to prod-02 --with-volumes # carry the data acrosskaio-cli stack copy <name> --as web-staging # clone it here under another namekaio-cli stack copy <name> --to prod-02 --dry-run # show the plan, change nothingkaio-cli stack copy <name> --as web-02 --publish 8091:9091 --startkaio-cli stack copy <name> --as web-03 --port-offset 2000 --startkaio-cli stack copy <name> --as web-02 --env SITE_URL=https://staging.example.netkaio-cli stack copy <name> --as web-02 --env-file staging.envkaio-cli stack copy <name> --to prod-02 --accept-risks # its file hands the host to a serviceA clone on the same host claims the ports its source already holds, so the copy
is refused rather than written unusable (--allow-port-clash accepts it anyway). --publish old:new (repeatable) and --port-offset N
rewrite only the ports: entries of the copy’s compose file; --env and
--env-file override its variables. A port written as ${HTTP_PORT}:80 is left
to the variables.
The source is never stopped, written to or removed, and a copy that fails part
way is undone on the destination. --to and --from name nodes as
kaio-cli node ls does; leaving one out means this server, so a copy that stays
here needs a different name with --as.
Without --start the copy is written but not brought up: two live copies would
contend for the same DNS, webhooks, queues and mail. --allow-binds accepts
that mounted host paths stay behind, and --allow-anonymous-volumes accepts
losing volumes Docker named itself. Both are refusals by default, because
either one silently produces a copy that looks healthy and is missing data. A
stack whose file hands the host to a service is refused as a deploy is, until
--accept-risks.
See the API route for what the plan contains and what stops a copy before it starts.
Stack environment
Section titled “Stack environment”Saved as pending until stack apply. See
Environment variables.
kaio-cli stack env ls <name> # secrets are maskedkaio-cli stack env set <name> TAG=1.27 DB_PASSWORD=s3cret [--secret]kaio-cli stack env unset <name> TAGkaio-cli stack env import <name> .env # merge a .env filekaio-cli stack apply <name> [--accept-risks] [--allow-port-clash] [--wait] [--expected-version N] [--dry-run] # redeploy with the pending environmentImages, volumes, networks
Section titled “Images, volumes, networks”Each of these three nouns exposes the same three commands:
kaio-cli image lskaio-cli image rm <id>kaio-cli image prune
kaio-cli volume lskaio-cli volume rm <name>kaio-cli volume prune
kaio-cli network lskaio-cli network rm <id>kaio-cli network prunels adds a STACKS column: the stacks whose containers use the image, volume
or network, - when none does. volume prune removes every unused volume,
named ones included, the equivalent of docker volume prune -a.
Cluster
Section titled “Cluster”See Multiple servers.
On the control plane:
kaio-cli cluster token # mint a join token: one server, once, within 24 hourskaio-cli cluster token --rotate # retire every unused token first; enrolled servers are not affectedkaio-cli cluster info # control plane? member? neither?On the server joining it:
kaio-cli join <control-plane> --join-token <t> [--name <n>] [--advertise <host:port>]kaio-cli join 10.0.0.1:8080 --token-stdin # read the token from stdinkaio-cli cluster leave # leave: tells the control plane, then forgets--name defaults to the joining server’s own host name; the control plane
sanitises it and suffixes it if it is taken. --advertise is rarely needed:
the server reports its own KAIO_ADDR, and the control plane supplies the
address the request arrived from when that is a wildcard. Pass it when neither
is what others reach the server at: behind NAT, or a reverse proxy.
The Kaio servers that have joined this one. See Multiple servers.
kaio-cli node ls # the control plane, then each node's last probekaio-cli node show <name>kaio-cli node rm <name>kaio-cli node check [<name>] # probe one node, or every node
kaio-cli node <name> run <command> # run any command on that nodenode <name> run forwards through this server’s gateway, so every command works
there: node prod-01 run stack ls, node prod-01 run health, even
node prod-01 run tui. A node that is not in the registry has no route and
answers Node '<name>' has not joined this cluster.
Names that would collide with the subcommands above (ls, show, rm,
check, run, help) are never handed out: a host called run is enrolled as
run-2.
Nodes enter this list by running kaio-cli join on them, and nothing here edits
one: a server is the source of truth about its own address. node rm drops a
member, which comes back by joining again.
Access
Section titled “Access”kaio-cli whoami # who the server takes you for, and your levelkaio-cli audit # who did what, newest firstkaio-cli audit --limit 200kaio-cli doctor # settings that leave the daemon open, and their fixwhoami answers at any level, so it is the first thing to run when a command
gets 403:
user: alicelevel: writevia: proxysource: 127.0.0.1groups: kaio-devs
audit reads the audit log and
doctor the diagnosis, both at
admin. doctor adds what it sees on the CLI’s side, such as credentials in
a KAIO_ADDR sent over plain HTTP, and exits with 1 when a finding is a
danger:
warn proxy-without-secret Identity headers are trusted from the proxy's address alone: anything else on that address can claim to be anyone fix: Generate a secret with `openssl rand -hex 32`, set KAIO_PROXY_SECRET_FILE, and have the proxy send it as X-Kaio-Proxy-SecretSystem
Section titled “System”kaio-cli system prune [--volumes]Scripting
Section titled “Scripting”--json turns any command into a data source:
# Stacks with a pending updatekaio-cli --json stack ls | jq '.[] | select(.update_available) | .name'# Nodes that are not answeringkaio-cli --json node ls | jq -r '.[] | select(.status != "online") | "\(.name) \(.last_error)"'A pipeline drives these same commands over HTTP, with the published image and its entrypoint overridden: see Deploy from CI.
Kaio, built by Régis Gaidot