// the cli
Your machines, from your own terminal
Last updated 22 October 2026
One binary, kube-labs. Sign in once in the browser, then create AI sandboxes and machines, open a real SSH session to any of them, forward ports, use kubectl, and let your scripts and AI agents do the same. Nothing to paste, no key to manage.
curl -sf https://kube-labs.com/cli/install.sh | shkube-labs sandbox create --image claude --units 2 --wait kube-labs ssh claude-1
Install
curl -sf https://kube-labs.com/cli/install.sh | shOn Linux and macOS (Intel or Apple silicon) the installer picks the build for your system, checks it against the published checksums and puts kube-labs in ~/.local/bin; nothing runs as root. On Windows the PowerShell line installs to %LOCALAPPDATA%\kube-labs and adds it to your PATH; scoop install https://kube-labs.com/cli/kube-labs.json works too. SSH on Windows needs the built-in OpenSSH client (on by default since Windows 10).
Every download is at kube-labs.com/cli/. To update, run the install line again.
Sign in
kube-labs auth login
Your browser opens a kube-labs page showing a short code; the terminal shows the same code. Check they match, click Authorize, and the terminal is signed in. On a server with no browser, open the printed link on your phone instead. Sign in with whatever you use on the website: Google, GitHub or a password.
The CLI keeps a token on your computer (90 days, in its own config folder, readable only by you). It is listed under Profile → CLI & tokens, where you can revoke it at any time; a revoked token stops working within a minute, open SSH sessions included. kube-labs auth logout revokes it from the terminal.
Your first sandbox
kube-labs images # what you can create kube-labs sandbox create --image claude --units 2 --wait kube-labs sandbox list
--image claude is the Agent Sandbox (Claude Code and Codex preinstalled); claude-desktop adds a desktop; hermes, openclaw, n8n and ollama are the other agents. A size is in units, 1 unit = 1 vCPU and 2 GB; the Agent Sandbox needs 2. --wait returns when the machine is running and, for the Agent Sandbox, when its control panel answers, which is usually about ten seconds. --count 3 creates three at once, named name-1 to name-3.
For an ordinary machine (Ubuntu, Python, Node, Go, Rust, Docker, a database) use kube-labs vm create with the same flags. The two commands are otherwise identical; sandbox machines appear on your AI agents page and are billed to agent units, vm machines on the Machines page and to your general plan.
Stop a machine to keep its disk without using units; delete it to remove it for good: kube-labs sandbox stop claude-1, kube-labs sandbox delete claude-1 --yes.
SSH, scp and your editor
kube-labs ssh claude-1 # a root shell kube-labs ssh claude-1 -- 'uname -a; df -h' # one command kube-labs exec claude-1 -- sh -c 'cd app && make test' kube-labs cp ./project claude-1:/root/project -r
This is a real OpenSSH session end to end: the CLI runs your system ssh and scp, and the first connection to a machine authorizes the CLI's own key there by itself. There is no password and no key file to copy. The session rides the same https path as the website, so it works from any network.
Once, to make every other tool work:
kube-labs ssh-config
From then on ssh claude-1.kube-labs, scp, rsync -e ssh, ssh -L, VS Code Remote-SSH, Cursor and JetBrains Gateway all reach your machines by name. Machines inside a stack or a playground are stack/name (for example st/agent).
A machine you recreated under an old name shows a host-key warning; run kube-labs ssh --forget old-name once.
Ports and web apps
kube-labs port-forward claude-1 -L 3000:3000 # http://localhost:3000 → the machine kube-labs url claude-1 3000 --open # a private https link, opens the browser kube-labs url claude-1 panel # the Agent Sandbox's control panel
port-forward works on every machine and stays up until Ctrl-C. url gives you a link on the machine's own https address; it signs your browser in for 12 hours and nobody else can use it.
Kubernetes clusters
kube-labs vm create --image k3s-linux --units 2 --wait --name k kube-labs kube config k > ~/.kube/kube-labs-k.yaml KUBECONFIG=~/.kube/kube-labs-k.yaml kubectl get nodes
The kubeconfig holds no secret: kubectl asks kube-labs kube token for a fresh 15-minute token on every call, through the standard exec plugin. It works for a standalone K3s machine, a K3s or kubeadm playground's API node, and any kubectl from 1.31 on, plus Helm, k9s and Lens.
Stacks
kube-labs sandbox create --image claude --name st --addon postgres --addon k3s --wait kube-labs ssh st/agent
A stack is the Agent Sandbox plus machines wired to it by name: runner, git, postgres, mysql, mongo, nexus, harbor, k3s, docker, hermes, n8n, ollama. --wait prints the provisioner's steps. On the agent, STACK.md and /etc/kmv/stack.env say what is wired and how to reach it. Stacks are part of the AI Agents plan.
Scripts and CI
kube-labs auth token create --name ci --scopes vms:write,vms:connect --expires 90d export KUBE_LABS_TOKEN=kmv_... kube-labs sandbox create --image claude --name ci-$RANDOM --wait --json | jq -r 'select(.event=="ready").name'
Every command takes --json and prints exactly one JSON document; with --wait or logs -f it prints one event per line. Errors go to stderr with the API's own code, and the exit code says what happened: 0 ok, 1 error, 2 usage, 3 not signed in, 4 plan limit, 5 no capacity, 6 wrong state. Prompts never appear when the output is not a terminal; --yes answers them.
A token for a script is created with the same browser approval and shown once. Give it only the scopes the job needs: vms:write to create and delete, vms:connect to SSH. No token can reach account settings, billing or admin.
AI agents and MCP
Every Agent Sandbox and coding machine ships with the CLI and a Claude Code skill that teaches it, so an agent running on one of your machines can make and use others. On your own computer, give an agent the same knowledge:
kube-labs docs # the reference, written for agents claude mcp add kube-labs -- kube-labs mcp # Claude Code / Claude Desktop / Cursor
The reference is also at kube-labs.com/cli/llms.txt and the skill at kube-labs.com/cli/skill/SKILL.md. The MCP server offers the same actions as the commands, nothing more: list, create, start, stop, delete, run a command, get a link, images, limits, logs.
Every command
| kube-labs auth login | Sign in through the browser. Also auth status, auth logout. |
| kube-labs auth token create --name ci --scopes vms:write,vms:connect --expires 90d | A token for scripts, CI or an agent, shown once. |
| kube-labs sandbox create --image claude --units 2 --wait | Create and boot an AI sandbox; --count 3 makes three. |
| kube-labs sandbox create --image claude --addon postgres --addon k3s --wait | A stack: the sandbox plus machines wired to it. |
| kube-labs vm create --image ubuntu --units 1 --wait | An ordinary machine, not billed as an agent. |
| kube-labs sandbox list [--all] | Your sandboxes; --all adds every machine. Same for vm list. |
| kube-labs sandbox get | start | stop | restart | delete --yes | logs -f <machine> | Lifecycle. delete removes the disk too. |
| kube-labs ssh <machine> [-- command] | A root shell on the machine, by name. |
| kube-labs exec <machine> -- sh -c 'cd app && make test' | One command; its exit code is yours. |
| kube-labs cp ./dir <machine>:/root/dir -r | Copy files either way (scp underneath). |
| kube-labs port-forward <machine> -L 3000:3000 | localhost:3000 reaches the machine's port 3000. |
| kube-labs url <machine> 3000 --open | A private https link to a port (or an app such as panel). |
| kube-labs ssh-config | Then plain ssh <machine>.kube-labs, scp, rsync, VS Code. |
| kube-labs kube config <cluster> > ~/.kube/kl.yaml | kubectl against a k3s or kubeadm machine, no secret in the file. |
| kube-labs images | limits | docs | version | What you can create, what your plan allows, the agent reference. |
| kube-labs mcp | An MCP server for Claude Desktop, Claude Code, Cursor. |
Flags accepted anywhere: --json, --yes, --host, --token. Environment: KUBE_LABS_TOKEN, KUBE_LABS_HOST, NO_COLOR.
Plans and limits
The CLI follows your plan exactly as the website does: images, units, how many machines, daily minutes. kube-labs limits shows where you stand. SSH, exec, cp and port-forward are part of the Pro and AI Agents plans; on Free the command says so. When a request is refused, the message names the plan that allows it.
Troubleshooting
"not signed in": run kube-labs auth login; the token may have been revoked or expired. "is stopped": kube-labs sandbox start name. "no machine named": kube-labs sandbox list --all; machines in a stack are stack/name. Host key changed: kube-labs ssh --forget name. "ssh was not found" on Windows: enable the OpenSSH Client in optional features. Machines in a lab work too; the nodes of a mock-exam sitting refuse SSH on purpose.
Security
Your machine's SSH server is the one you talk to; kube-labs relays the bytes between your ssh and the machine and never sits inside the session. The relay is the same authenticated https path the web terminal uses, so nothing new is exposed on the internet. A token can only do what its scopes say and is revocable from your profile; revoking it closes any open session. The CLI never puts a token in a command line, a URL or a log.
Questions? Write to us from your inbox.