Kibotos

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

  • kibo installed 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"
  • create waits until the Workspace is available, for up to one hour. See Waiting for results.
  • -q prints only the ID. Without it, create prints 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

TaskCommand
List the Templates you can usekibo template list
Create with more resourceskibo workspace create --template "$template_id" --cpu 2 --memory 4G --disk 20G
Find Workspaces by labelkibo workspace list --label team=infra
Label a Workspacekibo workspace labels set "$workspace_id" team=infra tier=gold
Change CPU, memory, or diskkibo workspace update "$workspace_id" --cpu 2 --memory 4G --disk 40G
Set an expiration timekibo workspace expiration set "$workspace_id" --expires-in 8h
Stop and startkibo workspace stop "$workspace_id"
Deletekibo workspace delete "$workspace_id"
Check what a deletion releasedkibo workspace cleanup-status "$workspace_id"

Working inside a Workspace

TaskCommand
Run a commandkibo workspace exec "$workspace_id" -- /bin/echo ready
Open a terminalkibo workspace terminal "$workspace_id"
Copy files in and outkibo workspace file put "$workspace_id" local.txt /data/local.txt
Open a web service in a local browserkibo workspace service http "$workspace_id" --tcp-port 8080
Forward a TCP port to your machinekibo workspace service forward "$workspace_id" --tcp-port 5432
View a desktopkibo workspace desktop view "$workspace_id"

Network and data

TaskCommand
Allow access to the internetkibo workspace network set "$workspace_id" public-internet
Create a Volumekibo volume create --capacity 10G
Expand a Volumekibo volume resize "$volume_id" --capacity 20G
Export a stopped Workspacekibo 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, kibo sends 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, kibo prints the ID so you can query it later.
  • Expiration actions are carried out by ctrl, so exiting kibo does not affect them.

Using kibo in scripts

NeedUse
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 commandThe 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-example

A command with an ID ctrl already has is not submitted again:

  • For the same Workspace and kind of command, kibo reports the result of the existing command. While that command is still in progress, kibo waits 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:

PathUsed forAuthentication
Control plane, to ctrlCreating, querying, starting, and stopping WorkspacesmTLS with the Operator identity, trusting only the ctrl certificate saved at enrollment
Data plane, directly to the node that runs the WorkspaceRunning commands, transferring files, terminals, and similar operationsA 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

On this page