Tektona CLI

Install the tektona CLI, configure it with tektona login, and learn the config file format.

The tektona CLI manages sandboxes, API keys, and your active org and project from the shell. It wraps the same HTTP API as the SDKs and ships with helpers for SSH, VNC, and port forwarding into running sandboxes.

Install

npm install -g @tektona/cli

The npm package installs a small launcher that selects the platform-specific Tektona binary for macOS, Linux, or Windows. The Homebrew formula installs a native binary for macOS and Linux.

Verify:

tektona --version

Get started

Follow these steps once after installing. The whole flow takes a couple of minutes.

Create an API key

An API key belongs to your user account. A single key can reach every organization and project you're a member of. You pick which org/project a command acts on through the context (next steps), not by issuing a separate key per project. Sandbox commands still need an organization with at least one project to act on, so if you have none, create them in the Tektona console first.

Open the API Keys page of your Tektona console. Create a key and copy it. You'll paste it in the next step.

Configure the CLI with tektona login

tektona login

The wizard asks three things:

API URL. Don’t accept the default — type this deployment’s endpoint at the prompt: https://api-dev.tektona.ai. You can also set it directly without the wizard: tektona ctx set-url https://api-dev.tektona.ai.

API key. Paste the key from step 1. Input is hidden on a terminal. Press Enter on its own to keep an already-stored key.

Context. Pick a default organization/project from the list of everything your key can reach.

Pressing Enter at a prompt keeps the current value and moves on, so you can re-run tektona login later to change just one setting.

Confirm the context

Sandbox commands act on a single org and project, and both are required. The login wizard set them. Check with:

tektona ctx show
Org:     acme-corp            (config)
Project: backend              (config)
API:     https://api-dev.tektona.ai (config)

Change it any time with the interactive picker (needs a configured API key):

tektona ctx set

or non-interactively, passing a single org/project token, or the org and project as two arguments:

tektona ctx set acme-corp/backend   # qualified ref
tektona ctx set acme-corp backend   # two arguments

By default ctx set writes a repo-local .tektona/config.json at the root of your git repository (the toplevel of the repo or worktree), no matter which subdirectory you run it from. This way each checkout or worktree carries its own org/project binding, parallel agents working in different repos never clobber each other, and the context can never bleed in from a directory above the repo. The file is meant to be committed, so a clone already knows its context. (Outside a git repository it uses the current directory. Running ctx set in your home directory is refused, so use --global there.) Pass --global to write the machine-wide default in ~/.config/tektona/config.json instead:

tektona ctx set --global acme-corp/backend   # machine-wide default

List every org/project pair your key can reach with tektona ctx list.

The API endpoint is part of your context too. Point the CLI at this deployment without re-running the wizard:

tektona ctx set-url https://api-dev.tektona.ai

Unlike ctx set, this always writes the global ~/.config/tektona/config.json and has no --global flag. api_url is global-only because it controls where your API key is sent, so a committed, repo-local file must never be able to redirect it. Setting the public-cloud endpoint (https://api.tektona.ai) clears the stored value so the built-in default keeps tracking.

To browse your projects without the interactive picker, use tektona project ls. It lists every project you can access across all your organizations (you can belong to many), and each row's CONTEXT column is the exact org/project token you paste into tektona ctx set:

tektona project ls                  # all your projects, across every org
tektona project ls --org acme-corp  # filter to one org
tektona project ls -o json          # machine-readable

That's it. You're ready to create a sandbox.

Configuring without the wizard

Everything tektona login does can also be set directly.

API endpoint. Persist it with tektona ctx set-url https://api-dev.tektona.ai, or set it directly via the --api-url flag, the TEKTONA_API_URL env var, or api_url in ~/.config/tektona/config.json. When set in more than one place the order is: flag, environment variable, config file. This deployment's endpoint is https://api-dev.tektona.ai. Setting the public-cloud endpoint (https://api.tektona.ai) clears the stored value so the built-in default keeps tracking.

API key. Pass it to tektona api-key set tektona_xxx, or run tektona api-key set with no argument to be prompted (input hidden). Inspect it with tektona api-key show (add --unmask for the full key). You can also pass --api-key per command or export TEKTONA_API_KEY. Resolution order: flag, env var, stored file.

Context. Resolved through a four-step chain (highest to lowest): --org / --project flags → TEKTONA_ORG / TEKTONA_PROJECT env vars → the repo-local .tektona/config.json at your git repository root (or the current directory when you're not in a git repo) → the global ~/.config/tektona/config.json. An explicitly empty env var (e.g. TEKTONA_ORG=) clears the value rather than falling through to a lower layer.

Config file format

The CLI keeps two files under ~/.config/tektona/, plus an optional repo-local file at your git repository root:

FilePermissionsPurpose
~/.config/tektona/api_key0600The raw API key string. Plain text.
~/.config/tektona/config.json0600Active context and per-feature settings (machine-wide).
.tektona/config.json (repo root)0644Committed project binding, at the git repo root. Only org, project, and vnc are read from it.

config.json schema:

{
  "api_url": "https://api-dev.tektona.ai",
  "org": "acme-corp",
  "project": "backend",
  "vnc": {
    "openBrowser": true
  },
  "update_check": true
}

All fields are optional. Set api_url to point the CLI at this deployment's endpoint (https://api-dev.tektona.ai). Commands that act on a project require both org and project from flags, environment variables, or this file.

The same schema is used at both scopes, but the repo-local .tektona/config.json is read for org, project, and vnc only. api_url, the API key, and update_check are global-only. They are never read from the repo-local file. api_url in particular stays global because it controls where your API key is sent, so a committed, repo-local file must not be able to redirect it.

Resize a sandbox

Change a sandbox's CPU, memory, or disk after it was created:

tektona sandbox resize <id> [--cpu N] [--memory N] [--disk N] [--force]

Only the flags you pass change. Anything you omit keeps its current value. The command prints the shape before and after the change.

FlagPurpose
--cpuNew vCPU count
--memoryNew memory, in GiB
--diskNew disk size, in GiB (grow-only: must not be smaller than the current size, and equal is a no-op)
--forceRequired to shrink memory below its current value
# Give a sandbox more CPU and memory
tektona sandbox resize sbx_123 --cpu 4 --memory 8

# Grow the disk to 20 GiB
tektona sandbox resize sbx_123 --disk 20

# Shrink memory (requires --force)
tektona sandbox resize sbx_123 --memory 2 --force

The new shape is persisted immediately, but CPU and memory changes are not hot-plugged into a running VM — they take effect on the sandbox's next reboot (tektona sandbox reboot <id>, or a stop and start). A pause and resume does not apply them: resuming a hibernated or suspended sandbox restores it at the CPU and memory it had when it was paused, because the saved memory image is bound to that size. Disk can only grow, and downsizing memory needs --force because shrinking RAM can disrupt workloads relying on it. Live CPU/memory hot-plug and online disk growth are planned follow-ups.

Reboot a sandbox

Reboot a running sandbox by restarting its VM from the same disk.

tektona sandbox reboot <id> [-y]

This is an orderly reboot: the guest first shuts its processes down (they receive SIGTERM and get a few seconds to exit before SIGKILL) and flushes its filesystem, so in-memory state and running processes are lost but recently written files survive. A shutdown hook that needs longer than that short grace period won't finish. The disk is preserved. If the guest doesn't respond within a few seconds, the reboot falls back to a hard reset — the same as tektona sandbox reset — so a stuck sandbox can always be rebooted; in that case un-synced writes can be lost. Reboot is only valid while the sandbox is running, so resume a paused sandbox first.

tektona sandbox reboot 01JF...
tektona s reboot 01JF... -y   # skip confirmation

The command blocks until the VM is running again. Add -o json to get machine-readable output (requires -y).

Reset a sandbox

Hard-reset a running sandbox — like pulling the power.

tektona sandbox reset <id> [-y]

Unlike reboot, reset sends the guest no shutdown signal and does not flush the filesystem first, so recently written, un-synced files may be lost. Use it when a sandbox is unresponsive and won't shut down cleanly; otherwise prefer reboot. The disk and IP are preserved.

tektona sandbox reset 01JF...
tektona s reset 01JF... -y   # skip confirmation

Update notice

The CLI checks periodically for a newer version and prints a small notice when one is available. To disable, set TEKTONA_NO_UPDATE_CHECK=1 or add "update_check": false to ~/.config/tektona/config.json.

Global flags

Every command accepts these:

FlagEnvPurpose
--api-keyTEKTONA_API_KEYAPI key (overrides stored key)
--api-urlTEKTONA_API_URLAPI URL (overrides config)
--orgTEKTONA_ORGOrganization context override
--projectTEKTONA_PROJECTProject context override
-o, --output(none)Output format (json for machine parsing)

What's next

On this page