Skip to main content
Reference

CLI

Reference for the optional rivet CLI: deploy to Rivet Compute and run local dev for serverless platforms.

The rivet CLI (@rivetkit/cli) is optional. You only need it for:

Use caseCommand
Deploy to Rivet Computerivet deploy
Local dev for serverless platforms (Cloudflare, Supabase)rivet dev --provider <name>

Run it with your package runner:

npx @rivetkit/cli <command>
CommandDescription
rivet devRun a local engine and your handler’s dev server.
rivet deployBuild and deploy the project to Rivet Cloud.
rivet poolList or delete compute pools in a namespace.
rivet engineRun the bundled rivet-engine binary directly.
rivet setup-ciInstall the GitHub Actions deploy workflow.
rivet tokenMint a namespace-scoped token.

rivet dev

Starts a local engine, spawns your dev server, and registers the serverless runner pointing at it. The engine keeps running across restarts; Ctrl-C stops only the dev server.

rivet dev [--provider <serverless|cloudflare|supabase|none>] [--port N] [--fn-name NAME] [--url URL] [-- <command>...]

--provider selects how the dev server is launched. Anything after -- is appended to the preset command (or is the command to run when no provider is set).

--providerSpawnsPort
(omitted)your -- <command> (needs --port)from --port
serverlessyour -- <command> (gets PORT)auto
cloudflarewrangler dev8787
supabasesupabase functions serve54321
nonenothing (engine only)

For cloudflare, the CLI also passes the engine endpoint as --var RIVET_ENDPOINT:..., so the Worker connects back with no wrangler.toml config.

FlagDescription
--portHandler port. Required without a provider unless --url is set.
--fn-nameSupabase function name (default rivet).
--urlExplicit handler URL, overriding port and path.
--engine-binaryPath to a rivet-engine binary.

rivet deploy

Builds and pushes your project’s Docker image and upserts the managed pool, printing the dashboard URL. Deploys target the default pool unless you pass --pool; a new pool is created on first deploy. See Deploying to Rivet Compute.

rivet deploy --token cloud_api_xxxxx

The token is saved to ~/.rivet/credentials (also read from RIVET_CLOUD_TOKEN), so later deploys can omit it.

FlagDefaultDescription
--tokenenv / credentialsRivet Cloud API token.
--namespaceproductionCloud namespace.
--pooldefaultCompute pool to deploy to.
--project / --orgfrom tokenOverride project/org.
--dockerfileDockerfileDockerfile to build.
--build-context.Docker build context.
--env KEY=VALEnvironment override, repeatable.
--imageproject slugImage repository name.
--taggit short SHAImage tag.

rivet pool

Manages the compute pools in a namespace. A namespace can hold multiple pools; default is the one used when a deploy or logs command omits --pool.

rivet pool list

rivet pool list

Each pool is printed as a status line (colorized by status) followed by its config (display name, image, resources, environment) and any error. Colors are disabled when stdout is not a terminal or NO_COLOR is set. This human-readable format is not stable; pass --json for machine-readable output.

FlagDefaultDescription
--tokenenv / credentialsRivet Cloud API token.
--namespaceproductionCloud namespace.
--project / --orgfrom tokenOverride project/org.
--jsonEmit raw JSON instead of formatted output.

rivet pool delete

Tears down a compute pool, then waits until it is fully removed, printing status changes as it goes. Prompts for confirmation unless --yes is passed, and refuses to run without confirmation when stdin is not a terminal.

rivet pool delete <name> --yes
FlagDefaultDescription
--namespaceproductionCloud namespace the pool belongs to.
--yesSkip the confirmation prompt.
--tokenenv / credentialsRivet Cloud API token.
--project / --orgfrom tokenOverride project/org.

rivet engine

Runs the bundled rivet-engine binary directly, against the same local database and ports as rivet dev. Arguments are forwarded verbatim.

rivet engine nuke      # wipe local engine state
rivet engine wf list   # inspect workflows

rivet setup-ci

Installs .github/workflows/rivet-deploy.yml, which deploys to Rivet Cloud on push and pull request. Add --force to overwrite. Then set the token secret:

gh secret set RIVET_CLOUD_TOKEN

rivet token

Mints a namespace-scoped token for connecting to Rivet. Only the token is printed to stdout, so it can be captured directly by scripts (e.g. TOKEN=$(rivet token create --kind secret)).

rivet token create --kind secret
--kindPrefixUse
secretsk_Server-side runner/runtime token.
publicpk_Client token: resolve and manage actors.
connectionck_Client token limited to resolving actors and opening connections.

By default the namespace must already exist. Pass --create-namespace to create it first (useful for per-branch CI namespaces).

FlagDefaultDescription
--kind(required)Token kind: secret, public, or connection.
--namespaceproductionCloud namespace.
--create-namespaceCreate the namespace if it does not exist.
--tokenenv / credentialsRivet Cloud API token.
--project / --orgfrom tokenOverride project/org.

Engine binary resolution

rivet dev and rivet engine resolve the rivet-engine binary from, in order: --engine-binary, RIVET_ENGINE_BINARY_PATH, a binary bundled next to the CLI, a local target/{debug,release} build, then an auto-downloaded release. Set RIVETKIT_ENGINE_AUTO_DOWNLOAD=0 to require a local binary.