CLI
Install and use the krova CLI — authenticate, manage Cubes, SSH in, open private tunnels and database clients, run commands and copy files, stream webhooks, switch between accounts and script it from your terminal.
krova is the official command-line interface for Krova Cloud. It talks to the same public REST API as the SDK, so anything you can do in the dashboard you can also do from your terminal: list and create Cubes, SSH in, open a private tunnel to a service running inside a Cube, and verify webhook deliveries locally. It is open-source and published on npm as @krovacloud/cli.
Install
Install globally with npm (or pnpm / yarn / bun). This puts a krova command on your PATH. It's a pure Node.js CLI (requires Node.js 22 or newer) — no native binary and no extra toolchain to install.
npm install -g @krovacloud/cliVerify the install and check your version:
krova versionUpgrade the same way you installed — re-run npm install -g @krovacloud/cli to move to the latest release. To check whether a newer one exists first, run krova update. It never installs anything: if there is a newer release it prints the exact install command to run.
krova updateAuthenticate
Every command runs against a context — a named bundle of an API key, a space, and (optionally) a base URL, stored in ~/.config/krova/config.json (written with owner-only 0600 permissions); the key itself goes in your OS keychain when there is one. There are two ways to create one.
Browser login (recommended)
krova login uses the OAuth 2.0 Device Authorization flow: it opens Krova Cloud in your browser, you approve a short code, and the CLI stores the resulting key — no copy-pasting secrets.
krova login
# On a headless machine, print the URL instead of opening a browser:
krova login --no-browserPaste an API key
If you already have an API key (created per space from Settings → API keys in the dashboard — see API keys), store it directly:
krova auth login --api-key kro_xxxxxxxx
# Check what's currently in effect and where it came from:
krova auth statusAn API key is scoped to a single space, so the CLI resolves your space automatically — you never have to paste a space ID.
Where the key is stored
When there is an OS keychain, the CLI keeps the API key there: the macOS Keychain, or the Linux Secret Service (through secret-tool, from libsecret-tools). The config file then holds only the context's settings. Without a keychain (Windows, headless Linux, or secret-tool not installed) the key stays in the 0600 config file, and krova prints one line saying so. krova whoami and krova auth status show which one is in use. A key you passed with --api-key or KROVA_API_KEY never touches the keychain.
Keys already saved in the config file keep working and are moved only when you ask:
krova auth migrate-keychain # move saved keys into the keychain
# CI: keep new keys in the config file instead
KROVA_NO_KEYCHAIN=1 krova auth loginThe keychain keeps the key out of plaintext files and backups of your home directory. It doesn't protect it from other programs running as you.
Log out
krova auth logout removes a saved context and its key from this machine. It only clears the local copy: the API key keeps working until you revoke it in Settings → API keys.
krova auth logout --context team-prodManaging Cubes
The cubes command group covers the full lifecycle. The two most common read verbs also have top-level shortcuts, so krova list and krova get work without the cubes prefix (matching krova ssh).
krova list # list every Cube (alias: krova ls, krova cubes list)
krova get my-api # show one Cube by name or ID (krova cubes get)
krova cubes power-off my-api # stop compute billing (data is preserved)
krova cubes wake my-api # start a stopped Cube
krova cubes restart my-api # cold-restart (picks up a refreshed kernel)
krova cubes rename my-api my-api-v2 # 1 to 64 printable characters; names need not be unique
krova cubes resize my-api --vcpu 4 --ram 8 --disk 40 # any of the three; disk only grows
krova cubes update my-api --idle-timeout 60 # power off after 60 idle minutes ("off" turns it off)
krova cubes delete my-api # permanently delete a Cube
krova cubes protect my-api # termination protection: delete is refused until you unprotect
krova cubes unprotect my-api
krova cubes ssh-port my-api --port 2222 # port INSIDE the Cube sshd listens onCubes can be referenced by name or ID anywhere a <cube> argument is expected. In a terminal, krova cubes delete asks [y/N] first, because deleting is permanent; -y / --yes skips the question, and scripts and pipes never get one.
krova cubes resize sends only the sizes you give it. The change is queued, and it either applies live or restarts the Cube, so check the result with krova get. In a terminal it shows the current and new size and asks first, because a RAM decrease, or a vCPU change on a Cube that can't add vCPUs while running, restarts the Cube.
--idle-timeout <minutes> works with the create and update subcommands of krova cubes. It powers a Cube off after that many minutes without activity, so a forgotten Cube stops costing money. It takes a whole number from 10 to 10080 (7 days), or off. krova get shows the setting as Idle timeout, with Last active. See Cubes for what counts as idle.
Creating a Cube
--name, --image, and --ssh-key are required. The SSH key is your public key — its contents are written to the Cube's authorized_keys at boot, so keep the matching private key handy (see SSH into a Cube below).
krova cubes create \
--name my-api \
--image ubuntu-24.04 \
--region us \
--ssh-key "$(cat ~/.ssh/id_ed25519.pub)" \
--vcpu 1 --ram 2 --disk 20Run krova images and krova regions to see the valid slugs. --vcpu, --ram (GB), and --disk (GB) default to 1, 1, and 10. Optional: --user-data (a cloud-init script), --idempotency-key (a token that dedupes retried creates for 24 hours, so a network hiccup can't create two Cubes), and --termination-protection (the Cube cannot be deleted until you run krova cubes unprotect).
SSH into a Cube
krova ssh <cube> looks up the Cube's SSH host and port from the API and hands off to your system ssh. It uses your own SSH keys — the CLI never sees or transmits your private key.
krova ssh my-api # interactive shell
krova ssh my-api -- uptime # run one command and exit
krova ssh my-api -i ~/.ssh/my-key # pick a specific private key
krova ssh my-api -L 5432:localhost:5432 # forward a local port to a service in the Cube
krova ssh my-api -R 8080:localhost:80 # reverse-forward a port back to the CubeEverything after -- runs as a remote command instead of opening a shell. -L/-R are repeatable and map straight to ssh -L/-R — for example, forward Postgres out of a Cube with -L 5432:localhost:5432 and then connect a local client to localhost:5432 over the encrypted channel, without exposing the database publicly.
Host-key checking stays on. When Krova Cloud returns a Cube's host keys, the CLI pins them and uses strict verification. Until then it falls back to normal SSH trust-on-first-use — you approve the fingerprint on the first connection, and it's remembered afterward.
"Permission denied (publickey)"
This is an SSH-key mismatch, not a CLI error: the Cube reached you fine, but the key you offered isn't in its authorized_keys. Cube only accepts the public key you set when it was created. Fix it by pointing ssh at the matching private key:
krova ssh my-api -i ~/.ssh/the-key-you-created-it-with
# or load it into your agent once, then plain 'krova ssh my-api' works:
ssh-add ~/.ssh/the-key-you-created-it-withNote that plain ssh only auto-offers default key names (like ~/.ssh/id_ed25519). If your key has a custom name and isn't loaded into your agent, always pass -i.
Private tunnels, database clients, exec and copy
These use the same pinned host keys and strict host-key checking as krova ssh. For a database, a private tunnel is safer than a public TCP mapping: the port is reachable only from your machine, over your SSH key.
krova tunnel my-api 5432 # localhost:5432 -> the Cube's port 5432
krova tunnel my-api 15432:5432 # localhost:15432 -> the Cube's port 5432
krova connect my-api --port 5432 # free local port, prints localhost:<port>
krova connect my-api --port 5432 --json
krova psql my-api [--user postgres] [--db postgres] [--port 5432]
krova redis my-api [--port 6379]
krova mysql my-api [--user root] [--db <name>] [--port 3306]
krova exec my-api -- uname -a # no terminal; exits with the remote exit code
krova cp ./site.tar.gz my-api:/tmp/ # upload
krova cp -r my-api:/var/log ./logs # download a directoryTunnels listen on 127.0.0.1 only. psql, redis and mysql open a tunnel on a free local port, run the client (psql, redis-cli or mysql, which must be installed), and close the tunnel when it exits, with the client's exit code. They never take a password as a flag; the client prompts for it.
exec joins the words after -- and the remote shell runs them, like ssh. Put global flags such as --space before the --. In cp, exactly one side is <cube>:<path>, and a remote path can't start with -. Write a local name that contains a colon as ./a:b, or cp reads the part before the colon as a Cube. These commands refuse to run until Krova Cloud has a recorded host key for the Cube; krova ssh still connects, with ssh's own host-key prompt.
Catalog
Inspect what's available to build with. These are read-only and don't require picking a Cube.
krova regions # regions with available capacity
krova images # OS image slugs you can pass to --image
krova pricing # per-resource hourly pricingDomains, snapshots & TCP mappings
Manage a Cube's attached resources. Each takes a Cube name or ID and supports --json.
# Custom domains
krova domains list my-api
krova domains add my-api --domain app.example.com --port 8080
krova domains add my-api --domain shop.example.com --port 3000 --proxy-protocol v2
krova domains set-origin my-api <domain-id> https # the Cube serves HTTPS itself
krova domains set-proxy-protocol my-api <domain-id> off # v1, v2 or off
krova domains rm my-api <domain-id>
# Snapshots + restore
krova snapshots list my-api
krova snapshots create my-api --name nightly
krova snapshots restore my-api <snapshot-id> # replaces the Cube's disk
krova snapshots rm my-api <snapshot-id>
# TCP port mappings (expose a Cube port on the host)
krova tcp list my-api
krova tcp add my-api --port 5432 --whitelist 203.0.113.4/32
krova tcp rm my-api <mapping-id>Backups
A backup keeps a Cube's disk and configuration after the Cube is gone. Each command takes a backup name or ID and supports --json. You can offer another space its own copy: it has 48 hours to accept, and pays for its copy from then. Your backup and your bill stay the same.
krova backups list
krova backups get nightly
krova backups download nightly # a link valid for 15 minutes; anyone holding it can download the disk
krova backups share nightly <destination-space-id>
krova backups shares # pending shares into and out of this space
krova backups accept <share-id> # run in the destination space
krova backups decline <share-id>
krova backups cancel <share-id> # withdraw a share this space offeredThese need the Backups permissions on your key's member: View Backups for list, get and shares, Manage Backups for the rest.
Contexts (multiple accounts & spaces)
Contexts work like kubectl / aws profiles: one per API key (and therefore per space). Switch between a personal space and a team space, or between prod and a test space, without re-authenticating each time. Both krova login and krova auth login create a context (named after your space by default, or pass --context <name>).
krova context list # all contexts (alias: krova ctx ls)
krova context current # the active one
krova context use team-prod # switch
krova context rename old new
krova context delete team-prod
krova whoami # current context, space, key, and base URLkrova whoami, krova auth status and krova context list --json mask the API key. Add --show-secrets to print it in full. krova whoami also shows when the key expires (never for a key that doesn't).
Override the active context for a single command with --context <name>.
Webhooks
Manage the webhook endpoints of the active space. add prints the endpoint's signing secret once; save it then, because it is never shown again.
krova webhooks list
krova webhooks add --url https://example.com/hook --events cube.running,cube.stopped
krova webhooks get <endpoint-id>
krova webhooks deliveries <endpoint-id> --limit 20 # recent delivery attempts
krova webhooks rm <endpoint-id>krova webhooks listen runs a local HTTP receiver that verifies each delivery's signature and pretty-prints the event — handy for developing against Krova Cloud webhooks without deploying.
krova webhooks listen --secret "$KROVA_WEBHOOK_SECRET"
# customize the bind address and path:
krova webhooks listen --addr 127.0.0.1:4666 --path /hooks --secret "$KROVA_WEBHOOK_SECRET"The signing secret can also come from the KROVA_WEBHOOK_SECRET environment variable. Deliveries with a bad or missing signature are rejected and reported, so you can trust every event you see.
Scripting & automation
Pass --json to any command to get machine-readable output instead of a table — pipe it into jq or a script.
krova list --json | jq -r '.[] | select(.state=="running") | .name'For CI and headless environments, configure the CLI entirely from the environment — no interactive login needed:
KROVA_API_KEY— the API key to use.KROVA_SPACE_ID— the default space (usually auto-resolved from the key).KROVA_CONTEXT— select a stored context by name.KROVA_BASE_URL— optional; the API base URL, which defaults to the Krova Cloud production API.KROVA_WEBHOOK_SECRET— default secret forwebhooks listen.
The equivalent per-command flags — --api-key, --space, --context, --base-url, --json, and --timeout (default 30s) — are global and work on every command. Precedence is flag → environment variable → stored context.
Troubleshooting
- Permission denied (publickey) — SSH key mismatch. See SSH into a Cube — pass
-iwith the key the Cube was created with. - "SSH info isn't available on this server yet" — your CLI is newer than the server. Nothing to do on your end; it resolves once Krova Cloud is on a current release.
- 401 / request rejected — the API key is missing, revoked, or scoped to a different space. Run
krova auth statusto see what's in effect, orkrova loginagain. - Command not found — run
krova <command> --help(or justkrova) to list the exact subcommands; not every group has the same ones.
Next steps
- API keys — create and scope the key the CLI authenticates with.
- Cubes — sizing, power off/start, and how billing works.
- REST API reference — the same API the CLI is built on, for when you want raw HTTP or another language.
- Developer tools — the SDK, MCP server, webhook verifier, and n8n node.
