TheDocumentation Index
Fetch the complete documentation index at: https://docs.rigbox.dev/llms.txt
Use this file to discover all available pages before exploring further.
rig CLI (and its rigbox alias — the same binary) is the primary way to deploy and operate Rigbox from a terminal. It is pre-installed in every workspace VM, and you can install it on your local machine too.
This page is the command reference. It is organised as:
Install & authenticate
Get the binary and log in.
Global flags
Output formats, JMESPath queries, scripted input, and
rig api.Deploy & rig.yaml
rig deploy, .env loading, and the full manifest schema.Command groups
workspace, app, snapshot, volume, build/release/rollback, and more.
Install
Inside a workspace
The CLI is already installed in every Rigbox workspace. Open a terminal and run:rig automatically switches into workspace-scoped mode (see Runtime modes). You do not need to log in, and account-wide commands are intentionally hidden.
On your local machine
Install the latest release with one command:rig and rigbox to $HOME/.local/bin. Confirm with rig --version.
Pin a version or change the install directory
For CI or reproducibility, the installer honours two environment variables:| Variable | Purpose | Default |
|---|---|---|
RIG_INSTALL_DIR | Install location for the binary. | $HOME/.local/bin |
RIG_VERSION | Pin to a specific release tag (e.g. v0.12.33). | latest |
The env vars must sit on the
bash that runs the script — not on the curl. In a pipeline, RIG_VERSION=… curl … | bash would set them on curl and the installer would still see the defaults.Shell completions
rig uninstall (add --purge-config to also drop saved credentials).
Authentication
Log in (local machine)
rig logout removes saved credentials (--purge also clears legacy config paths). rig whoami prints the current user and workspace.
External CLI configuration is stored in
~/.rigbox/config.json, including your auth token and persisted defaults.API keys
API keys (rb_…) are full-account credentials, shown once at creation and stored hash-only:
Runtime modes
The CLI behaves differently depending on where it runs:| Context | Auth method | Command surface |
|---|---|---|
| On your local machine | OAuth token via rig login | Full account + workspace control |
| Inside a workspace VM | Ambient workspace identity from the VM bridge | Workspace-local commands only |
rig detects /etc/rigbox/workspace.json and talks to the VM-local bridge at http://172.16.0.1:9090/rig/v1. No bearer token is sent — the bridge resolves your workspace from the VM’s source IP, so editing local config cannot switch identity. Account-wide commands (login, most workspace subcommands, template, recipe, ssh) are hidden in this mode; deploy, app, snapshot, volume, tools, and proxy helpers remain available.
Global flags
Every command accepts these global flags (they work before or after the subcommand):| Flag | Purpose |
|---|---|
--output <human|json|yaml> | Output format. Defaults to human; set a persistent default with rig config set output yaml. |
--query <JMESPATH> | Filter/transform the structured output with a JMESPath expression. |
--cli-input-json <FILE> | Read command inputs from a JSON file, or - for stdin. |
--cli-input-yaml <FILE> | Read command inputs from a YAML file, or - for stdin (conflicts with --cli-input-json). |
--generate-cli-skeleton | Print a fillable input template for the command, then exit. |
--no-pager | Do not pipe help output through a pager. |
Persisted defaults
Raw API access
rig api sends an authenticated request to any Rigbox API path, reusing your stored credentials:
Deploy
rig deploy is the core workflow. It reads a rig.yaml in the project directory, rsyncs your source into a workspace VM, runs the install/build steps, and brings the app up as a managed systemd unit reachable at <slug>.rigbox.dev.
--workspace is unset, deploy reuses the workspace bound in .rig.lock, or spawns a fresh one. rig deploy --prune-stale drops .rig.lock bindings to workspaces that no longer exist, then exits without deploying.
rig.yaml is the source of truth. A redeploy re-applies everything declared in it — including visibility, limits, and volumes — so transient CLI/UI edits get overwritten on the next deploy.Loading .env files
Deploy auto-loads dotenv files from the project directory and merges them into the environment used to resolve secrets: and env:. Disable with --no-env-file.
--stage <name> (or $RIG_ENV), deploy loads stage-specific files. Precedence, highest to lowest:
- real shell environment
.env.<stage>.local.env.local.env.<stage>.env
Blue-green and promote
Stage a change as a sibling app, verify it, then swap production traffic atomically:--promote requires --bluegreen. The previous production app is retained as a rollback target until you delete it.
Scaffold a manifest
The rig.yaml manifest
rig.yaml describes the app(s) to deploy. Multi-word fields use camelCase primarily, with snake_case accepted as an alias. There are two surface forms.
Single-app form
Three fields are required:name, port, and start (with install needed in practice for anything with dependencies).
secrets: values are read from your local shell at deploy time. Deploy fails fast (before anything ships) if a non-optional secret is unset, so you can export them all in one go.Field reference
| Field | Type | Notes |
|---|---|---|
name | string | Required. Slugified ([a-z0-9-], 2–64 chars) to form the subdomain. |
port | number | Required. Port the app listens on. |
start | string | Required. systemd ExecStart. |
install | string | Dependency-install command, compiled into the server-side install script. |
build | string | Build command run after install, before start. |
env | map | Static env vars baked into the unit. |
secrets | list | Local env vars forwarded at deploy time (NAME, {name, from}, or {name, optional}). |
credentials | map | Platform-minted values (generate, envVar). |
health | object | path (must start /), timeoutSeconds (default 60). |
params | list | UI knobs — see field list below. |
dependsOn | list | Workspace services that must be alive. |
restartPolicy | string | always (default), on-failure, no. |
workingDirectory | string | Payload extraction path. |
protocol | string | http (default), https, tcp. |
visibility | string/object | private (default), public, or { emails: [...] }. |
source | object | kind: local (default) or kind: git with repo/branch. |
ai | object | managed: true + optional providers to route through the AI proxy. |
limits | object | memoryMaxMb, cpuPercent, tasksMax (all optional). |
volumes | list | name, mountPath, sizeMb per entry. |
publish | object | Metadata for rig publish (vendor, slug, version, summary, tags, …). |
params: entry accepts: key (required), label, description, type (string default, number, boolean, secret, select, email, url, textarea), default, required, sensitive, options (for select: {value, label}), group, order, helpUrl, validationPattern, and envVar (surface the value as this env var on the unit — without it the value lands in metadata but the process can’t see it).
Multi-app form
A top-levelapps: map switches to project form: an optional workspace: envelope plus a name-keyed map of apps. Each app is either a local build context (path:) or a published recipe (ref:).
apps: accepts the same inline fields as the single-app form (minus name, which is the map key). dependsOn is topo-sorted across siblings. Mixing single-app keys (start/port at the top level) with apps: is rejected.
Command reference
Placeholders use
<WORKSPACE> (a name or ws-… id) and <APP> (a name or app-… id). Most lifecycle commands accept either form.Account
| Command | Description |
|---|---|
rig login / rig logout | Authenticate / clear credentials. |
rig whoami | Show the current user and workspace. |
rig status | Dashboard summary for the account (quota, usage). |
rig limits | Effective resource limits and current usage. |
rig capacity | Fleet workspace-slot capacity. |
rig api-key create|ls|rm | Manage account API keys. |
rig ai defaults | Set account AI defaults (--provider, --model, --mode managed|byok). |
rig ai usage | Show AI usage history. |
rig config set|get|unset|list | Persisted CLI defaults. |
rig completions | Generate/install shell completions. |
rig uninstall | Remove the local CLI install (--purge-config). |
workspace
Manage workspace lifecycle and configuration.| Subcommand | Key flags | Description |
|---|---|---|
ls | — | List all workspaces. |
spawn | --name, --template, --ram, --vcpu, --disk, --catalog (repeat), --env, --setup-script-id, --service-spec-id, --app-param, --wait-for-apps, --auto-size | Create and start in one step. |
new | --name, --template, --ram, --vcpu, --disk, --catalog, --setup-script-id, --service-spec-id | Create without starting. |
start / stop / restart | --workspace, (--wait-for-apps on start) | VM lifecycle. |
rm / cancel / retry | --workspace, --force | Delete, cancel in-progress creation, retry a failed creation. |
logs | --workspace, --follow | Stream workspace logs. |
ssh-info | --workspace | Print the canonical SSH connection info. |
metrics | --workspace | Live CPU/RAM/disk. |
services | --workspace | Background services tracked in the workspace. |
ports | --workspace | Ports the workspace is listening on. |
resize | --workspace, --ram, --vcpu, --disk | Resize VM resources. |
reconcile | --workspace | Reconcile apps with the template. |
env set|unset|get | --workspace, (--reveal on get) | Workspace env vars. |
ai mode|show | --workspace, (--reveal on show) | Workspace AI configuration. |
app
Manage apps inside a workspace. Inside a VM these are always scoped to the current workspace.| Subcommand | Key flags | Description |
|---|---|---|
ls | --workspace (optional) | List apps in a workspace or across all. |
new | --name, --port, --kind service|cli, --workspace, --description | Create an app. |
start / stop / restart | --app | App lifecycle. |
logs | --app, --follow | Stream app logs. |
rm | --app, --workspace, --force, --force-delete | Delete an app. |
share | --app, --public / --private / --emails a,b,c | Set route visibility (pick one mode). |
health | --app | Show runtime health. |
expose-port | --workspace, --port, --name, --wrap | Detect or expose a workspace port as an app. |
domain set | --app, --domain | Attach a custom domain. |
verify-domain | --app | Re-check DNS for a custom domain. |
param ls|get|set|unset | --app, then key/KEY=VALUE | Read and write catalog-app parameters. |
log-source ls|add|update|rm | --app, --type, --ref, --name, --primary, --source | Manage app log sources (systemd_unit, docker_container, file_path). |
rig app new --kind is service (long-lived server at a subdomain) or cli (interactive binary over SSH, no Caddy route). See Catalog Apps.
snapshot
volume
Manage persistent volumes that survive across deploys and reboots.rig.yaml under volumes: so a deploy provisions and mounts them automatically.
volume commands back the PersistentVolumes server feature. They may be unavailable until that feature flag is enabled for your account.build, release, rollback
Reproducible deploys separate build (produce an immutable image artifact) from run (activate a release that pins an image digest).| Command | Key flags | Description |
|---|---|---|
build | --workspace, --base-image, --install, --source-repo, --source-commit | Build a reproducible image and print its digest. |
release create | --workspace, --image-digest, --run-config | Create a release pinning an image digest. |
release ls | --workspace | List releases for a workspace. |
release activate | --workspace, --release | Activate a release. |
rollback | --workspace, --release | Activate a release (rollback alias). |
build, release, and rollback back the ReproducibleBuilds server feature. They may be unavailable until that feature flag is enabled for your account.ssh
Manage SSH public keys for your account.ssh-info with your SSH client:
tools
Launch and manage interactive workspace tools (architecture explorer, virtual browser, …).template
recipe
Publish and install community recipes. There are two kinds: app recipes (install into an existing workspace) and composition recipes (deploy a whole workspace).Registry refs use the required
-r/--ref flag (install, versions, delete, yank, deprecate). Positional arguments are for local file paths only (lint, info).publish
Publish arig.yaml (or a rendered manifest) to the community registry:
publish: block in rig.yaml supplies default vendor/slug/version/metadata; flags override it.
setup-script & service-spec
Reusable first-boot configuration attached to workspaces at creation time.proxy (workspace-only)
Inside a workspace VM, the managed AI proxy helpers wire your shell to the credit-metered proxy:on/off/env accept an optional route alias (openrouter, openai, v1). See Managed AI Proxy.
API reference
The CLI wraps the Rigbox REST API. For programmatic access, see:- Workspaces API — create, manage, and monitor workspaces
- Apps API — manage app routes and services
- SSH Keys API — register and manage SSH keys
- Templates API — browse available templates
- AI & Credits API — credits, usage, and AI configuration
rig api GET /v1/workspaces.