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 readsLEVELRAIL_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 keycli-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.
apps deploy; deploy an image to an existing app.
apps rollback; without --image it goes back to the previous successful deploy.
apps logs <app>. The log archive and search commands keep their names (logs archive, logs search, logs dump).
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
<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):
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 --repoacceptsssh://URLs as well as https.apps createregisters an existing image or triggers a real build from a git repository;--filereads an app spec,--interactiveruns a step-by-step wizard. Required flags missing outside--interactivefail 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 asapps health set.apps statusshows an app’s current reconcile conditions;apps overviewshows CPU, memory, traffic and errors for every app (or the names given) in one request;apps networkshows 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 --filesends a service’spublished_ports(container_port, host_port, protocol tcp or udp).apps get,apps listandapps deploy-composeshow them as53/udp, and--jsoncarriespublished_ports. Refusals print the server message plus a hint.apps initwrites a starterapp.yamloffline. 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--forceis 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 oneerror path: messageline per issue and exits 2 when invalid. Files over 1 MiB are rejected before any request.--jsonprints 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 isunknown.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.--jsonprints the raw response.apps validateparses 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-blockingnoticesentry a real deploy would also surface.apps deleteremoves 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 72hsets 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 ondeploy.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-dataalso needs write:sensitive and an app on the control plane’s own node.--clearneeds deploy ability and always cancels a pending delete; a stopped app stays stopped untilapps start.apps restart-schedule <app>shows an app’s scheduled restart.--schedule EXPRsets it: a 5 field cron (0 3 * * *, with--timezone, default UTC) or@every 24h. Restarts must be at leastdeploy.restart_schedule_min_intervalapart (default 1h, never under 5m), and one sweep restarts at mostdeploy.restart_schedule_max_per_sweepapps per control plane. Each run uses the same restart path asapps 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 afterdeploy.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--clearneed deploy ability on the app, likeapps 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 keepturns 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 maintenanceshows, enables or ends the maintenance page on every domain of an app at once, all or none.showneeds read access,setandclearneed deploy access. Use--for,--untilor--max-durationso it ends on its own; the server enforces the limits. For a single domain usedomains maintenance.apps waitpolls 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) orlast rollout: restarted (no new deployment was created);--jsoncarries the same asoutcome.apps deploy-specfans an app.yaml’sservices:map out into independent builds under one app;apps groupshows a service’s siblings under the same multi-service app.apps builds triggerbuilds an image from a git source and deploys it to an existing app.apps promotepromotes the app’s image onto a sibling app in another environment.--releasepromotes a specific release id fromreleases listinstead of the one the app is bound to.apps rollback --release IDredeploys that release by its digest pinned ref and retargets the binding. Both--releaseflags needAPP_RELEASE_BINDINGS=onon the server and answer 404 for a release that does not belong to the app.apps applyrestarts an app so saved env, secret and config changes reach the running container; it does nothing when nothing is pending.apps scalechanges the replica count and/or the deploy strategy. Withservice=countpairs 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 Srecreates one service.apps hook-runsshows the most recent outcome of an app’s pre and post deploy hooks;apps imageslists the locally present image tags under the app’s current image repo.apps setchanges app settings.--pr-comment-commands on|offlets write-access users run/levelrailcommands from pull request comments (see Pull request comment commands).apps import-bundle <file>imports a tar written byapps export <name> --out -on another instance. It needs thewriteability, runs the same checks as a compose deploy (spec, quotas, scope, bind mounts need root), and saves the services stopped unless--deployis set (which needsdeploy).--dry-runprints 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--nameto import under another name, or--replace --confirm <name>withwrite:sensitiveto replace it. Secret values are never in a bundle and a bundle holding.envis refused. Size, entry count and file size caps are theapps.bundle_import_max_bytes,apps.bundle_import_max_entriesandapps.bundle_import_max_entry_bytesruntime 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 byapps clone, written toNOTES.mdbyapps export, and capped by theresources.description_max_charsandresources.notes_max_bytesruntime settings.apps getprints them, and--output jsonincludesdescriptionandnotes. Never put secrets in notes: anyone who can read the app can read them. Databases take the same fields overPUT /api/v1/databases/{name}/notes.apps set-nodeandapps clear-nodemove an app to another node, or back to the control plane’s own local node. With--with-volumesthe named volumes move too, andapps movesshows the history of those moves.
Deploy history, approvals and automation
apps deploys listis real, row per attempt deploy history, newest first.apps deploys attemptsis an alias;--fail-on-errorexits 7 when the newest listed attempt failed.apps deploys showprints 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 waitblocks 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 comparediffs two deploy attempts, or one against the current live state.apps deploys logsprints one attempt’s full build and log output to stdout.apps deploys stepsstreams 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,--keynarrows 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) andimage-status(whether the tag moved and the architecture matches the node).--jsonprints the API body unchanged (with--key, only the env list is narrowed). The view may also come first, as inapps inspect image-status web. Secret values stay masked as the API returns them.apps deploys failedlists 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 cancelcancels a queued or in-progress deploy before it cuts traffic.apps deploys rollback-toredeploys a past succeeded deploy’s exact image, pinned by digest or rollback pin, with that deploy’s config;--watchfollows it through the readiness gate.apps deploys gate(aliasdeploy status) prints a release’s gate timeline: readiness passes, stable window, cutover, drain, rollback pin and post-deploy watch.--watchfollows 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-safetyshows and overrides the per-app thresholds (set web --stable-window 20s --auto-rollback false,defaultclears one) and lists pinned rollback targets. See Deploy safety.apps timelineshows 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 diagnoseexplains a failed deploy or crashloop and can apply a suggested fix with--apply-fix N.apps preflightruns pre-deploy checks (DNS, ports, disk, image, env).apps deploy,apps rollback,apps restart,apps startandapps stopexit non-zero with codenode_offlinewhen the app’s node is offline, naming the node and the fix (bring it back, orapps move/nodes drain).--queue-while-offlinerecords the change as apendingattempt that the node applies when it returns.apps upgrade-planprints what moving a template app to the current catalog entry would change (risk, image, env, volume and port changes, blockers) and changes nothing.apps upgradeshows the same plan until--yesis given, then applies it, follows the release and reports a rollback if one happened;--no-waitreturns once it has started. Seedocs/template-upgrades.md.apps freezemanages 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 needsapps deploy --override-freeze --override-reason TEXT.setreplaces the app’s windows with the one given. Fleet-wide windows are undersettings deploy-freeze.apps scheduleconfigures a recurring redeploy of a branch’s latest commit on a cron schedule.apps deploy --atschedules a one-shot image or git ref deploy, andapps schedule listandapps schedule cancelmanage those (see Scheduled deploys).apps cancel-supersededlets 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.jobsmanages an app’s scheduled jobs: fresh-container or exec cron jobs with run history, logs, retries and catch-up (see Scheduled jobs).apps scheduled-tasksis the older exec-only form of the same resource. Guard rails oncreateandupdate:--overlap allow|skip|queue-onedecides 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-failurereports failed runs tojob_failingalert rules scoped to the app (at most one notice per rule and job perjobs.failure_alert_window_seconds, with the job name and exit code, never output; a failed delivery is retried), and--keep-runs Nand--keep-days Nbound the job’s history (capped byjobs.retention_max_runsandjobs.retention_max_days).--timeoutis clamped tojobs.timeout_min_secondsandjobs.timeout_max_seconds, and a run past it is stopped.functionsruns 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|gowrites a ten line starter,functions listshows state, calls and p95 duration (see Functions).apps sleepstops an app after it has had no requests for a set time and wakes it on the next request (see Sleep when idle).apps canaryruns a new image beside the app and sends it a share of traffic until you promote or abort it (see Canary deploys).apps auto-updateredeploys an app automatically when its image tag moves to a new digest (see Image auto-update).apps auto-rollbackopts an app into or out of automatic rollback when a crashloop alert fires.apps auto-rollback-slo-burnsets how the app reacts when an SLO burn rate alert fires.
--cursor paging), counts by status with failure rate and duration percentiles, and a live event stream (--json prints one object per event).
list defaults to pending. approve runs the gated deploy or promote now; reject leaves the app’s desired state untouched.
Domains, ports and traffic
apps domains addcreates the DNS record when a provider is connected (--dns offskips it,--dns previewshows it);--waitprints the go-live steps and exits non-zero when the domain is not live within--timeout. See Add a domain and go live.apps domainsshows 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 streamsforwards a host port to one container port as raw TCP (onlytcpis supported). A stream change takes effect on the app’s next container recreation, such as an image change orapps restart.apps egressrestricts an app’s outbound traffic to the declaredhost:portpairs; with nothing configured, egress is unrestricted. DNS and loopback traffic stay open regardless.apps runtimeshows or changes a service’s container options (see Runtime options). A flag replaces that option and the rest stay;--unsetclears options. A change recreates the container.apps exec-accessis on by default. When disabled,apps execand the interactive terminal are refused whatever abilities the token has.
Run, logs and metrics
apps execruns a command in the app’s container and exits with its real exit code.apps runruns a command once (no retries unless--retries Nis 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-- listit runs once and prints the output. Templates that declare no console are refused with a pointer toapps 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 logssearches an app’s stored log entries (--since 10m,--tail Nor-n N,--service S), or streams live with--follow. On a terminal with no search flag it follows live by default;--no-followand piped or--jsonoutput give stored entries. For a capped excerpt seelogs queryunder Logs.apps requestsshows request rate, errors and latency from the ingress;apps resource-usageranks 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 APPshows the app’s release snapshots, newest first, with image digest, creation time, source reason and the current release marked. The list stays empty unlessAPP_RELEASE_BINDINGSisshadoworon;--jsonprints the raw response.apps resource-recommendationsuggests memory and CPU limits from historical usage;apps costestimates what the app’s CPU and memory would cost under reference providers (not a real bill).costs explore|budgets list|create|set|deleteis 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|budgetsshows cost showback and manages prices and budgets, see usage and cost.usage report --csvprints the export.budget set|delete project|team IDis an alias forusage budgets.budget show|set|clear APPmanages a per-app egress and cost cap, see spend caps.advisor findings|summary|apply|dismiss|snooze|restore|enable|disabledrives the beta resource advisor.advisor apply IDonly previews; add--yesto apply.apps vitalsprints the 7 day p75 of LCP, INP, CLS, TTFB and FCP overall and per route.apps next-cache set NAME redis|nonesets where a Next.js app keeps its page cache.redisshares it across replicas through the linked Redis database and addsLEVELRAIL_NEXT_CACHE_URLon every path that saves the app, not only on a build deploy. Containers pick it up on the next restart or deploy.apps health-scoregives a synthesized pass, warn or fail readiness verdict across deploy health, security, resilience and observability.apps log-drainforwards container logs to an external HTTP or syslog sink, in addition to the built-in node-local log store.apps scheduled-tasksruns 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 setsets one probe and keeps the other. A probe is an HTTP(S) check or a command run inside the container (exit 0 is healthy).--presetfills path, interval, timeout and failures from a shortcut (healthz,health,api-health,ping,status); explicit flags win.apps health discoverprobes well-known paths and reports what each one did.apps volumesmanages 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 setattaches a connected bucket as object storage and injects its credentials asS3_*env vars at container create time. See Object storage.apps build-cacheconfigures the BuildKit remote cache on a storage destination.--globalapplies to every app without its own setting.clearis bounded per call; run it again while it reports more to delete. A cache problem never fails a build.apps build-settingsstores per-app build options that every later build uses; saving never starts a deploy.--builderand--dockerfileupdate the connected git source.--targetnames a multi-stage stage (letters, digits,.,_,-),--no-cacheskips the layer cache on Dockerfile builds and--providerpins the Railpack provider, so a build that detects another one fails. Values are capped bybuilds.setting_value_max_bytes.--builderand--dockerfileneed thewrite:sensitiveability, likePUT git-source/build; the other flags needwrite. 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 importmerges 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_URLand URLs with credentials) go to the secret store and the rest to plain env.--all-secretssends every key to secrets,--all-plainkeeps every key in plain env, and--secret-pattern STRIPE_*,*_DSNadds 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-applykeeps the change pending whenapps.env_apply_on_setis on.apps env diffcompares 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 exportwrites env vars as .env text; sensitive and secret keys are written empty with a comment unless--revealis given.apps env getprints one variable, masked when sensitive.--revealasks for your password (and authenticator code) at the prompt, never from flags or the environment, and needs a token withread:sensitiveandsecrets:revealplusAPP_SECRET_REVEAL_TOKENS=onon the server. See Environment variables and secrets.apps secrets setsets or rotates one secret’s encrypted value and declares the key as secret backed so it is injected;--applyrestarts the app now. With--env-fileit bulk imports every key in a .env format file as its own secret. Values are never returned:listshows key names and locked state only.locktoggles a secret’s overwrite guard.apps vault-envdeclares an env var resolved live from the configured external Vault (see Vault); only the reference is stored.apps preview-envandapps branch-envoverride 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 asrelease/*);--secretstores it envelope encrypted. Neither affects the app’s own running deploy.apps branch-deployschooses which branches get a stable per-branch deploy (see Preview environments), lists the live ones and removes one now.apps contextssets env and build overrides per deploy context and shows the effective config (see Deploy contexts).
Source, previews and webhooks
git remote add <app>andgit 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/configand is read fromLEVELRAIL_GIT_TOKENat push time (--credential-helperis an accepted no-op alias);--store-token-in-configwrites it into.git/configinstead, stored unencrypted in the repo config.apps git-sourceconnects a repo for auto deploy on push;settingssets 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 thegit.submodules_*runtime settings);rotate-secretmints a fresh webhook secret, shown once.apps webhook-deliverieslists recent inbound webhook requests, verified or not.replayre-runs a stored delivery’s payload and can trigger a real build and deploy.apps previewsmanages preview environments per pull request, see Preview environments per pull request.previewsis the same command at the top level.extendkeeps one preview past its TTL;settingsshows or changes the lifecycle, resource, database and exposure policy.limitsshows or changes preview caps, fork policy and TTL;approvedeploys a held fork pull request once;teardownremoves one PR’s preview now;sweeptears down every stale preview across all apps now;pr-statustoggles 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 connectis the canonical way to attach a database;apps database setkeeps working for the single-database form.apps connectconnects an app to a managed database and injects its resolved connection value as an env var; unlikeapps database, an app can have any number of these.connections listshows each connection, including whether it resolves to a mesh DNS name (cross node capable) or a container name;connections suggestlists databases the app could connect to.apps disconnectremoves one connection by its env var name.apps database setattaches one already created managed database as the app’s connection env var source (defaultDATABASE_URL, fieldurl);cleardetaches it.apps save-as-templatederives 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 tagattaches a tag by name, creating it if new;apps untagdetaches 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-setreplaces that scope’s shared env vars. For per scope secrets see Shared env. - A protected environment requires
--confirm(or an interactive yes) onapps deploy,apps rollbackandapps promotetargeting an app tagged with it, and routes the deploy through deploy approvals. apps environments clone-previewshows what cloning would create without applying it;env-diffdiffs two environments’ resolved effective env vars.apps projects topologyprints a diagram ready graph of a project’s apps, databases and volumes. See Projects and organizations.
Tags
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
validatechecks a pipeline file locally with no API call and exits 2 when it has problems.savecreates or updates pipelines from one file, or from every file in a repository’s pipeline directory.runslists runs, or shows one run’s jobs, steps and approval gates;--alllists runs across every app.run --paramsets a declared run parameter (--inputis the older spelling).artifactslists 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.approvedecides approval gates, or releases a run held for approval.syncsyncs pipeline files from the repository now, or sets the repository as source of truth.triggersshows why recent git events did or did not start runs.oidcshows whether pipeline jobs can mint OIDC tokens and the JWKS URL to wire to a cloud provider;oidc rotate-keyrotates the signing key, and the old key stays published until it retires.
Load balancers
Experimental: requiresAPP_EXPERIMENTAL=load-balancer. See Load balancing.
listshows every load balancer across apps with upstream health.setcreates or changes the load balancer and only the flags you pass change;clearremoves it, back to a single upstream.statusis the live upstream table;checkprobes every upstream once, right now;historyshows recent checks and state changes per upstream;upstreamsets an upstream active, draining or disabled.exportgenerates an infrastructure as code definition with no cloud API calls;importloads theloadbalancer:block of an app.yaml.
Preview
Deploy previews are the screenshot or metadata card captured after a deploy, not pull request previews (those areapps 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
-
statusshows a database’s current reconcile conditions (useful when it exists but is not running yet). -
importalso accepts an export made bydatabases exportwhen 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-hostedcopies a hosted Postgres (such as Heroku) into an existing managed Postgres database. The source URL is read from the environment variable named by--from-envor from the first line of stdin, never from an argument.--dry-runruns the preflight only and prints blockers, warnings and info with the fix for each. Without--writes-frozena real run refuses. Exit code 1 means the preflight is blocked or the move failed. See Migration reference. -
deletestops and removes a database but keeps its data volume;--forceis needed if apps use it. -
slow-querieslists a Postgres or MySQL database’s slow query log. -
schemalists a SQL database’s tables with row estimates and sizes;queryruns one statement through the control plane, read-only by default. See Database viewer.dbis a short alias fordatabases. -
set-resourcesapplies memory and CPU limits to an already created database, replacing whatever was set before (a full replace, not a patch). -
public-access setexposes a database on a host port;--bind-addressisprivate(the default),public, or a literal IP. -
set-versionis a minor or patch image change on the same data.major-upgradeis a guarded Postgres major upgrade with a rollback snapshot;major-upgradeslists the attempts,major-upgrade-rollbackrestores the pre upgrade data, andmajor-upgrade-discarddeletes a rollback snapshot to free disk. -
paramsedits engine tuning parameters (Postgres, MySQL, MariaDB, Redis, Valkey, MongoDB) from a fixed allowlist with typed values.set,unsetandrollbackonly stage a change;apply --yes(needs write:sensitive) or the nextdatabases startrestarts the database with it. See Managing databases.
AI models
Experimental: requiresAPP_EXPERIMENTAL=ai-models. See AI models.
deployruns a model as a container on a GPU node and prints its API key once. Flags:--engine(ollama,vllmorllamacpp),--model,--node,--gpus(a count orall),--gpu-devices,--context,--quantization,--domain,--hf-token-from-env,--residency(alwaysoron_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).cataloglists the curated CPU models with licence, memory need and an estimated speed on this server.benchmarkmeasures a running model.fit --compute cpurates a model against the node’s CPUs and memory.logssearches a model engine’s logs, or--followstreams download and load progress live.deletekeeps the downloaded weights volume.restartrecreates the engine container.rotate-keyissues a new API key, printed once;keysmanages named API keys with limits, expiry and rotation grace;usageshows gateway requests, tokens, errors and latency per key.residencysets a model always resident oron_demand(stopped when idle, started on first request);wakeandsleepstart or stop an on demand engine now;swap-grouplets models share a GPU (--clearremoves it).fitestimates VRAM fit on each GPU node;gpuslists GPU nodes with VRAM and usage;preflightchecks a Hugging Face repo (access, size, quantizations, fit, disk);metricsshows engine metrics.cache listshows cached model weights per node;cache pruneremoves unused, unreferenced weights (use--dry-runfirst).
Auth
loginauthenticates and persists a new API token; with--profile NAMEit saves under a named profile instead of overwritingdefault.login --device --jsonprints 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-linkmints 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.codeprints 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;approveanddenydecide one of those (approveneeds--matchwith the two digit number the waiting browser shows, typed in; a wrong number denies it, and the number is never printed bycode), anddeviceslists or revokes browsers trusted for password sign-in. They need a token that belongs to your user. Listing anddevicesacceptwrite:sensitive; showing a code needssignin:approve, which no device login, root orwrite:sensitivetoken carries;approveanddenyneedsignin:approveor 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 withlevelrail-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-loginshows or changes who may sign in with a code (changing it needs root). See Identity and access.devices trusted listanddevices trusted revokeare the same calls asdevicesas a list and revoke pair;revokeasks first and needs--yeswhen stdin is not a terminal.sign-in-requests listshows waiting code requests and new-browser sign-ins without any code, andsign-in-requests reveal <code-id>prints one code once on stdout (never saved; needssignin:approve, and a refused reveal shows the server error and how to get that token).activityshows your own account activity feed (needs a token that belongs to you withread:sensitive);preferencesreads or changes your timezone, language, theme, landing page and Gravatar choice;exportrequests the data bundle, waits and saves the zip (mode 0600);unlinkremoves a linked sign-in provider and refuses to remove your last way in;delete-accountpermanently deletes your account after the typed email and your password. See Your account.- Every
2fasubcommand needs a live session:--usernameand--password(prompted if omitted), never the CLI’s saved bearer token.setupstarts enrollment and returns a secret and provisioning URI;enableconfirms it and returns recovery codes once;recovery-codesregenerates them and invalidates the old set.
Auth engine
Profile
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.
-
standalonemanages standalone domains: domains with no app that proxy toPORT,HOST:PORT, anhttp(s)://URL,app:NAME[:PORT]orcontainer:NAME:PORT. Options are--upstream-tls,--insecure-skip-verify,--tls-server-name,--host-header preserve|upstream|NAME,--no-websocket,--connect-timeout,--read-timeout,--strip-prefixand--description. Loopback, private, container and control-port targets need--confirm.updatesends only the flags you pass. Per-domain commands take_standaloneas the app name, for exampledomains waf set _standalone tools.example.com. -
listshows every app’s domains in one call.checkruns a real DNS lookup and reports whether the domain reaches this control plane.certificateslists every certificate in certmagic storage, healthy or not. -
basic-auth settakes--usernameand--password.maintenance setserves a fixed maintenance response instead of proxying, without stopping the container.redirect set --target URLredirects every request for the domain; maintenance mode takes precedence if both are set. -
tls-certuploads an operator supplied certificate and key;clearreverts to automatic issuance andrenewforces re-issuance of an automatic certificate. -
wafconfigures the opt-in Web Application Firewall and rate limiting.--modedefaults todetect(matches are logged, never rejected) rather thanblock. -
error-pagessets custom HTML for status code 404, 500, 502 or 503;clearremoves one mapping, or all if--codeis omitted. -
dnsreads 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.removemust match an existing record exactly. -
cloudflare-dns set --cf-api-token TOKENandroute53-dns set --aws-access-key-id ID --aws-secret-access-key KEYconfigure 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, needsAPP_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 verifycompares the NS set the system resolver, 1.1.1.1 and 8.8.8.8 return with the zone’s assigned name servers.records importandrecords templateprint a plan and change nothing until--apply.--replacedeletes sets missing from the file and needs--confirm.
Backups
See Backups and storage.list-alllists backup history across every database and app volume instance wide.deleteremoves one archived backup (destructive).downloadstreams a succeeded backup’s object to stdout.restorerestores in place and is destructive;--confirmtakes the database name.restore-as-newrestores into a brand new database and is non destructive.restoresandclone-restoreslist the attempt history of each.verifychecks a backup is intact without a live restore;verificationslists past attempts.healthshows every backed up resource with its last backup and last verified restore.protectionshows bucket object lock and versioning.drill runrestores a backup into a scratch resource, validates and destroys it, and exits non zero when it fails. See Prove your backups work.volumes restorerestores into a new volume only, optionally named for another app or on another node.
App volume backups
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 whenpitr 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
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
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: requiresAPP_EXPERIMENTAL=cloudflare-tunnel.
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
role_id is echoed on get. disconnect disables and forgets the stored credential.
Channels
--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
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 underapps 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 deleteends a silence now and keeps it in history (silences list --all). silenceis the quick action: silence one rule,--fordefaults to1h.- A maintenance window is a recurring silence: a 5 field cron expression for each start, a
--duration, and--tz(defaultUTC).--scopeisall(default),appornode, with--targetnaming the apps or nodes. historylists firings and resolutions, newest first (--limitdefaults to 50).--outcomeis one ofsent,silenced,grouped,inhibited,failed,ratelimited,flappingorskipped;--eventisfired,resolved,flappingorflap_ended;--sincetakes an RFC 3339 timestamp.--changesadds what changed on the app before each firing, with the most likely cause tagged.
Monitors
Experimental uptime monitors. The server must setAPP_MONITORS_ENABLED=true, otherwise these commands get a 404. See Monitors.
--headervalues are stored encrypted and never returned; only header names are listed.--expecttakes comma separated codes or ranges and defaults to200-399. Redirects are not followed unless--follow-redirectsis 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 untilset --enable. Only public component names, statuses and operator written announcements are published; targets (app names, hostnames, check URLs) stay private. See Status page.
--enableand--disableare mutually exclusive.--domainserves the page on a hostname that the ingress must route to the control plane.- Branding:
--accenttakes#RRGGBB,--logo-urlan https URL (its origin is the only image source the page allows),--aboutplain text.--noindexadds a robots noindex tag (off by default);--powered-by=falsehides the footer credit. Pass an empty value to clear a text field. components set --grouptakes a group ID or its exact name; an empty value ungroups.componentis an alias ofcomponents. Deleting a group ungroups its components.incidents create:--kinddefaults toincident,--impacttonone. Amaintenancekind requires--startsand--ends(RFC 3339).--bodyis markdown-lite.incidents update --statustakesinvestigating,identified,monitoringorresolvedfor an incident, andscheduled,in_progressorcompletedfor 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
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
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
--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
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
<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
Event webhooks
create and rotate-secret print the signing secret once. See Event webhooks.
Scheduled maintenance
CDN overview
--json prints the same object the dashboard CDN page reads.
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.
Search
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
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 localufw. 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
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: requiresAPP_EXPERIMENTAL=iac. See Platform as code for the document format, secrets handling, prune rules and CI use.
--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).
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}.
${{ 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.deletefails while the node still has placements; drain it first.join-tokenmints a one-time enrollment token, shown once.reenroll-tokenmints 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-certrevokes the certificate and closes the node’s session; only a re-enroll token brings it back.securityprints 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 renewasks a connected node to renew its certificate now.cert drillrotates 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 isAPP_NODE_CERT_DRILL_TIMEOUT(30s).cordonmarks a node unschedulable without evacuating it;uncordonreverses that;drainmoves every service and database off a node.listshows each node’s certificate state and days left (CERT) and agent version (AGENT);getadds expiry, last renewal, key origin, platform and commit.resource-usageshows every node’s latest CPU, memory and disk usage plus a fleet rollup;capacity-forecastprojects disk and memory usage forward, roughly how many days until full.meshshows the live WireGuard mesh state and peers;rotate-keyrotates a node’s WireGuard key;rejoin-meshforces an immediate resync for a stuck peer.providersmanages cloud provider credentials (Hetzner, DigitalOcean) andprovisioncreates a server at a provider and enrolls it as a node;ssh-provisionadopts a machine you already have over SSH.provisionsandssh-provisionstrack either through to enrollment. See Multi-cloud provisioning.topologyis a whole mesh summary (nodes, apps, databases, load balancers, connections);trafficshows per domain ingress reachability and TLS status.
Status
Upgrade
--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
--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
--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
?. 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
--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
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
--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
install.sh --check instead, see Installing.
Version
--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
--limit the server default applies. The dashboard shows the same notes in the What’s new panel.
Init
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
--forceis given. A diff of what would change is shown either way. - Without
--yes, a terminal is asked to confirm; a script must pass--yesor--dry-run. --modeselects 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) orfull.--commentedputs a one line comment from the app schema above eachapp.yamlfield, adds a# default:note where the schema has one, and listsport,env,health,domains,replicasandresourcesas commented-out lines. The output still validates.--out FILEwrites onlyapp.yamltoFILEand skipsAGENTS.mdand.mcp.json;--out -prints it to stdout and nothing else. An existingFILEneeds--force.--api-urlor the active profile is written intoAGENTS.mdand.mcp.jsonwhen known.--mcp-binaryoverrides the MCP server binary name.
API docs
--json, --output and --query. See API explorer.
App types
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.
Deploy link
--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.
/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: requiresAPP_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 chatsends one message and streams the reply to stdout. Without--sessionit starts a new session and prints its id to stderr; pass that id back with--sessionto continue the conversation.--jsonprints one JSON object per stream event.ai sessions resolveapproves or rejects a mutating tool call the assistant proposed (shown byai chatas a pending confirmation), then streams the continuation.
AI control
Control what AI agents can do on your platform.statusshows the current mode, allowed environment kinds, and when it was last changed.setchanges the mode or allowed environment kinds. Agent tokens cannot approve deploy or pipeline approvals, and cannot change this setting.revoke-agentsrevokes every labeled agent token.
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
/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
Go live
--wait it polls and exits 7 until the domain is live or --timeout passes. Supports --json.
Doctor
Doctor text overrides
The labels, usage text and table headers of thedoctor 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
--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
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
--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
--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
Control plane backups
<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
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
IAM
--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
--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
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
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>isgoogle,githuboroidc.email get|setreads and writes the primary provider plus the sender identity and is kept for scripts that predate providers.email providersmanages 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;setkeeps the stored one unless you supply another.test <id>sends through that provider alone,promote <id>swaps the roles, andrmon the primary is refused while a backup exists.ingress getshows the primary domain, ACME settings, the automatic hostname toggle and the detected public address.ingress setchanges 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 statusshows whether the dashboard’s free sslip.io HTTPS is off, pending, issued or failed.ingress https enablepoints the dashboard at<dashed-ip>.sslip.ioand issues a real Let’s Encrypt certificate for it, with no DNS setup.--emaildefaults to your admin account email. Plain HTTP sign-in stops once the https dashboard URL is saved.edge get|set|fixshows and changes request limits and the trusted proxy list;fixdetects the proxy in front of this server and trusts it.levelrail-cli ingress-limits show|set|clear APPis the per-app request body cap. See Domains and ingress.dashboard-url setsets the public dashboard URL; once it ishttps://, sign in over plain HTTP is refused (--url ""clears it).dashboard-url fixswitches the URL tohttps://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_EXPERIMENTALstays an override).deploy-url-copiessets whether retained deploy copies are off, private (suspended, no public host or certificate, the default) or public; a stored value wins overAPP_DEPLOY_URL_COPIESand applies without a restart.updatesconfigures the release channel and auto update checking.deploy-freezemanages fleet wide freeze windows; per app windows are underapps freeze.ai-assistantis experimental (APP_EXPERIMENTAL=ai-chat):getshows the active model, the fallback chain and the limits (keys are never returned),providers list|set|test|remove|modelsmanages provider keys,use <provider> <model>picks the active model,fallback setsets the fallback chain, andusageshows token use.
Git integrations
git-providersshows connection status and capabilities (list branches, register a webhook, authenticated clone) for GitHub, GitLab, Bitbucket and Gitea in one call.git-providers reposlists every repository a provider connection can see from the control plane’s cached list, with server-side search, owner, archived and fork filters.--allpages through every match,--refreshre-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. disconnectforgets 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-providersshows aHEALTHcolumn. 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-urlprints the dashboard link that starts GitHub App registration, for your personal account or, with--owner, an organization.--publiclets other accounts and organizations install the App. It makes no request; open the link in a signed-in browser.github-app installations addprints the URL to install the App on another account or org; it does not open a browser.installations removeis 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
deploydeploys or updates a stack and records a numbered revision;-f -reads stdin.--profile-nameenables services behind composeprofiles:.previewasks 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.statusprints the stack phase and each service’s ready state with the reconciler’s reason.logsmerges recent lines from every service, or hands one service toapps logswith--service, where-ffollows it.redeployrecreates every service’s containers, or one service’s.rollbackre-applies an earlier compose file (default: the one before the latest) as a new revision.downremoves every service and its containers; named volumes and generated secrets are kept unless you pass--volumes.schedulesruns a command on a cron schedule inside one service’s running container.runstarts it now,runsprints the history with exit codes,pauseandresumetoggle it.
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 statusshows the hit rate and bandwidth saved for one app, or the instance table without a name.cache rules set --preset staticadds the static assets rule;--filereplaces the policy from JSON. Purges are recorded incache history. See CDN and caching.
Images
images listshows every image on a node with size, owners and why it is kept.images gcpreviews until--applyand never removes live images, rollback targets or recent deploys.images verifychecks a cosign signature and exits non-zero when it fails.images retention setsets how many deploy images one app keeps (2 to 1000, 0 follows the global setting);--dry-runlists what the next cleanup would remove and saves nothing. See Images.
Related
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 themcp-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
WithAPP_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
WithAPP_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.
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
certificates.weekly_issue_warn. It exits 0 either way and only informs. See Runtime settings.
Custom dashboards
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
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
--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. SetAPP_VM_EXPERIMENTAL=on to use it.
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.