kibo CLI
With the kibo command line, you create Workspaces, work inside them, and script both. This page covers the commands you use most, how kibo waits for results, and how to repeat a command safely. Every flag of every command is listed under kibo commands.
Tip
Using kibo for the first time? Quickstart walks through installing it, enrolling, and creating a first Workspace.
Prerequisites
kiboinstalled from the release set. It has three builds: Linux/amd64, and macOS on Apple Silicon or Intel. For which one to choose, see Identity and enrollment.- An enrolled Operator identity on your machine. See Identity and enrollment.
No other token or password is needed. See How kibo connects.
A first session
Create a Workspace and keep its ID in a variable:
workspace_id=$(kibo workspace create --template "$template_id" --memory 1G -q)
kibo workspace get "$workspace_id"createwaits until the Workspace is available, for up to one hour. See Waiting for results.-qprints only the ID. Without it,createprints a summary: the first line is the Workspace ID and state, and the last line gives the command to open a terminal.- Later commands accept the first few characters of a Workspace or Volume ID, as long as they identify it uniquely, for example
kibo workspace get ws-01k6.
Run a command, copy a file in and back out, and open a terminal:
kibo workspace exec "$workspace_id" -- /bin/echo ready
printf 'release installation smoke\n' > local.txt
kibo workspace file put "$workspace_id" local.txt /data/local.txt
kibo workspace file get "$workspace_id" /data/local.txt downloaded.txt
cmp local.txt downloaded.txt
kibo workspace terminal "$workspace_id"Type exit in the remote shell to leave the terminal.
Commands by task
Each row shows one typical command. The task links to the page that covers the rest of that group. Replace template_id, workspace_id, and volume_id with real IDs.
Managing Workspaces
| Task | Command |
|---|---|
| List the Templates you can use | kibo template list |
| Create with more resources | kibo workspace create --template "$template_id" --cpu 2 --memory 4G --disk 20G |
| Find Workspaces by label | kibo workspace list --label team=infra |
| Label a Workspace | kibo workspace labels set "$workspace_id" team=infra tier=gold |
| Change CPU, memory, or disk | kibo workspace update "$workspace_id" --cpu 2 --memory 4G --disk 40G |
| Set an expiration time | kibo workspace expiration set "$workspace_id" --expires-in 8h |
| Stop and start | kibo workspace stop "$workspace_id" |
| Delete | kibo workspace delete "$workspace_id" |
| Check what a deletion released | kibo workspace cleanup-status "$workspace_id" |
Working inside a Workspace
| Task | Command |
|---|---|
| Run a command | kibo workspace exec "$workspace_id" -- /bin/echo ready |
| Open a terminal | kibo workspace terminal "$workspace_id" |
| Copy files in and out | kibo workspace file put "$workspace_id" local.txt /data/local.txt |
| Open a web service in a local browser | kibo workspace service http "$workspace_id" --tcp-port 8080 |
| Forward a TCP port to your machine | kibo workspace service forward "$workspace_id" --tcp-port 5432 |
| View a desktop | kibo workspace desktop view "$workspace_id" |
Network and data
| Task | Command |
|---|---|
| Allow access to the internet | kibo workspace network set "$workspace_id" public-internet |
| Create a Volume | kibo volume create --capacity 10G |
| Expand a Volume | kibo volume resize "$volume_id" --capacity 20G |
| Export a stopped Workspace | kibo transfer export "$workspace_id" |
Waiting for results
By default, workspace create, start, stop, and delete wait. After ctrl accepts the command, kibo keeps querying its result until the Workspace is AVAILABLE, STOPPED, or DELETED. It does not send the command again while it waits.
In a terminal, a progress line on standard error refreshes as the state changes. Otherwise, kibo prints a single line when the wait starts.
--wait-timeout limits the whole wait, one hour by default, and --timeout limits each request. --no-wait returns as soon as ctrl accepts the command, while the Workspace may still be CREATING or STOPPING. For these flags on every command, see Common command flags.
Important
Ending the wait does not cancel the command. After a wait timeout, Ctrl-C, or a lost connection, ctrl still carries out a command it has accepted, and kibo exits with code 18. The error message includes the Workspace ID, the command ID, the query command, and the last state seen. Query with that command ID instead of resubmitting with a different one.
- When creation fails, the error message gives the reason.
- When create or start gets no response after submitting the request,
kibosends it up to three times in total with the same ID and input. Stop and delete are not resent automatically. If there is still no result,kiboprints the ID so you can query it later. - Expiration actions are carried out by ctrl, so exiting
kibodoes not affect them.
Using kibo in scripts
| Need | Use |
|---|---|
| Only the ID of the result, for a variable | -q |
| Machine-readable output | --json. See JSON output |
| No confirmation prompt | --yes. Required when there is no terminal to prompt in |
| The result of the remote command | The exit code of workspace exec. See kibo exit codes |
When a waiting command succeeds, the JSON output is a WorkspaceCommandResult; its fields are listed under JSON output. result.current_workspace comes from one more query after the command completed. When that query fails, it is null and the reason is in result.current_error, but the command itself still succeeded.
With --no-wait, the output is the Workspace at the time ctrl accepted the command. Before an operation that depends on the current state, query again with kibo workspace get.
Command IDs and unknown results
Every write command carries a command ID, which makes it safe to repeat. kibo generates one unless you pass --command-id. Pass your own when a script may need to run the same command again:
kibo workspace stop "$workspace_id" --command-id stop-example
kibo --json workspace command get "$workspace_id" stop-exampleA command with an ID ctrl already has is not submitted again:
-
For the same Workspace and kind of command,
kiboreports the result of the existing command. While that command is still in progress,kibowaits for it; with--no-wait, it returns the in-progress record. -
For another Workspace or another kind of command, the command fails. Use a different ID.
-
If the original request is still in flight when you rerun, ctrl accepts only one of the two and rejects the other as a conflict. The command never runs twice.
-
When a request times out or its result is unknown, query with the same command ID, or rerun the same command with the same ID and parameters. A rerun returns the original command's result; check the current state separately with
kibo workspace get. -
A command that cannot be found does not mean the request failed. Do not resend with a different ID because of it.
-
For the rules shared by all write commands, including expected revisions, see Command IDs and expected revisions and Command IDs on the native API page.
How kibo connects
kibo reaches Kibotos over two paths:
| Path | Used for | Authentication |
|---|---|---|
| Control plane, to ctrl | Creating, querying, starting, and stopping Workspaces | mTLS with the Operator identity, trusting only the ctrl certificate saved at enrollment |
| Data plane, directly to the node that runs the Workspace | Running commands, transferring files, terminals, and similar operations | A short-lived session credential that kibo obtains while the command runs and never writes to disk. The connection trusts the system root certificates and the ctrl certificate, uses the same proxy settings as the control plane, and does not follow redirects |
For certificates, the identity directory, and proxies, see Identity, configuration, and connections.
Next steps
- Core concepts: Workspaces, Volumes, and their states.
- Guarantees and limits: when data is kept.
- kibo CLI reference: global flags, exit codes, and the JSON output format.
- API overview: the same operations from your own program.