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 engineRun the bundled rivet-engine binary directly.
rivet setup-ciInstall the GitHub Actions deploy workflow.

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. 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.
--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 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

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.