Skip to main content
levelrail-cli is a scriptable client for the control plane’s HTTP API. Everything it does goes through /api/v1, with the same tokens and permissions as the dashboard, so you need no SSH key and no open port on your servers. This page lists every command group with its subcommands and the flags you will use most. Run levelrail-cli with no arguments for the command list, or levelrail-cli <command> <subcommand> -h for any command’s own flags. Commands are shown as levelrail-cli .... If you rename the binary, the command name follows it (the CLI reads its name from os.Args[0]). The server is a separate binary, levelrail, which has a few maintenance commands of its own, such as setup-token, restore-snapshot, restore-db, recover-admin, upgrade-note (record who swapped the binary by hand), and healthcheck. Those are in Installing and Disaster recovery.

Install and sign in

curl -fsSL https://levelrail.com/install-cli.sh | sh
--device prints a short code that you approve in the dashboard, the same model as gh auth login. Credentials are saved to ~/.config/levelrail-cli/credentials. auth login saves the new token to the credentials file and does not print it; add --print-token to see it once. Plain-http targets work on loopback. up on a folder without a git remote uploads it, like deploy <dir>. The API URL env var is LEVELRAIL_API_URL or APP_API_URL (the first wins). For CI, create an API token under Settings, API tokens and pass it with --token, LEVELRAIL_TOKEN or APP_API_TOKEN. Each command resolves its target in this order, and an explicit flag always wins: Login pins the server. auth login prints the server’s name and fingerprint (compare it with the one on the approval page) and saves its identity in the profile. Every later request first checks that the URL still answers as that server and refuses to send the token otherwise, naming the fix: auth login --reauth to log in to the new server, or auth trust-server to pin the one now answering. A profile saved before pinning existed asks once to confirm the fingerprint (--yes or APP_TRUST_SERVER=yes for scripts). APP_API_TOKEN keeps working and only prints a warning when the profile pins a different server. auth status and auth whoami show the pinned server. Manage more than one control plane with named profiles: levelrail-cli auth login --profile staging, then --profile staging on any command. levelrail-cli profile list shows them.

Updating the CLI

self-update is an alias of update, and version --check is a shortcut for update --check. update --check exits 0 when the check itself worked, even when you are out of date, unless you add --exit-code: then it exits 10 when an update is available. It honors --json and --output. --channel stable|beta (or LEVELRAIL_CHANNEL) works like install-cli.sh: stable only considers stable releases, beta also considers prereleases, and with neither the newest stable release wins, falling back to a prerelease only when no stable one ships your binary. The previous binary is kept next to the new one as levelrail-cli.bak; to roll back run mv levelrail-cli.bak levelrail-cli in that directory. When a package manager owns the binary (Homebrew, Nix, /usr/bin) the command refuses and names the right upgrade command; --force overrides that. On a non-writable directory it prints the sudo and install-cli.sh commands to use. update downloads the asset for your OS and architecture, verifies its checksum and the release’s Sigstore signature, runs the new binary once to confirm its version, then atomically replaces the running file. If the signature or checksum cannot be verified, or the directory is not writable (a package manager path, or a root-owned /usr/local/bin: update it that way or re-run with sudo), nothing is changed. In CI mode or without a terminal it needs --yes. Windows is not supported in place: re-run install-cli.ps1. Interactive runs print one line to stderr when a newer release exists, at most once per interval. It never runs in CI mode, with --json output, or for help, version and update, and it is cut off after a short wait so it cannot slow a command.

Scripting: --json and exit codes

A mistyped command or flag gets a did-you-mean line and a next step (run levelrail-cli <verb> --help) instead of the whole usage text. Empty lists say what to run next, for example no apps yet: run levelrail-cli apps create --help, and name -A when a project scope hid the apps. Every command that returns data or a result supports --json (shorthand for --output json), and --query takes a JMESPath expression. With --json, stdout carries only the JSON result. The exceptions are completion bash|zsh|fish (a shell script) and control-plane-backups help-dr (a static runbook). A test walks the command tree and fails when a new command has no --json and is not on that exempt list. On failure, --json also prints an error object to stdout (the message still goes to stderr):
error is the original field. code is one of validation, network, unauthorized, forbidden, not_found, conflict, rate_limited, invalid_request, server_error, api_error. http_status, retry_after (rate limits) and hint appear when they apply. Exit codes are stable and shared by every command: Codes 3 and 4 are broad on purpose so existing scripts keep working; the JSON error object carries the finer distinction.

CI mode

The CLI reads LEVELRAIL_TOKEN, LEVELRAIL_API_URL and LEVELRAIL_PROFILE as env-only auth. Precedence: flag, then these, then APP_API_TOKEN / APP_API_URL / APP_PROFILE, then the saved profile. With CI=true, LEVELRAIL_CI=1, or stdin or stdout not a terminal, the CLI never prompts (a command that needs input exits non-zero and names the flag or env var to set), prints no color and shows no animation. NO_COLOR is honored everywhere. auth whoami prints a source: line (flag, env name or profile), never the token.

Scripting: --debug

--debug works anywhere on the command line (before or after the subcommand) and traces every outgoing request this invocation makes to stderr: method, URL, and the response status and timing, one line per call. It never prints request or response headers or bodies, so Authorization and any token value never appear, even in debug mode; a token that somehow ended up in a URL’s query string is also redacted. stdout is untouched, so --debug composes with --json/--query for scripting.

Experimental command groups

Some groups are off by default and stay hidden from --help and shell completion until the shell you run the CLI from sets APP_EXPERIMENTAL. This page marks them. The keys are ai-chat (ai, settings ai-assistant), ai-models (models), load-balancer (lb), iac (apply, diff, export) and cloudflare-tunnel (cloudflare-tunnel). See Experimental features.

Web CLI console: host diagnostics

The dashboard’s CLI console (experimental key cli-console) runs the commands on this page against the control plane. It also answers a small host namespace itself, inside the control plane process, without starting the CLI or any other program. It is read only and is not a shell. None of them take arguments: paths, process names, container names and flags are refused. Each line goes through the same step-up, one-command-at-a-time, idle timeout, output cap and audit log (cli_console.run) as any other console command. Linux only; other platforms reply “not supported on this platform”. Set APP_CLI_CONSOLE_HOST=off on the server to turn the namespace off while keeping the rest of the console.

Naming conventions

A command’s own subject is a positional argument or --name. --app is a scope flag: it narrows a list or ties a new object to an app (alerts history --app web, proxy --app web), and is never the name of the thing being created. Every list command prints a bare JSON array under --json; paging info (apps list --max-items) goes to stderr, so the stdout shape never changes with a flag.

Simple verbs

levelrail-cli help lists the 13 everyday verbs (up, deploy, rollback, logs, env, domains, db, backup, restore, apps, status, open, login). levelrail-cli help advanced lists everything else. There is one CLI: the simple verbs are shortcuts over the same commands, and every flag of the longer forms still works.
--dockerfile picks the Dockerfile relative to the project directory and overrides levelrail-definition.json. --image skips the definition file and uses detection; its value is not used as an image (use deploy --image for a prebuilt image). Deploy a directory with one command. See the one command quickstart.
Alias for apps deploy; deploy an image to an existing app.
Alias for apps rollback; without --image it goes back to the previous successful deploy.
Same as apps logs <app>. The log archive and search commands keep their names (logs archive, logs search, logs dump).
Set plain environment variables. Keys stored as secrets are refused; use apps secrets set for those. KEY=@- reads the value from stdin. KEY=@./path, KEY=@/abs/path and KEY=@~/path read a local file only with --allow-file-values and are refused otherwise. KEY=@@text stores the literal @text.
open prints the app’s public URLs. login is auth login. backup is backups trigger and uses the only configured backup target when there is exactly one. restore is backups restore and --latest picks the newest succeeded backup.

Local instance

Run a private control plane on loopback with a generated admin and <app>.localhost addresses. See Run it on your laptop.

Apps

apps list prints every app the caller can read as a bare JSON array. On a fleet large enough that matters, add --max-items N to cap the page size; stdout stays a bare array and the paging info goes to stderr as next_token=N total_count=M; an empty next_token means there is no further page. Pass that next_token back in as --starting-token to fetch the next page (requires --max-items, since the server only pages a result when a limit is set):
Run levelrail-cli apps <subcommand> -h for the full flag list of any command below. Deploy lifecycle is covered in Deploying and managing apps.

Create, inspect and list

  • apps create --repo accepts ssh:// URLs as well as https. apps create registers an existing image or triggers a real build from a git repository; --file reads an app spec, --interactive runs a step-by-step wizard. Required flags missing outside --interactive fail with an error instead of prompting. Flags-only creates can set health with --readiness-path|exec|preset|interval|timeout|expected-status, the same --liveness-* set plus --liveness-failures, and --ready-timeout; they follow the same rules as apps health set.
  • apps status shows an app’s current reconcile conditions; apps overview shows CPU, memory, traffic and errors for every app (or the names given) in one request; apps network shows the live traffic path (container port, host port, running).
apps tree <name> prints what an app consists of: current deployment and last deploy (image tag, short digest, status), replicas with their reconcile conditions, domains, volumes, linked databases and the env key count (never values). --watch redraws every --interval (default 5s, or LEVELRAIL_TREE_INTERVAL) until Ctrl+C; --json prints the nested structure. Per-container rows are not shown because there is no per-app container endpoint.
  • apps create --file sends a service’s published_ports (container_port, host_port, protocol tcp or udp). apps get, apps list and apps deploy-compose show them as 53/udp, and --json carries published_ports. Refusals print the server message plus a hint.
  • apps init writes a starter app.yaml offline. Optional field names and hints are read from the embedded schema, and the result is validated before it is written. It refuses to overwrite a file unless --force is set.
  • apps validate-spec <app> --file PATH|- sends the file to the server and checks it with the deploy-time rules, without deploying or saving. It prints one error path: message line per issue and exits 2 when invalid. Files over 1 MiB are rejected before any request. --json prints the raw response.
  • apps listening-ports <app> shows whether the running container listens on the configured port. It reads the container socket table, so it needs exec enabled for the app; otherwise the note column says why and the verdict is unknown.
  • apps next-advisor <app> checks the saved config of a Next.js app (shared cache, skew protection, build memory, web vitals) and prints one row per finding with its fix. It needs no build; for other apps it says Next.js was not detected. --json prints the raw response.
  • apps validate parses and validates an app.yaml or a Docker Compose file locally, with no API call and no deploy. It prints the detected format, service count, and every non-blocking notices entry a real deploy would also surface.
  • apps delete removes an app and stops its containers; if the node is unreachable the delete is reported as pending and retried.
  • apps expiry <app> shows an app’s expiry. --at TIME (RFC 3339) or --in 72h sets it, within the max horizon setting. A notice is written to the audit log first, the app is stopped at the expiry, and deleted only after the grace period (deploy.app_expiry_grace_hours, default 7 days) and only when an operator has turned on deploy.app_expiry_delete_enabled (off by default; until then expired apps are only stopped). Starting the app again after its expiry stop keeps it for good. With --delete-data, the person or token that set it must still hold write:sensitive at delete time, or the app is kept. A control plane restore marks already stopped expiries kept. Apps with volumes, bind mounts, linked databases or dependent apps are only stopped and kept unless --delete-data --confirm <app> is set. A protected app, an app in a protected environment (setting an expiry there is refused), or one started again after its expiry is never deleted. An expiry belongs to one life of the app name, so a recreated app never inherits it. Setting needs write ability on the app, --delete-data also needs write:sensitive and an app on the control plane’s own node. --clear needs deploy ability and always cancels a pending delete; a stopped app stays stopped until apps start.
  • apps restart-schedule <app> shows an app’s scheduled restart. --schedule EXPR sets it: a 5 field cron (0 3 * * *, with --timezone, default UTC) or @every 24h. Restarts must be at least deploy.restart_schedule_min_interval apart (default 1h, never under 5m), and one sweep restarts at most deploy.restart_schedule_max_per_sweep apps per control plane. Each run uses the same restart path as apps restart, so the rollout strategy, health gating and disruption budget apply, and multi replica apps roll. A stopped app, an app in a protected environment, during a deploy freeze, with a running deploy, on an offline node or over its disruption budget is skipped (recorded with the reason, the next regular run is kept) and never forced or started. A failed restart is retried after deploy.restart_schedule_failure_backoff (default 15m, doubled per failure up to 24h, never later than the next regular run). Set, clear and each run, skip or failure are written to the audit log. The schedule belongs to one life of the app name, so a recreated app never inherits it. Setting and --clear need deploy ability on the app, like apps restart, because a restart also applies staged environment edits. Saving the schedule again never moves the next run closer than the minimum interval after the last run.

Deploy, roll back and scale

  • apps keep turns a one-click trial deployment into a permanent app: it stops being flagged as throwaway, with every service of the same app. Repeating it is harmless; an app that never was a trial answers 409.
  • apps maintenance shows, enables or ends the maintenance page on every domain of an app at once, all or none. show needs read access, set and clear need deploy access. Use --for, --until or --max-duration so it ends on its own; the server enforces the limits. For a single domain use domains maintenance.
  • apps wait polls until a deploy attempt converges and exits 0 on success, 5 if it converged as a failure, 6 on timeout. On success it says what happened: rolled out, already up to date (the deploy changed nothing) or last rollout: restarted (no new deployment was created); --json carries the same as outcome.
  • apps deploy-spec fans an app.yaml’s services: map out into independent builds under one app; apps group shows a service’s siblings under the same multi-service app.
  • apps builds trigger builds an image from a git source and deploys it to an existing app.
  • apps promote promotes the app’s image onto a sibling app in another environment. --release promotes a specific release id from releases list instead of the one the app is bound to.
  • apps rollback --release ID redeploys that release by its digest pinned ref and retargets the binding. Both --release flags need APP_RELEASE_BINDINGS=on on the server and answer 404 for a release that does not belong to the app.
  • apps apply restarts an app so saved env, secret and config changes reach the running container; it does nothing when nothing is pending.
  • apps scale changes the replica count and/or the deploy strategy. With service=count pairs it sets replicas per service of a multi-service app; every key is checked before anything changes, then services are updated one at a time. If an update fails, the services already changed are set back to their previous counts (best effort, each rollback is reported), so it is not atomic. apps restart --service S recreates one service.
  • apps hook-runs shows the most recent outcome of an app’s pre and post deploy hooks; apps images lists the locally present image tags under the app’s current image repo.
  • apps set changes app settings. --pr-comment-commands on|off lets write-access users run /levelrail commands from pull request comments (see Pull request comment commands).
  • apps import-bundle <file> imports a tar written by apps export <name> --out - on another instance. It needs the write ability, runs the same checks as a compose deploy (spec, quotas, scope, bind mounts need root), and saves the services stopped unless --deploy is set (which needs deploy). --dry-run prints the services, the secret names to set and the warnings without writing anything. The dry run is advisory: it does not reserve quota or published ports, so the import itself can still be refused. A name already in use is refused with 409; pass --name to import under another name, or --replace --confirm <name> with write:sensitive to replace it. Secret values are never in a bundle and a bundle holding .env is refused. Size, entry count and file size caps are the apps.bundle_import_max_bytes, apps.bundle_import_max_entries and apps.bundle_import_max_entry_bytes runtime settings.
  • apps set --description "Checkout frontend" sets the one line summary shown on the apps list, and --notes-file runbook.md (or - for stdin) sets markdown notes for the owner, purpose and runbook links, shown on the app overview. An empty value clears either field. Both are searchable from the apps list, copied by apps clone, written to NOTES.md by apps export, and capped by the resources.description_max_chars and resources.notes_max_bytes runtime settings. apps get prints them, and --output json includes description and notes. Never put secrets in notes: anyone who can read the app can read them. Databases take the same fields over PUT /api/v1/databases/{name}/notes.
  • apps set-node and apps clear-node move an app to another node, or back to the control plane’s own local node. With --with-volumes the named volumes move too, and apps moves shows the history of those moves.

Deploy history, approvals and automation

  • apps deploys list is real, row per attempt deploy history, newest first. apps deploys attempts is an alias; --fail-on-error exits 7 when the newest listed attempt failed. apps deploys show prints one attempt (the newest by default) with its structured failure: code, cause, failing step, redacted log excerpt, suggested fix, docs link and retryable. See Deploy failures.
  • apps deploys wait blocks until one deploy is healthy, failed, canceled, superseded or blocked (a freeze window or approval) and prints the result with its failure. Exit 0 healthy, 7 failed, canceled, superseded or blocked, 6 timeout. Without a deploy id it resolves the newest deploy once and follows it by id.
  • apps deploys build-report <name> <deploy-id> prints the Next.js route table (static, ISR or dynamic, with sizes), the shared first-load size and build warnings parsed from that attempt’s stored build log. Sizes read 0 when the log has no size columns.
  • apps deploys compare diffs two deploy attempts, or one against the current live state. apps deploys logs prints one attempt’s full build and log output to stdout. apps deploys steps streams the pipeline steps (detecting, building, pushing, deploying) until the attempt ends and exits non-zero if a step failed; an already finished attempt replays only a short summary.
  • apps inspect <app> <view> is read-only and shows what the dashboard cards show: effective-config (resolved env and build settings with the source of each, --key narrows to named env keys), pending-changes (saved settings no deploy has applied yet), failure-context (last lines of the failing container or the build log), rollback-targets (pinned releases, newest first) and image-status (whether the tag moved and the architecture matches the node). --json prints the API body unchanged (with --key, only the env list is narrowed). The view may also come first, as in apps inspect image-status web. Secret values stay masked as the API returns them.
  • apps deploys failed lists every app’s latest failed deploy in the window (default set by the server), with the image of its newest good deploy as a rollback target.
  • apps deploys cancel cancels a queued or in-progress deploy before it cuts traffic. apps deploys rollback-to redeploys a past succeeded deploy’s exact image, pinned by digest or rollback pin, with that deploy’s config; --watch follows it through the readiness gate.
  • apps deploys gate (alias deploy status) prints a release’s gate timeline: readiness passes, stable window, cutover, drain, rollback pin and post-deploy watch. --watch follows it until the release clears its watch, fails, is rolled back or is replaced. Exit 0 healthy or in progress, 7 failed or rolled back. apps deploy-safety shows and overrides the per-app thresholds (set web --stable-window 20s --auto-rollback false, default clears one) and lists pinned rollback targets. See Deploy safety.
  • apps timeline shows what happened to an app, newest first: deploys, rollbacks, restarts, env, secret and config changes (key names only, never values), scaling, stop and start.
  • apps diagnose explains a failed deploy or crashloop and can apply a suggested fix with --apply-fix N. apps preflight runs pre-deploy checks (DNS, ports, disk, image, env).
  • apps deploy, apps rollback, apps restart, apps start and apps stop exit non-zero with code node_offline when the app’s node is offline, naming the node and the fix (bring it back, or apps move / nodes drain). --queue-while-offline records the change as a pending attempt that the node applies when it returns.
  • apps upgrade-plan prints what moving a template app to the current catalog entry would change (risk, image, env, volume and port changes, blockers) and changes nothing. apps upgrade shows the same plan until --yes is given, then applies it, follows the release and reports a rollback if one happened; --no-wait returns once it has started. See docs/template-upgrades.md.
  • apps freeze manages deploy freeze windows: a window starts at every match of a 5 field cron expression, evaluated in --timezone (default UTC), and lasts --duration. While one is active, webhook, pipeline and released deploys are held and run when the window ends; a manual deploy needs apps deploy --override-freeze --override-reason TEXT. set replaces the app’s windows with the one given. Fleet-wide windows are under settings deploy-freeze.
  • apps schedule configures a recurring redeploy of a branch’s latest commit on a cron schedule. apps deploy --at schedules a one-shot image or git ref deploy, and apps schedule list and apps schedule cancel manage those (see Scheduled deploys).
  • apps cancel-superseded lets a newer queued deploy replace older queued ones of the same branch. Only queued deploys are replaced; a deploy that already started building is never canceled automatically.
  • jobs manages an app’s scheduled jobs: fresh-container or exec cron jobs with run history, logs, retries and catch-up (see Scheduled jobs). apps scheduled-tasks is the older exec-only form of the same resource. Guard rails on create and update: --overlap allow|skip|queue-one decides what a run that comes due while the previous one is still running does (skip records a skipped run, queue-one holds one run until the previous finishes and skips the rest), --alert-on-failure reports failed runs to job_failing alert rules scoped to the app (at most one notice per rule and job per jobs.failure_alert_window_seconds, with the job name and exit code, never output; a failed delivery is retried), and --keep-runs N and --keep-days N bound the job’s history (capped by jobs.retention_max_runs and jobs.retention_max_days). --timeout is clamped to jobs.timeout_min_seconds and jobs.timeout_max_seconds, and a run past it is stopped.
  • functions runs a handler repo (built with Railpack) or an image as a function: it sleeps when idle, and a request to a sleeping one waits through the cold start. functions init node|python|go writes a ten line starter, functions list shows state, calls and p95 duration (see Functions).
  • apps sleep stops an app after it has had no requests for a set time and wakes it on the next request (see Sleep when idle).
  • apps canary runs a new image beside the app and sends it a share of traffic until you promote or abort it (see Canary deploys).
  • apps auto-update redeploys an app automatically when its image tag moves to a new digest (see Image auto-update).
  • apps auto-rollback opts an app into or out of automatic rollback when a crashloop alert fires. apps auto-rollback-slo-burn sets how the app reacts when an SLO burn rate alert fires.
Deploys across every app you can read: a filterable newest first list (page size default 50, max 200, with --cursor paging), counts by status with failure rate and duration percentiles, and a live event stream (--json prints one object per event).
A deploy or promote into an environment tagged protected becomes a pending approval that a different, sufficiently privileged user must approve first; the same user or token that requested it cannot decide it. list defaults to pending. approve runs the gated deploy or promote now; reject leaves the app’s desired state untouched.
Attach an already connected notification channel (see Channels) so a deploy success or failure sends a message there.

Domains, ports and traffic

  • apps domains add creates the DNS record when a provider is connected (--dns off skips it, --dns preview shows it); --wait prints the go-live steps and exits non-zero when the domain is not live within --timeout. See Add a domain and go live.
  • apps domains shows or changes an app’s domains; a domain already used by another app is refused and nothing is changed. Per-domain TLS, redirects, WAF and the like are under Domains.
  • apps streams forwards a host port to one container port as raw TCP (only tcp is supported). A stream change takes effect on the app’s next container recreation, such as an image change or apps restart.
  • apps egress restricts an app’s outbound traffic to the declared host:port pairs; with nothing configured, egress is unrestricted. DNS and loopback traffic stay open regardless.
  • apps runtime shows or changes a service’s container options (see Runtime options). A flag replaces that option and the rest stay; --unset clears options. A change recreates the container.
  • apps exec-access is on by default. When disabled, apps exec and the interactive terminal are refused whatever abilities the token has.

Run, logs and metrics

  • apps exec runs a command in the app’s container and exits with its real exit code.
  • apps run runs a command once (no retries unless --retries N is given) in a fresh container with the app’s env and secrets, waits, prints the output and exits with the command’s exit code (124 on timeout, 5 when the job failed without one). Output is printed when the command finishes. Ctrl-C cancels the run (the container is killed and removed, exit 130). See Jobs.
  • apps console <app> opens the console the app’s template declares (Minecraft: rcon-cli) through the same exec path. With no command it opens a terminal; with -- list it runs once and prints the output. Templates that declare no console are refused with a pointer to apps exec. The console reads its credentials from the container’s environment, nothing secret is passed on the command line.
  • apps tunnel <app> [--service s] [--port p] [--local-port n] listens on 127.0.0.1 and relays to a private container port, see app tunnel.
  • apps logs searches an app’s stored log entries (--since 10m, --tail N or -n N, --service S), or streams live with --follow. On a terminal with no search flag it follows live by default; --no-follow and piped or --json output give stored entries. For a capped excerpt see logs query under Logs.
  • apps requests shows request rate, errors and latency from the ingress; apps resource-usage ranks every app by latest CPU, memory, network and disk usage. The table columns are NAME, CPU, MEMORY, NET RX, NET TX, DISK R and DISK W; DISK R and DISK W are the app’s disk read and write rates, and a column shows - when no sample exists yet.
  • releases list APP shows the app’s release snapshots, newest first, with image digest, creation time, source reason and the current release marked. The list stays empty unless APP_RELEASE_BINDINGS is shadow or on; --json prints the raw response.
  • apps resource-recommendation suggests memory and CPU limits from historical usage; apps cost estimates what the app’s CPU and memory would cost under reference providers (not a real bill).
  • costs explore|budgets list|create|set|delete is the cost explorer with forecast and top movers, and named budgets with alert thresholds and an optional pause or throttle at 100 percent, see cost explorer.
  • usage report|settings|budgets shows cost showback and manages prices and budgets, see usage and cost. usage report --csv prints the export. budget set|delete project|team ID is an alias for usage budgets. budget show|set|clear APP manages a per-app egress and cost cap, see spend caps.
  • advisor findings|summary|apply|dismiss|snooze|restore|enable|disable drives the beta resource advisor. advisor apply ID only previews; add --yes to apply.
  • apps vitals prints the 7 day p75 of LCP, INP, CLS, TTFB and FCP overall and per route.
  • apps next-cache set NAME redis|none sets where a Next.js app keeps its page cache. redis shares it across replicas through the linked Redis database and adds LEVELRAIL_NEXT_CACHE_URL on every path that saves the app, not only on a build deploy. Containers pick it up on the next restart or deploy.
  • apps health-score gives a synthesized pass, warn or fail readiness verdict across deploy health, security, resilience and observability.
  • apps log-drain forwards container logs to an external HTTP or syslog sink, in addition to the built-in node-local log store.
  • apps scheduled-tasks runs a command inside the app’s running container on a cron schedule. The command is a real argv with no shell; put -- before it when the command takes flags.

Health probes, volumes and storage

  • apps health set sets one probe and keeps the other. A probe is an HTTP(S) check or a command run inside the container (exit 0 is healthy). --preset fills path, interval, timeout and failures from a shortcut (healthz, health, api-health, ping, status); explicit flags win. apps health discover probes well-known paths and reports what each one did.
  • apps volumes manages named Docker volumes outside a redeploy. The name is lowercase letters, numbers and hyphens starting with a letter; the path is where it mounts in the container.
  • apps storage set attaches a connected bucket as object storage and injects its credentials as S3_* env vars at container create time. See Object storage.
  • apps build-cache configures the BuildKit remote cache on a storage destination. --global applies to every app without its own setting. clear is bounded per call; run it again while it reports more to delete. A cache problem never fails a build.
  • apps build-settings stores per-app build options that every later build uses; saving never starts a deploy. --builder and --dockerfile update the connected git source. --target names a multi-stage stage (letters, digits, ., _, -), --no-cache skips the layer cache on Dockerfile builds and --provider pins the Railpack provider, so a build that detects another one fails. Values are capped by builds.setting_value_max_bytes. --builder and --dockerfile need the write:sensitive ability, like PUT git-source/build; the other flags need write. Stored settings apply to manual builds, git push and webhook deploys, and protected-environment holds (which snapshot them when the deploy is held, so approval binds what gets built). They do not apply to pull request previews or to apps that deploy from a services map, which refuse them with 409. Concurrent saves are last writer wins.

Environment, secrets and Vault

  • apps env import merges a .env file into an app and prints which keys are new, changed, unchanged or sent to secrets, by name only. Keys that look sensitive (*_KEY, *_SECRET, *_TOKEN, *PASSWORD*, DATABASE_URL and URLs with credentials) go to the secret store and the rest to plain env. --all-secrets sends every key to secrets, --all-plain keeps every key in plain env, and --secret-pattern STRIPE_*,*_DSN adds key globs to the secret side. Keys that are already secrets are skipped. It reports how many changes are pending, or restarts the app right away with --apply. --no-apply keeps the change pending when apps.env_apply_on_set is on.
  • apps env diff compares two apps’ env vars, for example staging against production. Secret values are never read: secrets are compared by key only, and the dashboard has the same comparison on an app’s Environment page.
  • apps env export writes env vars as .env text; sensitive and secret keys are written empty with a comment unless --reveal is given. apps env get prints one variable, masked when sensitive. --reveal asks for your password (and authenticator code) at the prompt, never from flags or the environment, and needs a token with read:sensitive and secrets:reveal plus APP_SECRET_REVEAL_TOKENS=on on the server. See Environment variables and secrets.
  • apps secrets set sets or rotates one secret’s encrypted value and declares the key as secret backed so it is injected; --apply restarts the app now. With --env-file it bulk imports every key in a .env format file as its own secret. Values are never returned: list shows key names and locked state only. lock toggles a secret’s overwrite guard.
  • apps vault-env declares an env var resolved live from the configured external Vault (see Vault); only the reference is stored.
  • apps preview-env and apps branch-env override an env var for previews only. A branch override applies when the preview’s own branch matches PATTERN (an exact name or a glob such as release/*); --secret stores it envelope encrypted. Neither affects the app’s own running deploy.
  • apps branch-deploys chooses which branches get a stable per-branch deploy (see Preview environments), lists the live ones and removes one now.
  • apps contexts sets env and build overrides per deploy context and shows the effective config (see Deploy contexts).

Source, previews and webhooks

  • git remote add <app> and git remote rotate <app> issue the git push deploy remote (beta, git-push); --apply (with optional --dir PATH) sets the remote in a local repository instead of printing the token line; by default the token stays out of .git/config and is read from LEVELRAIL_GIT_TOKEN at push time (--credential-helper is an accepted no-op alias); --store-token-in-config writes it into .git/config instead, stored unencrypted in the repo config.
  • apps git-source connects a repo for auto deploy on push; settings sets push path filters, forge status reporting and deploy trigger patterns (--tag-pattern v* in release mode, --branch-pattern main,release/* in push mode, see Deploy trigger patterns in the app spec reference) and whether builds fetch git submodules and LFS objects (--submodules, --lfs, https only, capped by the git.submodules_* runtime settings); rotate-secret mints a fresh webhook secret, shown once.
  • apps webhook-deliveries lists recent inbound webhook requests, verified or not. replay re-runs a stored delivery’s payload and can trigger a real build and deploy.
  • apps previews manages preview environments per pull request, see Preview environments per pull request. previews is the same command at the top level. extend keeps one preview past its TTL; settings shows or changes the lifecycle, resource, database and exposure policy. limits shows or changes preview caps, fork policy and TTL; approve deploys a held fork pull request once; teardown removes one PR’s preview now; sweep tears down every stale preview across all apps now; pr-status toggles the PR comment and commit status per preview deploy.

Supply chain

apps sbom shows a deploy’s software bill of materials (newest deploy with one by default), or prints or saves the raw SPDX or CycloneDX document. Scanning is off by default and needs APP_BUILD_ATTEST=true on the server so builds produce an SBOM; a server can refuse every scan with APP_SCAN_ENABLED=false. gate block_on_critical keeps the previous release serving; override lets the next blocked release through once, with a recorded reason. See Supply chain.

Alerts, connections and templates

apps alerts create takes one of these kinds: threshold (needs --metric, --comparator, --threshold), crashloop (--restart-count-threshold, --restart-window), cert_expiry, patch_status, scheduled_task_failure (--scheduled-task-id, --restart-count-threshold), node_disk_space, node_resource_usage, node_offline, domain_health, control_plane_backup_stale, log_archive_stale, backup_missing (--backup-resource-kind database with --backup-database-name, or volume with --backup-volume-name) and slo_burn (--slo, optional --slo-latency-ms). Mute, schedule and review alerts with the top-level Alerts commands.
  • apps connect is the canonical way to attach a database; apps database set keeps working for the single-database form. apps connect connects an app to a managed database and injects its resolved connection value as an env var; unlike apps database, an app can have any number of these. connections list shows each connection, including whether it resolves to a mesh DNS name (cross node capable) or a container name; connections suggest lists databases the app could connect to. apps disconnect removes one connection by its env var name.
  • apps database set attaches one already created managed database as the app’s connection env var source (default DATABASE_URL, field url); clear detaches it.
  • apps save-as-template derives a compose.yaml from the app’s current desired state and saves it as a reusable template. No secret, database or vault backed env value is captured, only the key name.
  • apps tag attaches a tag by name, creating it if new; apps untag detaches it. See Tags.

Projects, environments and organizations

  • A project groups apps and databases; an organization groups projects. Deleting either leaves its members running, now ungrouped.
  • Shared env vars layer in this order: organization, then project, then environment, then the app’s own env, each overriding the one before. env-set replaces that scope’s shared env vars. For per scope secrets see Shared env.
  • A protected environment requires --confirm (or an interactive yes) on apps deploy, apps rollback and apps promote targeting an app tagged with it, and routes the deploy through deploy approvals.
  • apps environments clone-preview shows what cloning would create without applying it; env-diff diffs two environments’ resolved effective env vars.
  • apps projects topology prints a diagram ready graph of a project’s apps, databases and volumes. See Projects and organizations.

Tags

Tags are arbitrary labels for organizing and filtering apps and databases, always identified by name. delete detaches the tag from every app and database. apps lists every app attached to a tag; databases lists every database you can read that carries it. Attach one to an app with apps tag and to a database with databases tag. The per-database cap is the tags.max_per_resource runtime setting.

Pipelines

  • validate checks a pipeline file locally with no API call and exits 2 when it has problems.
  • save creates or updates pipelines from one file, or from every file in a repository’s pipeline directory.
  • runs lists runs, or shows one run’s jobs, steps and approval gates; --all lists runs across every app.
  • run --param sets a declared run parameter (--input is the older spelling).
  • artifacts lists the archives a run stored, or downloads one job’s archive.
  • triggers <app> <pipeline> manages the pipeline’s inbound webhook: the token and signing secret are shown once when created or rotated.
  • approve decides approval gates, or releases a run held for approval.
  • sync syncs pipeline files from the repository now, or sets the repository as source of truth.
  • triggers shows why recent git events did or did not start runs.
  • oidc shows whether pipeline jobs can mint OIDC tokens and the JWKS URL to wire to a cloud provider; oidc rotate-key rotates the signing key, and the old key stays published until it retires.
See Pipelines and Pipeline OIDC.

Load balancers

Experimental: requires APP_EXPERIMENTAL=load-balancer. See Load balancing.
  • list shows every load balancer across apps with upstream health. set creates or changes the load balancer and only the flags you pass change; clear removes it, back to a single upstream.
  • status is the live upstream table; check probes every upstream once, right now; history shows recent checks and state changes per upstream; upstream sets an upstream active, draining or disabled.
  • export generates an infrastructure as code definition with no cloud API calls; import loads the loadbalancer: block of an app.yaml.

Preview

Deploy previews are the screenshot or metadata card captured after a deploy, not pull request previews (those are apps previews). See Deploy previews.
enable turns deploy previews on: metadata reads the page title and social image with one small request (no browser), screenshot (the default here) runs a browser container per deploy and pulls a large image once. capture recaptures the current release now; prune deletes old previews now, or every preview of the app with --all. Previews need the server to run with APP_PREVIEW_ENABLED=true (the default).

Databases

  • status shows a database’s current reconcile conditions (useful when it exists but is not running yet).
  • import also accepts an export made by databases export when that backup target is encrypted. The control plane decrypts it with its own instance key, so this works only on the instance that made the export. A file sealed with another instance’s key is refused with a clear message and nothing is restored. There is no plain text export option.
  • import-hosted copies a hosted Postgres (such as Heroku) into an existing managed Postgres database. The source URL is read from the environment variable named by --from-env or from the first line of stdin, never from an argument. --dry-run runs the preflight only and prints blockers, warnings and info with the fix for each. Without --writes-frozen a real run refuses. Exit code 1 means the preflight is blocked or the move failed. See Migration reference.
  • delete stops and removes a database but keeps its data volume; --force is needed if apps use it.
  • slow-queries lists a Postgres or MySQL database’s slow query log.
  • schema lists a SQL database’s tables with row estimates and sizes; query runs one statement through the control plane, read-only by default. See Database viewer. db is a short alias for databases.
  • set-resources applies memory and CPU limits to an already created database, replacing whatever was set before (a full replace, not a patch).
  • public-access set exposes a database on a host port; --bind-address is private (the default), public, or a literal IP.
  • set-version is a minor or patch image change on the same data. major-upgrade is a guarded Postgres major upgrade with a rollback snapshot; major-upgrades lists the attempts, major-upgrade-rollback restores the pre upgrade data, and major-upgrade-discard deletes a rollback snapshot to free disk.
  • params edits engine tuning parameters (Postgres, MySQL, MariaDB, Redis, Valkey, MongoDB) from a fixed allowlist with typed values. set, unset and rollback only stage a change; apply --yes (needs write:sensitive) or the next databases start restarts the database with it. See Managing databases.
See Managing databases.

AI models

Experimental: requires APP_EXPERIMENTAL=ai-models. See AI models.
  • deploy runs a model as a container on a GPU node and prints its API key once. Flags: --engine (ollama, vllm or llamacpp), --model, --node, --gpus (a count or all), --gpu-devices, --context, --quantization, --domain, --hf-token-from-env, --residency (always or on_demand), --idle-ttl, --swap-group. --compute cpu (or --catalog ID) runs a small GGUF model on the CPU with hard limits: --cpus, --memory-mib, --weights-file, --accept-license (see AI models). catalog lists the curated CPU models with licence, memory need and an estimated speed on this server. benchmark measures a running model. fit --compute cpu rates a model against the node’s CPUs and memory.
  • logs searches a model engine’s logs, or --follow streams download and load progress live. delete keeps the downloaded weights volume. restart recreates the engine container.
  • rotate-key issues a new API key, printed once; keys manages named API keys with limits, expiry and rotation grace; usage shows gateway requests, tokens, errors and latency per key.
  • residency sets a model always resident or on_demand (stopped when idle, started on first request); wake and sleep start or stop an on demand engine now; swap-group lets models share a GPU (--clear removes it).
  • fit estimates VRAM fit on each GPU node; gpus lists GPU nodes with VRAM and usage; preflight checks a Hugging Face repo (access, size, quantizations, fit, disk); metrics shows engine metrics.
  • cache list shows cached model weights per node; cache prune removes unused, unreferenced weights (use --dry-run first).

Auth

  • login authenticates and persists a new API token; with --profile NAME it saves under a named profile instead of overwriting default.
  • login --device --json prints one JSON line first (verification_url, user_code, expires_in, expires_at) so an agent can relay it, then the token resource once approved. See Attention center.
  • session-link mints a short lived (about 2 minutes), single use login link that signs in as whoever minted it, meant for browser automation. It needs a token with the root ability.
  • code prints the sign-in codes waiting for your account with the requester’s IP address, browser and time, plus password sign-ins from new browsers waiting for approval; approve and deny decide one of those (approve needs --match with the two digit number the waiting browser shows, typed in; a wrong number denies it, and the number is never printed by code), and devices lists or revokes browsers trusted for password sign-in. They need a token that belongs to your user. Listing and devices accept write:sensitive; showing a code needs signin:approve, which no device login, root or write:sensitive token carries; approve and deny need signin:approve or an unscoped root token of your own user (a root token must type the number, not the password). Mint one from a signed-in session with levelrail-cli tokens create --name approver --abilities signin:approve --expires-in-days 30 (it must expire within 30 days by default, cannot be an agent token, and is revoked when you change or reset your password or sign out your other sessions), or use the dashboard. code-login shows or changes who may sign in with a code (changing it needs root). See Identity and access.
  • devices trusted list and devices trusted revoke are the same calls as devices as a list and revoke pair; revoke asks first and needs --yes when stdin is not a terminal. sign-in-requests list shows waiting code requests and new-browser sign-ins without any code, and sign-in-requests reveal <code-id> prints one code once on stdout (never saved; needs signin:approve, and a refused reveal shows the server error and how to get that token).
  • activity shows your own account activity feed (needs a token that belongs to you with read:sensitive); preferences reads or changes your timezone, language, theme, landing page and Gravatar choice; export requests the data bundle, waits and saves the zip (mode 0600); unlink removes a linked sign-in provider and refuses to remove your last way in; delete-account permanently deletes your account after the typed email and your password. See Your account.
  • Every 2fa subcommand needs a live session: --username and --password (prompted if omitted), never the CLI’s saved bearer token. setup starts enrollment and returns a secret and provisioning URI; enable confirms it and returns recovery codes once; recovery-codes regenerates them and invalidates the old set.

Auth engine

Shows which auth engine is active, the areas served by the library, and the shadow comparison counters with the most recent mismatches. Needs a root token.

Profile

List configured credentials profiles and their API URLs.

Tokens

tokens create requires a username and password (prompted if omitted, never prompted in CI mode), because that route is session only server side. revoke first tries the API token from --token, LEVELRAIL_TOKEN, APP_API_TOKEN or the saved profile, and asks for --username and --password only when the server refuses a token. create mints a new API token; --agent labels it as issued to an AI agent so audit entries record the agent name. list never shows a secret. cleanup permanently removes revoked tokens that were revoked more than --older-than-days days ago (default 90 when the flag is omitted; 0 removes every revoked token and needs --yes) and prints how many it removed; unlike the other subcommands it takes a root API token (--token or the stored one) instead of a password, and it never touches an active token. The dashboard setting Delete revoked API tokens after (Settings, API tokens) does the same on a schedule.

Domains

Per domain settings take <app> <domain>, and the domain must already be one of the app’s configured domains. Domain TLS and ingress behavior is covered in Domains and ingress.
  • standalone manages standalone domains: domains with no app that proxy to PORT, HOST:PORT, an http(s):// URL, app:NAME[:PORT] or container:NAME:PORT. Options are --upstream-tls, --insecure-skip-verify, --tls-server-name, --host-header preserve|upstream|NAME, --no-websocket, --connect-timeout, --read-timeout, --strip-prefix and --description. Loopback, private, container and control-port targets need --confirm. update sends only the flags you pass. Per-domain commands take _standalone as the app name, for example domains waf set _standalone tools.example.com.
  • list shows every app’s domains in one call. check runs a real DNS lookup and reports whether the domain reaches this control plane. certificates lists every certificate in certmagic storage, healthy or not.
  • basic-auth set takes --username and --password. maintenance set serves a fixed maintenance response instead of proxying, without stopping the container. redirect set --target URL redirects every request for the domain; maintenance mode takes precedence if both are set.
  • tls-cert uploads an operator supplied certificate and key; clear reverts to automatic issuance and renew forces re-issuance of an automatic certificate.
  • waf configures the opt-in Web Application Firewall and rate limiting. --mode defaults to detect (matches are logged, never rejected) rather than block.
  • error-pages sets custom HTML for status code 404, 500, 502 or 503; clear removes one mapping, or all if --code is omitted.
  • dns reads and writes the real A, AAAA, CNAME, TXT, MX, SRV and CAA records in the domain’s zone through whichever DNS-01 provider is configured. remove must match an existing record exactly.
  • cloudflare-dns set --cf-api-token TOKEN and route53-dns set --aws-access-key-id ID --aws-secret-access-key KEY configure the ACME DNS-01 credentials needed for wildcard domains. A domain is wildcard eligible by having a leading *. label; if both providers are enabled, Cloudflare takes precedence.

Mail DNS

Experimental, needs APP_EXPERIMENTAL=mail. See Mail DNS.
plan is a dry run and prints a plan hash. apply refuses a stale hash and never replaces existing MX, SPF, DKIM or DMARC records unless --replace-existing lists their kind.

Mail broadcasts

Needs the mail app and an email provider. See Email notifications.
--dry-run only counts who would get the message and how much of the daily cap is left. Suppressed addresses never receive announcements.

DNS

See DNS zones and records.
  • zones verify compares the NS set the system resolver, 1.1.1.1 and 8.8.8.8 return with the zone’s assigned name servers.
  • records import and records template print a plan and change nothing until --apply. --replace deletes sets missing from the file and needs --confirm.

Backups

See Backups and storage.
  • list-all lists backup history across every database and app volume instance wide.
  • delete removes one archived backup (destructive). download streams a succeeded backup’s object to stdout.
  • restore restores in place and is destructive; --confirm takes the database name. restore-as-new restores into a brand new database and is non destructive. restores and clone-restores list the attempt history of each.
  • verify checks a backup is intact without a live restore; verifications lists past attempts.
  • health shows every backed up resource with its last backup and last verified restore. protection shows bucket object lock and versioning.
  • drill run restores a backup into a scratch resource, validates and destroys it, and exits non zero when it fails. See Prove your backups work.
  • volumes restore restores into a new volume only, optionally named for another app or on another node.

App volume backups

The same verbs as backups, for a named volume declared in the app’s app.yaml (apps volumes get <app> lists them). restore is destructive and its --confirm takes APP/VOLUME; restore-as-new creates a standalone volume.

Point-in-time restore

Postgres, MySQL and MariaDB. Recovery covers the time range from when pitr enable was called, forward; use backups restore for anything older.
enable turns on continuous WAL (Postgres) or binary log (MySQL, MariaDB) archiving going forward, and --base-backup-cron EXPR [--base-backup-target ID] gives base backups their own schedule independent of the dump schedule (an empty value clears it); status shows whether PITR is enabled and the current recoverable window; restores lists point in time restore attempts (base backup, target time, status, error). restore overwrites a Postgres database in place and is destructive. For MySQL and MariaDB it needs --restore-as NEW, creates that new database and leaves the source untouched.

Build

Both work against a public repository and need no existing app. detect shows which framework the builder detects without running a build, and prints no framework detected (exit 0) when nothing matches. branches lists the branches a repo advertises; private or unreachable repos fail with an API error.

Builds cache quota

Shows the per app cache quota (build.cache_app_quota_gb, 0 is off) and the recent reclaims of the apps you can read. --app-quota-gb changes the live setting (root or admin). --reclaim APP trims that app’s least recently used cache mounts down to its quota now; it is refused while a build of the app runs or waits in the queue. Every reclaim is audited with the app name and bytes freed.

Cloudflare Tunnel

Experimental: requires APP_EXPERIMENTAL=cloudflare-tunnel.
Runs the cloudflared container with a tunnel token from your own Cloudflare Zero Trust dashboard, exposing the control plane without an inbound port. This is a different credential from domains cloudflare-dns.

Vault

Configures resolving app secrets live from an external HashiCorp Vault, as an alternative to the platform’s own envelope encrypted storage. The credential is stored encrypted and never shown back; role_id is echoed on get. disconnect disables and forgets the stored credential.

Channels

Valid --kind values: generic, slack, discord, telegram, email, pushover, pagerduty, teams, resend, ntfy, gotify, mattermost, lark, rocketchat, opsgenie, webex, googlechat. For telegram, add &message_thread_id=N to the sendMessage URL to post into one forum topic. update fully replaces a channel’s configuration. --notify-device-login opts a channel into a link-only notice when a CLI login is waiting. test sends a real test message; deliveries lists a channel’s recorded send history, newest first. See Email notifications.

Push subscriptions

Lists or revokes the browser push subscriptions registered for the caller’s own account. There is no register subcommand: a subscription’s endpoint and keys only come from a real browser. See Observability.

Alerts

Top-level commands for muting, scheduling and reviewing alerts. The rules themselves are managed under apps alerts. See Observability.
  • A silence keeps matching alerts evaluating and recorded in history but stops them notifying. Every filter given must match; repeat a flag to accept any of several values. silences delete ends a silence now and keeps it in history (silences list --all).
  • silence is the quick action: silence one rule, --for defaults to 1h.
  • A maintenance window is a recurring silence: a 5 field cron expression for each start, a --duration, and --tz (default UTC). --scope is all (default), app or node, with --target naming the apps or nodes.
  • history lists firings and resolutions, newest first (--limit defaults to 50). --outcome is one of sent, silenced, grouped, inhibited, failed, ratelimited, flapping or skipped; --event is fired, resolved, flapping or flap_ended; --since takes an RFC 3339 timestamp. --changes adds what changed on the app before each firing, with the most likely cause tagged.

Monitors

Experimental uptime monitors. The server must set APP_MONITORS_ENABLED=true, otherwise these commands get a 404. See Monitors.
  • --header values are stored encrypted and never returned; only header names are listed.
  • --expect takes comma separated codes or ranges and defaults to 200-399. Redirects are not followed unless --follow-redirects is set.
  • Interval floors, the timeout cap and the monitor count limit come from the control plane APP_MONITOR_* settings, and an error names the setting.
  • Targets on private or loopback addresses are refused unless the control plane allows private outbound targets.

Status page

The opt-in public status page. It stays off until set --enable. Only public component names, statuses and operator written announcements are published; targets (app names, hostnames, check URLs) stay private. See Status page.
  • --enable and --disable are mutually exclusive. --domain serves the page on a hostname that the ingress must route to the control plane.
  • Branding: --accent takes #RRGGBB, --logo-url an https URL (its origin is the only image source the page allows), --about plain text. --noindex adds a robots noindex tag (off by default); --powered-by=false hides the footer credit. Pass an empty value to clear a text field.
  • components set --group takes a group ID or its exact name; an empty value ungroups. component is an alias of components. Deleting a group ungroups its components.
  • incidents create: --kind defaults to incident, --impact to none. A maintenance kind requires --starts and --ends (RFC 3339). --body is markdown-lite.
  • incidents update --status takes investigating, identified, monitoring or resolved for an incident, and scheduled, in_progress or completed for maintenance.

Shared env

Environment variables shared at project, organization or environment scope, plain or secret. See Projects and organizations.
SCOPE is project, organization or environment, and --id is that resource’s id. A plain value is stored as is. --secret encrypts it the same way an app’s { secret: true } env vars are, and its value is never shown again, only its key. list shows plain and secret marked entries alike; pass --secret to delete when the key is secret marked.

Registry

Runs the platform’s own built-in image registry (registry:2). The first enable generates a username and password; the password is printed once and never shown again. disable forgets the generated credentials. This is distinct from registry-credentials, which stores credentials for an external registry.

Registry credentials

Private container registry pull credentials. update can rotate the password. test authenticates against the registry without pulling anything; repositories and tags browse the external registry. registry credentials add --vendor ID pre-fills the host and username for a vendor preset (see registry credentials vendors). registry package-registries manages private npm, PyPI, Maven, NuGet, Cargo, Go and RubyGems registries mounted into builds as secrets, see private registries.

Backup targets

S3 compatible backup destinations. Valid --provider values are aws, r2 and custom; --endpoint is required for r2 and custom. test probes the bucket over its stored credentials without uploading or deleting anything. delete asks for --yes when the target still has backup history, and answers 409 and lists what uses the target (schedules, policies, running work, history of existing databases or apps); history of deleted resources is kept and shown as target deleted, but it cannot be restored from the console and creating a target again does not reattach it. Bucket objects stay in the bucket.

Storage

S3 compatible storage destinations. providers lists the presets (aws, r2, b2, minio, wasabi, custom). add also takes --account-id (r2), --region (aws, b2, wasabi), --endpoint (minio, custom), --virtual-hosted and --skip-verify. test writes, reads back and deletes a probe object.

Assets

Files served from an S3 compatible storage destination. A <bucket> is the bucket name or its id. Buckets start private and Direct; making one public needs the bucket name typed back (--confirm-name, or an interactive prompt), never assumed. upload sends small files through the control plane and large ones straight to the provider with a presigned URL (the cutoff comes from LEVELRAIL_ASSETS_DIRECT_MAX_BYTES, and a 413 also switches routes), then prints the origin and CDN URLs. buckets probe checks access, browser upload CORS and public exposure; --fix-cors applies the CORS rule. usage prices the stored size with list prices and labels the result as an estimate with the price table date. buckets delete removes only the connection; objects stay at the provider. All commands take --json and --output.

Data export

See Data export.

Compliance

OpenTelemetry export

OTLP/HTTP export of metrics and logs to your own collector. A signal-first view of the OTLP kinds of Data export; header values are stored encrypted.

Event webhooks

Signed outbound event webhooks with a delivery log. create and rotate-secret print the signing secret once. See Event webhooks.

Scheduled maintenance

One-off planned downtime shown on the dashboard and the public status page. See Scheduled maintenance.

CDN overview

Fleet requests, 5xx rate, edge cache hit rate and each node’s share of traffic over the window. --json prints the same object the dashboard CDN page reads.

Automatic cleanup

Disk cleanup with preview and quarantine. See Automatic cleanup.

Cleanup center

list shows every cleanup target with its usage, retention, mode and last run. preview reports the rows and bytes a run would delete and deletes nothing. run deletes data for one target: without --dry-run it prints the preview row count first and refuses unless --yes is given; --dry-run only records what would be deleted, prints would delete N rows (dry run) and is audited like any other run. --days must be at least 1 and overrides the target’s retention for that call only; retention itself is the runtime setting (see settings runtime). mode sets a target to off, preview (scheduled runs only record) or on. runs lists the run history, newest first, and --format csv prints it as CSV for a SIEM or spreadsheet. Viewing needs a read token; preview, run and mode need a root API token.
One search over apps, databases, nodes, domains, templates, settings, docs and actions. Scopes (app:, env:, tag:, node:, kind:) narrow the result, the rest is free text. You only ever see what your token may see, and an action hit appears only when you hold the ability it needs: levelrail-cli search kind:action restart api. See Unified search.

Saved views

A saved view is a named filter of one list page, the same one the Views menu on the Apps and Databases pages saves. Each list only accepts its own filter keys: apps take q, status, env, tags, labels; databases take q, status, engine, labels; domains take q, status; builds take q, status, app; deployments take q, status, app, env. Names and values are plain text. --share team shares the view with the team you are signed in to (or have switched to); members can apply it, only you can change it, and you or a team admin can delete it. Members of other teams never see it. apply prints the dashboard path that opens the list with the filter, for example /apps?status=failing. Caps come from the views.name_max_chars, views.filter_max_keys, views.filter_value_max_bytes and views.max_per_user runtime settings. Creating, sharing and deleting a view writes an audit row with its name and list.

Logs

See Log archive.
TIME is an RFC 3339 timestamp or a duration back from now such as 24h. Without --app, a policy or dump covers every app. fetch downloads one archived object (gzip NDJSON). query returns a capped excerpt of an app’s newest matching log lines with match counts and a truncation notice; the byte cap defaults to 8 KB or APP_MCP_LOG_MAX_BYTES. access searches the edge’s in-memory recent request log (GET /api/v1/logs/access, or GET /api/v1/apps/{name}/access/search for one app), newest first, across the apps you can read; rows for hosts that belong to no app are shown to instance admins only. The edge never records query strings, so paths are shown without them, and client IPs, user agents and referrers are never returned. --q is a literal, case-insensitive substring of the path. Pages follow next_cursor. The longest window, rows per page, term length and rows scanned per search come from the live settings telemetry.access_search_max_window, telemetry.access_search_max_rows, telemetry.access_search_max_term and telemetry.access_search_max_scan (seeded by APP_ACCESS_SEARCH_MAX_WINDOW, APP_ACCESS_SEARCH_MAX_ROWS, APP_ACCESS_SEARCH_MAX_TERM, APP_ACCESS_SEARCH_MAX_SCAN). At most telemetry.access_search_max_concurrent searches run at once (APP_ACCESS_SEARCH_MAX_CONCURRENT); more answer 429. A search that hits the scan cap says so with truncated and still returns a cursor to continue from. Rows a host recorded before its current app took it over, or before the app was deleted, are dropped and never shown to the new owner. History only reaches back as far as the in-memory log (telemetry.access_log_size per route) and is lost on restart.

Network shares

NFS and CIFS network share mounts, the same shares an app’s volume mount can reference by name. See Network shares.
--name, --protocol, --host and --remote-path are required on create and update. A CIFS share also needs --username and --password; on update, omit --password to keep the existing one. test checks that the share’s host is reachable on its protocol’s standard port.

Firewall

Declarative host firewall rules, reconciled onto the control plane’s local ufw. See Host firewall. exposure, restrict and unrestrict are covered in Exposure audit.
--port is required (1 to 65535); --protocol defaults to tcp and --source-cidr to any source. A deny rule, or an allow rule scoped to a source CIDR, that targets a port the control plane itself needs (the management API, agent connections or ingress) is refused rather than applied.

Security center

The security score, sessions and devices, and the platform security policy. See Security center.
security reachability (root) lists what the internet can reach per app and database. --recheck re-measures instead of using the cached audit, and --fix ID applies a finding’s automatic fix and re-checks. See Exposure report. security hsts enable probes every public domain first and refuses until each serves a publicly trusted certificate. HSTS is off by default. posture prints the score for anyone with read; the item list needs root. The sessions commands act on your own account; --user names another account and needs root. A token used for them must belong to a user and hold write:sensitive or signin:approve. policy set needs root and changes only the flags you pass.

Feature flags

A boolean, plus an optional gradual rollout percentage, that the app’s own code reads live through GET /api/v1/flags/evaluate/{key} with a read scoped API token. Changes take effect immediately with no redeploy. The key is globally unique across the control plane and cannot change after create.

Apply, diff and export

Experimental: requires APP_EXPERIMENTAL=iac. See Platform as code for the document format, secrets handling, prune rules and CI use.
Validates resource files, prints the plan, and applies it through the API with your own permissions. Exit 0 no changes or applied, 1 error, 2 changes pending (with --dry-run --exit-code). ${{ env.NAME }} placeholders are filled only from --var, --var-file or the names listed with --allow-env (a trailing * allows a prefix, but never covers credential looking names such as AWS_*, GITHUB_TOKEN or anything containing TOKEN, SECRET, PASSW or _KEY, which must be named exactly). An unresolved placeholder fails before anything is sent. stack create <name> --scope install creates a stack that belongs to the install and has no project (--project is refused with it; the default --scope project still needs --project). stack list shows a SCOPE column and stack show a Scope line. stack plan and stack apply take --allow-weaken to accept a Setting document that weakens a security protection. The API answers 403 unless the caller is a human root session (a token, even a root one, is refused), and the CLI prints that message. apply, stack plan and stack apply take --values FILE.yaml (repeatable, later wins): a flat YAML map that fills the ${{ env.NAME }} placeholders, below --var and above --var-file. See values per environment. Plans print ~ path: before -> after for changed fields. Env vars, anything under secrets and keys that look like credentials show (hidden), and other values are cut at APP_IAC_PLAN_VALUE_MAX characters (default 120).
Runs the same parse, schema and semantic checks as apply, locally: no login, no network. Problems print as file:line: message (path). Exit 0 when valid, 1 on any problem. Placeholders with no --var or --var-file value are checked with a stand-in value. --json prints {valid, resources, issues}.
Drift between the files and live state; exits 2 when they differ.
Writes live state as stable resource files, never containing secret values. Secret looking values become ${{ env.NAME }} placeholders; supply them at apply time with --var, --var-file or --allow-env. Callers without read:sensitive always get placeholders for every env value.

Nodes

See Multi-node.
  • delete fails while the node still has placements; drain it first. join-token mints a one-time enrollment token, shown once. reenroll-token mints a one-time token that re-issues a node’s agent certificate, keeping its identity, and prints the command to run on the node. revoke-cert revokes the certificate and closes the node’s session; only a re-enroll token brings it back. security prints how the control plane verifies the node (CA and certificate fingerprints, renewal schedule and last failure, 24 hour check counts) and its recent security events; cert renew asks a connected node to renew its certificate now. cert drill rotates one node’s certificate end to end (preflight, renewal request, new certificate, node still online), prints each step and exits non-zero on a failure. The old certificate is never revoked, so a failed drill changes nothing; wait time is APP_NODE_CERT_DRILL_TIMEOUT (30s).
  • cordon marks a node unschedulable without evacuating it; uncordon reverses that; drain moves every service and database off a node.
  • list shows each node’s certificate state and days left (CERT) and agent version (AGENT); get adds expiry, last renewal, key origin, platform and commit.
  • resource-usage shows every node’s latest CPU, memory and disk usage plus a fleet rollup; capacity-forecast projects disk and memory usage forward, roughly how many days until full.
  • mesh shows the live WireGuard mesh state and peers; rotate-key rotates a node’s WireGuard key; rejoin-mesh forces an immediate resync for a stuck peer.
  • providers manages cloud provider credentials (Hetzner, DigitalOcean) and provision creates a server at a provider and enrolls it as a node; ssh-provision adopts a machine you already have over SSH. provisions and ssh-provisions track either through to enrollment. See Multi-cloud provisioning.
  • topology is a whole mesh summary (nodes, apps, databases, load balancers, connections); traffic shows per domain ingress reachability and TLS status.

Status

Shows the control plane’s own configured and not configured signals, including whether its local Docker daemon is reachable.

Upgrade

Compares the running version with the latest release, runs the preflight checks (release signature, Docker Engine, free disk, backup), takes a control plane backup and prints the command that upgrades. It never upgrades by itself unless you pass --apply. See Installing.
backup-now takes a control plane backup and re-runs the preflight. schedule queues the upgrade for a time or the next maintenance window; the preflight re-runs at that time and nothing is applied if it fails. auto reads and sets the automatic upgrade policy, which is on by default (mode any, 03:00 UTC for 2h) until you save one, and set --mode off turns it off; set changes only the flags you pass. All of these need a root token. See Upgrade safely. --plan shows the breaking changes between the running version and the target (default: latest on the channel). --apply asks the control plane to run the safe self-update on its host: verified download, snapshot, migration dry run, swap, health check and automatic rollback. Breaking changes flagged as needing acknowledgement are refused until you list their ids with --ack-breaking. It follows the attempt to its outcome unless --no-wait, and exits non-zero when the upgrade was rolled back or failed. --attempts lists every attempt with its step timeline. --dry-run and --plan also print the schema change and migration count, whether the data directory has room for the backup and the new release, the restart behaviour and the command that restores the backup, and change nothing. The upgrade takes a control plane backup first and is refused if it fails; --skip-backup goes on without it (no database restore point), and with no flags upgrade exits non-zero when its backup fails unless --skip-backup is given. See Upgrade safely.

System restart

Restarts the control plane process through its supervisor, for example after enabling the mesh. It asks for confirmation unless --yes; without a terminal, --yes is required. With --wait it polls until the control plane answers from a new process (its boot_id changes), tolerating connection errors while it is down, and gives up after --timeout. status prints the current boot_id, whether restart is supported and whether one is pending. If no process supervisor was detected, the command prints the reason and the command to run on the server (for example sudo systemctl restart levelrail) and exits non-zero. The API is GET and POST /api/v1/system/restart.

System health

Prints goroutines, heap, database latency and write queue, write ahead log size, reconcile pass timing and live stream use, with a finding for each value over its threshold. --fix applies one of the typed fixes and prints the result; it needs a root token. The API is GET /api/v1/system/control-plane-health and POST /api/v1/system/control-plane-health/fix. See Control plane health.

System slow statements

Lists the slowest statements the control plane ran against its own database, slowest first, with the worst and last time and how often each was seen. Only the prepared statement text is kept, never bound values, and quoted literals are replaced by ?. Recording is off until the runtime setting perf.statement_timing is on; perf.slow_statement_ms sets the threshold and perf.slow_statement_ring how many statements are kept. Needs a root token. The API is GET /api/v1/system/slow-statements.

System integrity

Prints whether the control plane database passed its last integrity check and lists the snapshots that can be restored. --check runs a quick check now, --full the full integrity_check. --restore verifies a snapshot and stages it to replace the database at the next start (latest picks the newest one that verifies), and --cancel-restore removes a staged restore. Staging needs a root token. The API is GET /api/v1/system/integrity, POST /api/v1/system/integrity/check, and POST or DELETE /api/v1/system/integrity/restore. See Resilience.

System networks

Lists the per-app Docker networks with owner, subnet, attached container count and whether the owning app still exists, plus how full the APP_NETWORK_POOL block is. prune removes only orphaned networks that are past APP_NETWORK_GC_GRACE, empty, and not owned by another instance; pass exactly one of --dry-run or --yes. The API is GET /api/v1/system/networks and POST /api/v1/system/networks/prune. See Troubleshooting.

System disk history

Prints how full the data disk has been over time: free and total bytes plus the Docker images, containers, volumes and build cache share of each sample, and the days-until-full forecast when disk use is growing. --days limits the window and never exceeds the retention setting. The table shows at most --rows samples spread evenly over the window; --json returns every sample. Docker columns show 0 for samples taken while Docker usage was unavailable. The API is GET /api/v1/system/disk/history.

Readiness

Checks whether the server is ready: who holds ports 80 and 443, Docker version and rootless mode, exposed Docker API, disk, memory, firewall and the DNS of the domain. Prints the recommended install mode (own ports or behind your existing proxy) and the exact next step. Exits 1 when a check fails. Before anything is installed use install.sh --check instead, see Installing.

Version

Prints this CLI’s version, commit and build date. It runs offline: no server, login or config is needed. With --server it also asks the control plane for its running version, whether that matches the CLI, and whether a newer release has been published to the project’s GitHub repository. --server fails with could not reach the server at <url> when the control plane is unreachable; the plain command still exits 0. --json returns both parts.

Changelog

Prints recent release notes, newest first, from the running control plane’s own CHANGELOG.md. Without --limit the server default applies. The dashboard shows the same notes in the What’s new panel.

Init

Detects the project’s stack (Dockerfile, compose file, package.json, go.mod, Python, Java, static site) and writes three files into the directory: app.yaml (the app spec, validated with the platform’s own validator), AGENTS.md (how an AI agent deploys, checks and rolls back the app) and .mcp.json (MCP server config; the token is an env var reference, never a value).
  • Existing files are never overwritten unless --force is given. A diff of what would change is shown either way.
  • Without --yes, a terminal is asked to confirm; a script must pass --yes or --dry-run.
  • --mode selects the tool exposure written to .mcp.json: agent-core (the default, a small profile for deploy and debug work), read-only (every read tool, no mutations), standard (read and mutating tools, no destructive ones) or full.
  • --commented puts a one line comment from the app schema above each app.yaml field, adds a # default: note where the schema has one, and lists port, env, health, domains, replicas and resources as commented-out lines. The output still validates.
  • --out FILE writes only app.yaml to FILE and skips AGENTS.md and .mcp.json; --out - prints it to stdout and nothing else. An existing FILE needs --force.
  • --api-url or the active profile is written into AGENTS.md and .mcp.json when known. --mcp-binary overrides the MCP server binary name.
See Agents.

API docs

Prints every HTTP route registered on the control plane: method, path, required ability and resource group, followed by a count of routes and how many have a worked request and response example. It is the same data as Settings, API explorer in the dashboard, without the interactive try-it. Supports --json, --output and --query. See API explorer.

App types

App types let an admin define a governed shape for apps (workload, typed parameters, allowed build methods and add-ons, fixed values, per-environment-kind rules). The feature is off until the control plane runs with LEVELRAIL_APPTYPE_ENABLED=on; limits come from LEVELRAIL_APPTYPE_MAX_PARAMS, LEVELRAIL_APPTYPE_MAX_SCHEMA_BYTES, LEVELRAIL_APPTYPE_MAX_PATTERN_LEN and LEVELRAIL_APPTYPE_MAX_VERSIONS. apply saves a draft from a YAML or JSON file, and --publish freezes it as the next immutable version (root only). check is a dry run of an app spec against a published version and prints each violation with a readable message and a next step; nothing is enforced at deploy yet.
Prints a “Deploy with” link and the README Markdown for it, after validating the image reference, DNS label name, port range, uppercase env names and health path. Env values are never part of a link. Without --launcher, the launcher is APP_BRAND_DOCS_URL plus /deploy.html. --server also prints the direct https://<server>/apps/new?deploy=1&... link. Supports --json, --output and --query. See Deploy links and badge.
Prints a link to the current profile’s instance (/deploy?repo=...) plus README Markdown and HTML button snippets. The repo must be an https or ssh git URL without a username or password. --open opens the link in the browser. Nothing deploys from the link. See Deploy button.

AI assistant

Experimental: requires APP_EXPERIMENTAL=ai-chat, and a provider key saved with settings ai-assistant providers set and a model chosen with settings ai-assistant use. The assistant is read and suggest only: a tool call that would change state pauses for an explicit confirmation. See In-app AI assistant chat.
  • ai chat sends one message and streams the reply to stdout. Without --session it starts a new session and prints its id to stderr; pass that id back with --session to continue the conversation. --json prints one JSON object per stream event.
  • ai sessions resolve approves or rejects a mutating tool call the assistant proposed (shown by ai chat as a pending confirmation), then streams the continuation.

AI control

Control what AI agents can do on your platform.
  • status shows the current mode, allowed environment kinds, and when it was last changed.
  • set changes the mode or allowed environment kinds. Agent tokens cannot approve deploy or pipeline approvals, and cannot change this setting.
  • revoke-agents revokes every labeled agent token.
See AI control.

Audit log

audit-log lists every recorded write, deploy and root tier request plus automatic certificate renewals, newest first. Read only requests are not recorded. It needs an admin or root scoped token. Flags: --limit N, --before RFC3339, --path, --method, --client-kind cli|dashboard|mcp|api, --agent <name> (entries made with a token labeled with that agent name), --search <text> (case-insensitive substring across actor, ability, method, path and remote address), --resource domain:<name>|zone:<name>|app:<name> (one resource’s own trail), --actions <prefixes> (comma separated action prefixes such as dns_record.,proxy_route.,domain.), --failed (status 400 or higher), --format csv with --output-file FILE. --agent, --search and --failed are applied server side and carry into csv exports. audit-purge deletes every entry older than the retention window (APP_AUDIT_LOG_RETENTION_DAYS, default 90 days) right now instead of waiting for the automatic sweep. Security-family entries are kept for APP_AUDIT_LOG_SECURITY_RETENTION_DAYS (default 365). It needs an admin or root scoped token. audit-verify walks the audit log’s hash chain and signed checkpoints and prints any entry that was edited, removed or cut off the end. It exits 1 when a check fails and needs a root token. audit-verify --anchor <file-or-https-url> also reads an off-box anchor export (the audit-anchors.jsonl file or a JSON array of anchors, see Security) and checks that the live chain still holds every anchored head. It exits 1 when an anchored head was rewritten, rolled back or removed, and --json then prints {"chain": ..., "anchor": ...}. APP_AUDIT_ANCHOR_FETCH_TIMEOUT bounds a remote export read. tokens create and auth login default to a 90 day lifetime. A token that never expires needs tokens create --no-expiry from a root caller, and the security policy’s maximum lifetime still overrides it.

Attention

Lists everything that needs attention right now: failing apps, failed deploys from the last 24 hours, low disk space (warn under 10 percent free, critical under 5), offline nodes, expired or expiring certificates, and doctor warnings or failures, critical first. It is the CLI side of the dashboard’s Status page (/status). Exit code is 1 if any item is critical, 0 otherwise, so it works as a script gate. Supports --json, --output json|table|text, and --query.

TUI

Opens an interactive terminal UI over the same API: live apps, databases, deploys, nodes, domains, alerts and backups, a log tail, and confirm-gated restart, deploy, rollback, stop and start. Needs a TTY. See Terminal UI for the key map.

Go live

Prints the go live checklist for an app and domain (default: the app’s only domain): app health, port, host firewall, DNS, certificate and the final HTTPS check, each with its status and next action. With --wait it polls and exits 7 until the domain is live or --timeout passes. Supports --json.

Doctor

Runs a local preflight health check: Docker daemon reachability, disk space and write latency, write access on the data directory, port 80 and 443 availability for the embedded ingress, control plane database reachability, RAM and CPU against the recommended minimums, firewall status, outbound network reachability (public IP, external port reachability, ACME, clock skew, the agent advertise host, image registries), and GPU attach checks. Exit code is 0 if every check is ok or warn, 1 if any check fails.

Doctor text overrides

The labels, usage text and table headers of the doctor subcommands (cloud, paths, explain, reachability) and domains doctor, domains summary and domains activity come from an embedded catalog. Set LEVELRAIL_DOCTOR_STRINGS_FILE to a JSON file of flat key: string pairs to replace any entry, for translation or wording changes. Templates use {name} placeholders. Keys are grouped by prefix: explain_*, reach_*, paths_*, domains_doctor_*, domains_summary_*, domains_activity_*, plus the cloud keys such as usage and console_url.<provider>. Unknown keys are ignored and an unreadable file leaves the defaults in place.

Resilience

Shows whether apps keep serving if the control plane is down: route snapshot, certificate cache, and per node agent link, each pass, warn, fail or unknown. --simulate is a dry run that verifies the saved snapshot would let ingress restart without the control plane and stops nothing. --fix rewrites the route snapshot from the applied config. Supports --json and --output json.

Setup

The dashboard’s Get started checklist from a terminal. status prints every step with its state, time estimate and note, plus the “ready for production” percentage. next prints the one step to do next and where to do it. skip and undo record or clear an operator override for a step id such as teammate; reset clears every override and shows the guide again. The three writes need a root scoped token. Steps and their rules: Getting started. Supports --json, --output json|table|text, and --query.

Proxy

Without a subcommand: shows which container publishes ports 80 and 443 and the configuration to paste into that proxy, for the dashboard (--domain) or an app’s domain (--app, upstream is the ingress HTTP port). setup detects a Traefik (Coolify’s included) and, with --confirm, turns on tls_terminated_upstream, saves the detected entrypoints, certificate resolver, directory and upstream host, writes one route file per domain and verifies each over HTTPS; without --confirm it is a dry run. It exits with an API error and the precise gap (detection_incomplete, upstream_unreachable with the drop-in fix, not_writable) when it cannot proceed. status prints detection, per-domain state (missing, written, stale, error), certificate issuer and expiry, and the checklist. apply rewrites the files now, verify probes again, disable removes the files it wrote. Writes need a root scoped token. Details: Run behind an existing proxy. --provider picks the proxy (auto, the default, uses the one detected). nginx is managed: setup --confirm writes one .conf per domain, validates it with nginx -t and rolls back on failure. Caddy and HAProxy only render a snippet to apply by hand.

Containers

list shows every container on this node, managed or not. stop, remove and claim only act on a container the platform does not already manage (409 otherwise); for a managed app use apps stop, apps start, apps restart or apps delete. claim adopts an orphaned container into a new app. orphans lists leftover containers, volumes and certificates that no app or database accounts for, with where each stands against its grace period. reap runs one removal pass now (--dry-run reports without removing; exit 1 if anything could not be removed). Details and the APP_ORPHAN_* settings are in Delete and clean up.

System address

Shows this server’s public IPv4 and IPv6, where they came from, and a note when the server is behind NAT or a TLS-terminating proxy. --domain adds the exact DNS records to create for that name. --ipv4 and --ipv6 set a manual override (root), --clear goes back to detection. See Standalone domains.

System maintenance

Fleet wide cleanup. These commands need an admin or root scoped token.

System prune

Removes every stopped container, dangling image, and unused anonymous volume or build cache not part of the reconciler’s current desired state, fleet wide. It never touches a named volume (an app’s storage attachment, a database’s data volume), even one that is actually orphaned: see Orphaned volumes for those.

Control plane backups

Snapshots of the control plane’s own database, stored under <data dir>/control-plane-backups/. create takes one now (manual snapshots are never auto-deleted), download saves one to --out FILE (or raw bytes to stdout), verify re-checks the checksum, SQLite integrity and schema version without restoring (exit 1 if any check fails), delete removes one. Snapshots never contain the master key. Restore is an offline server command, levelrail restore-db <file>; see Control plane backup and restore. The --offbox, schedule, run-now, drill, escrow and keys subcommands drive encrypted off-box backups. keys generate makes an age key pair on your machine (private key to a 0600 file, public key to stdout). schedule set changes only the flags you pass (--enable, --disable, --destination, --recipient, --schedule, --drill-schedule, --retain-daily, --retain-weekly, --retain-monthly, --escrow-destination). run-now and drill run wait for the run and exit 1 if it failed; drill status exits 1 when the last drill failed or none has run. escrow writes the master key and agent CA key encrypted to your recipients (never uploaded unless --upload, and never to the backup bucket). restore-plan prints the ordered recovery steps with the newest complete backup and the exact restore command filled in. help-dr prints a static runbook. Restore an off-box backup on the server with levelrail restore --from <s3://... | file> --identity FILE [--dry-run]. See Disaster recovery.

Volume export and import

levelrail-cli volumes export|import is the same pair as apps volumes export|import. See Leave anytime for the rules.

Orphaned volumes

Named Docker volumes (an app’s storage attachment, a database’s data volume) survive system-prune even after the app or database that created them is deleted, since Docker never removes a named volume on its own. volumes-orphaned lists every one this instance created that no current app, database or storage attachment references any more. volumes-orphaned-cleanup removes exactly the volumes named with --names (comma separated), after the control plane re-confirms each one is still genuinely orphaned. There is no flag that deletes every orphaned volume unseen; review the list first.

Users

--role is a curated preset (admin, operator, viewer, guest, or a custom role by name; users roles lists the curated presets and roles list lists every stored role); --abilities is a comma separated list from read, read:sensitive, write, write:sensitive, deploy, root. users role set changes a user’s role; users grants manages which environments a guest can see. invites create invites a teammate by email; invites list and invites revoke manage pending invites. See Access control for details.

Roles

Custom roles are presets over an ability list. Updating a role applies the new abilities to every user holding it, immediately. A role cannot be deleted if any user holds it. See Access control.

IAM

Resource scoped Allow and Deny policies, additive on top of --abilities. DOC is a policy document JSON string, passed inline or as file://path/to/policy.json:
update replaces the policy’s name, description and document. attachments lists a policy’s attached principals. templates shows built-in policy templates and apply instantiates one, optionally attaching it to a principal. See Access control.

Environments

Global environments exist across the entire instance (Development, Test, UAT, Production). Kinds control which environment a resource has and what policies apply. Moving into or out of a protected environment requires confirmation and approval from another user. See Environments. --required-approvers N makes a deploy into a protected environment wait for N distinct approvers (default 1, capped by the deploy.approval_max_required runtime setting). The requester never counts, two tokens of one user count once, a revoked or disabled approver stops counting, and a replaced held deploy starts again from zero. Each vote is checked again at release time: a revoked or disabled approver, or one who lost the deploy ability or access to the app, stops counting, and a vote whose token was revoked can be cast again from a live session. Votes must come from a user or a token owned by a user. With N above 1 a tag only image is resolved to its registry digest, the release deploys that digest, and a tag that moves between votes refuses the release (request the deploy again). Raising N needs the environment edit ability; lowering it or unprotecting an environment needs write:sensitive. With N=1 nothing changes: the tag is deployed as today. deploy-approvals approve prints the progress until the last approval releases the deploy once.

Secrets

generate-master-key writes a new master key to a file (mode 0600, never overwrites), locally, without contacting the control plane. rotate-master-key re-wraps every stored data encryption key under a new master key in one atomic step, live, then binds any legacy values. binding-status counts stored secret values not yet bound to their slot, and rebind binds them (safe to rerun). provider add with --client-id and --client-secret-file stores an Infisical machine identity (the secret is read from a file or stdin, never echoed). Read Master key rotation before running these in production.

Migrate

One way migration from a live instance. By default it writes app.yaml files plus a migration report into --out-dir (default ./migrated); --apply creates the apps directly on a target instance instead, using --target-token, --target-api-url and --target-profile. --include-secret-values also fetches real env var values. For Dokploy, object-storage backup destinations and database backup schedules are imported too: a destination’s keys are used only with --apply and --include-secret-values (never printed or journaled, otherwise the target is reported needs_secret with the create command to run), names that already exist are skipped, and schedules are imported paused unless --enable-backup-schedules is given. Dokploy notification providers become alert channels of the matching kind: tokens and webhook URLs are used only with --apply and --include-secret-values (otherwise the channel is reported needs_secret with a placeholder command), channels are created disabled unless --enable-imported-channels is given, existing names are skipped and kinds with no match are listed as unsupported. For Coolify, --token is an API bearer token (with the read:sensitive ability if you want secret values); for Dokploy it is an API key; for CapRover it is the login password. For Coolify one-click services, --stage-dir (default ./migrated/compose) receives one compose.yaml per service with its magic variables translated, and --domain-suffix (default localhost) sets the parent domain of the staged hosts. Staging writes files only and starts nothing. See Move a Coolify one-click service to a Compose app. For Coolify and Dokploy, every --apply run writes a journal (--journal FILE, default under the config dir, mode 0600, names and step states only). resume finishes the open steps without re-creating anything, and undo removes only the apps that run created, as a dry run unless --yes is given; --force includes apps deployed since the run, --force-app NAME includes one app whose fingerprint no longer matches and --include-data includes apps with volumes after a typed confirmation. See Resume or undo an —apply run. migrate hub sessions drives the database migration hub from the terminal: show lists a session’s databases and checks, select and step change the plan, apply starts the copy (it asks first, reuses the source password held for the session or reads one non-empty line piped in with --password-stdin, never a flag or a terminal), receipt prints or saves (--out, mode 0600, refuses an existing file unless --force and never writes through a symlink) the read-only receipt with secrets masked, connection shows a verified database’s connection without a secret and reveal adds its password (needs read:sensitive, audited, asks first), and delete drops a session after confirmation. migrate checklist lists and updates the per-app cutover checklist with --done or --reset, with the same --json, --output and --query flags as other API verbs.

Stack templates

stack templates lists the bundled starter stacks: web-app-postgres, worker-queue, static-site-cdn, agent-app and preview-env. stack init copies one into DIR (default ./<name>) and fills in the variables name, domain and image. It refuses a non-empty directory unless --force is set, and writes secret names only (SECRETS.md), never values. Both run offline. See Stacks and GitOps.

Import

import classifies its input (a GitHub, GitLab, Gitea or Bitbucket repo URL, a docker run command, an image reference, a docker-compose.yml or a Dockerfile) and prints a deployment plan. Nothing is created unless --deploy is given. --file - reads from stdin. --env KEY=VALUE is repeatable, and a required variable with no value blocks --deploy. import <repo-url> --analyze prints what the New app wizard would suggest (stack, build, port, health path, env variable names, databases) with the evidence for each, and creates nothing. --apply creates the suggested databases, the app, the connections, the repository link and the first build; --base-directory, --dockerfile, --build-type, --name, --port and --env override suggestions. See New app wizard. import platform reads apps, databases and settings from another platform (read only) and creates them here. Use --dry-run first. Databases and volumes are created empty; data is not migrated. Re-running skips what was already imported. The source token is read from APP_IMPORT_SOURCE_TOKEN, --token-stdin or --token (which lands in shell history). Other flags: --only, --collision suffix|skip, --insecure-tls, --allow-private, --allow-loopback. See migrating from Coolify, Dokploy or CapRover. import cutover moves one staged app’s traffic in a reversible flow. plan prints the readiness checklist, run --dry-run exercises everything except the switch, run --confirm NAME switches and verifies (rolling back on its own if verification fails), status shows the timeline, and rollback restores the previous DNS value and stops the staged app. Other flags: --run ID, --accept-warnings, --no-wait, --wait DURATION, --json. See guided cutover. import config reads Procfile, app.json and vercel.json from a directory (default: the current one) and prints a proposed app.yaml. Findings go to stderr, blockers first, each with a fix. It is offline and read-only, needs no token and creates nothing. --out FILE writes the spec to a file, --json prints {detected, spec, findings, nextSteps}; the human output ends with NEXT STEPS, the exact apps create --file ... --service ... --secret KEY=VALUE and databases create commands. A Heroku plus Vercel directory keeps both services when their names clash: the Heroku one keeps the name and the Vercel one gets a -vercel suffix (then -vercel-2 and so on) with its own cron jobs, plus a warn finding. apps create --file refuses a spec with databases: or from: env references instead of dropping them, and --strict exits 2 when any finding is a blocker (otherwise it exits 0). LEVELRAIL_IMPORT_WEB_PORT (default 8080) and LEVELRAIL_IMPORT_NODE_PORT (default 3000) set the proposed ports. --emit stack on import config and import platform writes reviewable documents instead of applying: a Stack, a Project (and with --environment an Environment), Database, App and Domain documents, a SECRETS.md checklist of secret names (never values) and a MIGRATION.md of what the documents cannot carry. --out DIR is required and an existing file is only overwritten with --force. The output is sorted, so the same source gives the same bytes, and it loads with stack plan. --stack names the stack (default PLATFORM-import, or the directory name for import config), --project defaults to the stack name. Apply runs prebuilt images only, so an app with no image takes --image-repo REGISTRY/NAMESPACE and is named REGISTRY/NAMESPACE/APP:latest; without it the emit fails and says so. import config also takes --service S (comma separated, as apps create --service) and --db-version postgres=16,redis=7.4, because the config files name no database version; import platform reads the source directly and needs no control plane, and takes the same --db-version. Database connection variables and from: references are written as secret names in SECRETS.md until the schema can reference a database. See Stacks and GitOps. import takeover moves this server’s ports 80 and 443 from the old platform’s proxy to the built-in ingress. plan and run --dry-run print the preflight and steps and change nothing, run --confirm takeover does it and waits through the restart, status shows the latest run and rollback restores the previous addresses and starts the old proxy again. Other flags: --accept-unmanaged, --run ID, --reason TEXT, --no-wait, --wait DURATION, --json. Root only. See Migrate on the same server.

Completion

Prints a shell completion script for command and subcommand names and the global flags. It does not complete flag values or positional arguments like app names. For bash, source <(levelrail-cli completion bash); run levelrail-cli completion -h for the zsh and fish install lines.

Settings

Instance wide configuration, gated at the root ability server side on every write.
  • oauth set <provider> enables, configures or disables one sign in provider; <provider> is google, github or oidc.
  • email get|set reads and writes the primary provider plus the sender identity and is kept for scripts that predate providers. email providers manages one primary and at most one backup: the first provider added is the primary, the second the backup, and sending falls over to the backup when the primary fails before a message is accepted. The credential is read from stdin (--secret-stdin) or a hidden prompt, never from arguments; set keeps the stored one unless you supply another. test <id> sends through that provider alone, promote <id> swaps the roles, and rm on the primary is refused while a backup exists.
  • ingress get shows the primary domain, ACME settings, the automatic hostname toggle and the detected public address. ingress set changes them (--primary-domain, --acme-enabled, --acme-email, --acme-directory-url, --fallback-domains=false, --hsts-enabled, --apps-base-domain, --dns-cname-target, --dns-ttl, --dns-proxied); flags you leave out keep their current value.
  • ingress https status shows whether the dashboard’s free sslip.io HTTPS is off, pending, issued or failed. ingress https enable points the dashboard at <dashed-ip>.sslip.io and issues a real Let’s Encrypt certificate for it, with no DNS setup. --email defaults to your admin account email. Plain HTTP sign-in stops once the https dashboard URL is saved.
  • edge get|set|fix shows and changes request limits and the trusted proxy list; fix detects the proxy in front of this server and trusts it. levelrail-cli ingress-limits show|set|clear APP is the per-app request body cap. See Domains and ingress.
  • dashboard-url set sets the public dashboard URL; once it is https://, sign in over plain HTTP is refused (--url "" clears it).
  • dashboard-url fix switches the URL to https:// on the primary domain once it answers over https with a valid certificate. The same Fix button sits in Settings, General (Settings health) and Security. CLI and MCP gating of beta features follows the Settings switches (APP_EXPERIMENTAL stays an override).
  • deploy-url-copies sets whether retained deploy copies are off, private (suspended, no public host or certificate, the default) or public; a stored value wins over APP_DEPLOY_URL_COPIES and applies without a restart. updates configures the release channel and auto update checking. deploy-freeze manages fleet wide freeze windows; per app windows are under apps freeze.
  • ai-assistant is experimental (APP_EXPERIMENTAL=ai-chat): get shows the active model, the fallback chain and the limits (keys are never returned), providers list|set|test|remove|models manages provider keys, use <provider> <model> picks the active model, fallback set sets the fallback chain, and usage shows token use.

Git integrations

  • git-providers shows connection status and capabilities (list branches, register a webhook, authenticated clone) for GitHub, GitLab, Bitbucket and Gitea in one call.
  • git-providers repos lists every repository a provider connection can see from the control plane’s cached list, with server-side search, owner, archived and fork filters. --all pages through every match, --refresh re-lists from the provider first.
  • Connecting a provider is dashboard only, because it is a browser redirect through the provider’s own OAuth or manifest flow. Once connected, these commands browse its repos and branches, connect one as an app’s git source with use-as-source, or check and forget the connection.
  • disconnect forgets the stored connection and revokes the token at GitLab. It does not uninstall the GitHub App, and Bitbucket and Gitea have no revocation API; the output says what applied.
  • git-providers shows a HEALTH column. A connection that needs the operator (needs_reauthorize, revoked) prints the page to open to reconnect, since connecting is a browser redirect.
  • github-app register-url prints the dashboard link that starts GitHub App registration, for your personal account or, with --owner, an organization. --public lets other accounts and organizations install the App. It makes no request; open the link in a signed-in browser.
  • github-app installations add prints the URL to install the App on another account or org; it does not open a browser. installations remove is refused (409) while a git source still points at a repo under it.

Templates

list browses the curated service catalog with license and trust columns, or --custom for your own saved templates. --license-class, --arch and --hide-deprecated filter on the server, --category matches the CATEGORY column case-insensitively on the client, and deprecated entries are marked, not hidden, by default. get shows one entry including its license, trust, verification (image tag and architectures) and any deprecation notice, then its full compose.yaml. deploy deploys a template’s compose.yaml as an app, and the app name defaults to the template id; pass --name to use another. A custom template works with every verb the same as a built-in one, except delete: only a custom template can be deleted (see apps save-as-template). templates service calls the server side /service-templates routes: list and show read the catalog, validate -f posts a submission and prints each field error (exit 1 when invalid), and install and deploy print a plan and change nothing until you pass --yes. deploy here is the one-click trial deploy under a generated app name. See Templates. import saves a local compose file (or - for stdin) as a custom template through POST /api/v1/templates/custom. The id defaults to the file name; an id used by a built-in or an existing custom template is refused. --var names a ${NAME} placeholder the file must use. import saves a local compose file (or - for stdin) as a custom template through POST /api/v1/templates/custom. The id defaults to the file name; an id used by a built-in or an existing custom template is refused. --var names a ${NAME} placeholder the file must use. install is for manifest templates (the ones get shows with settings): it fills each ${KEY} setting from --env, a generated secret or its default, puts the listed services behind --domain hosts, and deploys the result as a compose app that is not a trial. See Compose apps.

Compose

  • deploy deploys or updates a stack and records a numbered revision; -f - reads stdin. --profile-name enables services behind compose profiles:.
  • preview asks the server to parse and check a file without saving anything, lists each service with its generated and required env vars, and exits with code 2 when the file would be rejected.
  • status prints the stack phase and each service’s ready state with the reconciler’s reason.
  • logs merges recent lines from every service, or hands one service to apps logs with --service, where -f follows it.
  • redeploy recreates every service’s containers, or one service’s.
  • rollback re-applies an earlier compose file (default: the one before the latest) as a new revision.
  • down removes every service and its containers; named volumes and generated secrets are kept unless you pass --volumes.
  • schedules runs a command on a cron schedule inside one service’s running container. run starts it now, runs prints the history with exit codes, pause and resume toggle it.
See Compose apps.

Static sites

list shows every build.type: static app served directly through the embedded Caddy ingress, with no container involved. The routes commands show a site’s redirect, rewrite and header rules, run one request through them, and check _redirects and _headers files without deploying. See Static site routing rules.

Response cache

  • cache status shows the hit rate and bandwidth saved for one app, or the instance table without a name. cache rules set --preset static adds the static assets rule; --file replaces the policy from JSON. Purges are recorded in cache history. See CDN and caching.

Images

  • images list shows every image on a node with size, owners and why it is kept. images gc previews until --apply and never removes live images, rollback targets or recent deploys. images verify checks a cosign signature and exits non-zero when it fails. images retention set sets how many deploy images one app keeps (2 to 1000, 0 follows the global setting); --dry-run lists what the next cleanup would remove and saves nothing. See Images.

Getting started

Install the control plane and deploy a first app.

Deploying and managing apps

The app lifecycle, command by command.

App spec reference

Every field of app.yaml.

Feature catalog

The complete feature overview.

kubectl style commands

explain documents a resource kind or field from the embedded schema and works offline. It also accepts an app.yaml path (explain services.web.health.readiness, or a bare service field such as explain replicas) and prints the description, type, allowed values and default; explain appspec lists the top level fields, an unknown path suggests the closest match, and --json prints the result as JSON. api-resources lists the kinds. rollout forwards to apps wait, apps deploys list, apps rollback and apps restart. There is no rollout pause or resume: no API holds a rollout open, so use apps freeze for scheduled windows. config works over saved profiles: use-context makes one the default, and --profile or APP_PROFILE still win. -n is --project before the command name, and -A (or --all-projects) ignores the saved and environment project for one run. -o is shorthand for --output when its value is an output format. See CLI output formats for yaml, wide, name, custom-columns and jsonpath.

MCP OAuth clients

Experimental and root only. With the mcp-http feature on, remote MCP clients that use OAuth must be pre-registered here or in the dashboard (Settings > CLI access > Connected AI clients). See OAuth for remote clients.
create prints the generated client_id; public clients have no secret. --scope defaults to mcp:read. delete also revokes every token the client was granted.

Incidents

With APP_INCIDENTS_ENABLED, internal incidents opened from monitors and alerts are managed here. Nothing is public until publish. See Monitors for the API and the draft rules.
list and show need read:sensitive; the rest need write. publish refuses an empty draft client side and sends the updated_at it fetched, so a draft edited by someone else in the meantime is not published unreviewed. incidents postmortem works on resolved incidents only. draft fills the impact window and alert list from the incident, edit changes only the flags you pass (--action-item replaces the saved list), and publish locks the postmortem for good.

Analysis reports

With APP_ANALYSIS_ENABLED=on, a firing alert or spend alert writes a deterministic report for the affected app: a summary, a timeline, ranked suspected causes with evidence ids, and recommendations. No model is called. Reports are read only.
Tuning: APP_ANALYSIS_WINDOW, APP_ANALYSIS_BASELINE_WINDOW, APP_ANALYSIS_ANOMALY_Z, APP_ANALYSIS_MIN_INTERVAL (per app rate limit) and APP_ANALYSIS_RETENTION. Right-sizing thresholds: APP_ANALYSIS_HEADROOM_MEMORY and APP_ANALYSIS_HEADROOM_CPU (multiplier over p95, above 1), APP_ANALYSIS_SIZING_RAISE_AT and APP_ANALYSIS_SIZING_LOWER_AT (p95 as a fraction of the limit), and APP_ANALYSIS_SIZING_MIN_COVERAGE (history needed before a suggestion). Unset values keep the engine defaults.

Certificates

Shows the certificates the public CA issued for this server in the last 7 days, against the warning level in the runtime setting certificates.weekly_issue_warn. It exits 0 either way and only informs. See Runtime settings.

Custom dashboards

Boards of metric, log, deploy and cost widgets. export prints a portable JSON document you can commit to git, and import creates a board from one. Templates are app-health, fleet-overview and cost; the app templates need --target APP. See Custom dashboards.

Docker guard

The control plane reaches Docker through an allowlisting proxy. In enforce mode a request a rule denies gets a 403 and never reaches Docker. audit (the default) allows everything and logs and audits would-be denials. off removes the proxy and takes effect after a restart. APP_DOCKER_GUARD on the server overrides this setting. See Docker access.

Port forward

Opens a local port, bound to loopback only, that relays to an app container port or a managed database through the control plane. A bare name means an app. For a database the remote port may be left out. --service picks a service of a multi-service app. It is an alias over apps tunnel and databases tunnel.

Private networks

map shows who can talk to whom, with blocked paths and fixes. apply re-enforces the networks and allow rules on Docker now. See Private networks.

Private macOS VM

Experimental. Set APP_VM_EXPERIMENTAL=on to use it.
Runs Levelrail in a private Linux VM on macOS with no host folders mounted. vm shell opens a guest shell where the VM user has passwordless sudo, so the VM is the boundary. Settings live in a host file, and the environment only seeds it at init. An export archive holds the control plane database and its secrets. Keep it private; without --encrypt it is clear text. See Desktop runtime. The up and deploy inference reads an optional definition file (levelrail-definition.json, schemaVersion 2) with dockerfilePath; an explicit --dockerfile or --image wins. apps scale --swap-memory sets the combined memory plus swap limit (it must be at least the memory limit) and --cpuset-cpus pins the app to a CPU list such as 0-1 or 0,2. Neither can be combined with service=count pairs.
Last modified on November 10, 2026