Skip to content

CLI reference

View as Markdown

guv is a single static binary for macOS, Linux and Windows. Everything it does goes through the public API, so anything you can do here, an agent can do through MCP, and vice versa.

Terminal window
# macOS and Linux
brew install guv
# Windows
scoop install guv
# Anywhere with Node.js
npx guv
# Script (checksums are signed)
curl -fsSL https://guv.dev/install.sh | sh

Then sign in. The CLI opens your browser and you confirm with your passkey:

Terminal window
guv login
Flag What it does
--json Machine-readable output with a stable schema. Agents should always use it.
--yes Answer yes to confirmations. Dangerous actions still need a typed confirmation or a human approval.
--no-input Never prompt. Fails instead, with a clear error, if input would be needed.
--project, --env Choose the project and environment. Defaults come from the linked directory.

Exit codes are stable, so scripts and agents can react without parsing text.

Code Meaning
0 success
1 not signed in
2 the request or file is not valid
3 forbidden or denied by policy
4 approval required
5 quota or spend cap
10 temporary, safe to retry

When a command exits with 4, an approval request is waiting for a human. See approval_required.

Signs you in through your browser with the OAuth device flow. The CLI stores a one-hour access token and a refresh token in your operating system’s keychain, never in a dotfile.

Terminal window
guv login

API:

Signs out and removes the stored tokens from your keychain.

Terminal window
guv logout

API:

Shows who you are signed in as, your workspace and your role.

Terminal window
guv whoami

API:

  • guv whoami calls Who am I (GET /v1/me)

Looks at the current repository, detects the stack and writes a starter guv.yaml. It then links the directory to a Guv project.

Terminal window
guv init

API:

Deploys the current directory without needing git. The CLI uploads a source tarball and streams a friendly build log.

Terminal window
guv up

Deploys a service to an environment from its linked repository. Use --wait to block until the deployment is live or has failed.

Terminal window
guv deploy --service web --env production [--wait]

API:

  • guv deploy calls Deploy (POST /v1/projects/{project}/environments/{environment}/services/{service}/deployments). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

One screen for the whole project: health, recent deploys, spend this month and the Safety Centre grade.

Terminal window
guv status

API:

Searches and tails logs. -f follows live output; --since and --grep narrow it down.

Terminal window
guv logs -f --service api --since 10m [--grep "error"]

API:

Runs a local command with the environment’s variables injected, so you never need a .env file. Uses non-production variables unless you say otherwise.

Terminal window
guv run -- <cmd>

Opens a short-lived debug machine with the same environment as the service. Every session is audited. It is off for special-category production projects unless approved.

Terminal window
guv shell --service api

Opens psql to a database through a short-lived, audited tunnel. Production needs approval.

Terminal window
guv db connect main

API:

  • guv db connect calls Connection credentials (gated, audited) (GET /v1/projects/{project}/environments/{environment}/databases/{database}/connection). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Makes a copy-on-write branch of a database in seconds, with masking rules applied for personal data.

Terminal window
guv db branch main --name feature-x

API:

Sets a secret. The CLI prompts for the value, so it never lands in your shell history. Secrets are write-only: nobody can read them back, including you.

Terminal window
guv secrets set

API:

  • guv secrets set calls Set a secret (write-only) (POST /v1/projects/{project}/environments/{environment}/secrets). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Lists secret names and metadata. Values are never shown.

Terminal window
guv secrets list

API:

Removes a secret from an environment.

Terminal window
guv secrets unset

API:

  • guv secrets unset calls Unset a secret (DELETE /v1/projects/{project}/environments/{environment}/secrets/{secret}). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Rotates a secret that Guv manages, such as a database password, and redeploys the services that use it.

Terminal window
guv secrets rotate

API:

  • guv secrets rotate calls Rotate a secret to a new value (POST /v1/projects/{project}/environments/{environment}/secrets/{secret}/rotate). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Adds a custom domain and prints the DNS records to create, with instructions for your registrar.

Terminal window
guv domains add

API:

  • guv domains add calls Add a custom domain (POST /v1/projects/{project}/environments/{environment}/domains). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Checks DNS and ownership, then issues the certificate.

Terminal window
guv domains verify

API:

  • guv domains verify calls Check DNS now (POST /v1/projects/{project}/environments/{environment}/domains/{domain}/verify)

Lists domains and their certificate status.

Terminal window
guv domains list

API:

  • guv domains list calls List domains (GET /v1/projects/{project}/environments/{environment}/domains)

Compares guv.yaml with what is running and prints the changes in plain English, with the monthly cost difference.

Terminal window
guv plan

API:

Applies a plan. Nothing is ever deleted because it disappeared from the file: removed databases and volumes are kept and shown as orphaned.

Terminal window
guv apply

API:

  • guv apply calls Apply a plan (POST /v1/projects/{project}/manifest/apply). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Checks guv.yaml against the schema and prints every problem with its line number.

Terminal window
guv validate

API:

Writes the live configuration of a project out as guv.yaml.

Terminal window
guv pull

API:

Converts railway.json, render.yaml, fly.toml, a Heroku Procfile or app.json, or a Compose file into guv.yaml.

Terminal window
guv import

Puts an earlier deployment back live, as a new deployment, so history is never rewritten.

Terminal window
guv rollback --service web [--to d-123]

API:

  • guv rollback calls Roll back to this deployment (POST /v1/deployments/{deployment_id}/rollback). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Shows spend this month against your cap. --forecast projects the month end.

Terminal window
guv spend [--forecast]

API:

Diagnoses common failures and explains them in plain English, with the command that fixes each one.

Terminal window
guv doctor

API:

Installs the Guv skill and rules into Claude Code, Cursor, Codex and other coding agents, so they know how to deploy, read logs, set secrets without echoing them, and handle approval requests.

Terminal window
guv setup agent

Approves an action an agent asked for. You confirm with your passkey; the agent never sees a credential.

Terminal window
guv approve <id>

API:

Creates an agent token with scopes, environments, a daily spend budget and an expiry. The token is shown once.

Terminal window
guv tokens create-agent

API:

Waits for a pending approval and exits with its outcome. Useful in scripts and for agents.

Terminal window
guv approvals wait

API:

Lists the projects in your workspace.

Terminal window
guv projects list

API:

  • guv projects list calls List projects (GET /v1/workspaces/{workspace}/projects)

Creates an environment, such as staging.

Terminal window
guv env create

API:

Changes a service’s settings.

Terminal window
guv services update

API:

  • guv services update calls Update a service’s base settings (PATCH /v1/projects/{project}/services/{service}). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Restarts a service without a new build.

Terminal window
guv restart

API:

  • guv restart calls Restart the running deployment (POST /v1/projects/{project}/environments/{environment}/services/{service}/restart). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Sets a plain variable. Values are visible to project members, so use guv secrets set for anything sensitive.

Terminal window
guv variables set

API:

  • guv variables set calls Set plain variables (create or replace) (POST /v1/projects/{project}/environments/{environment}/variables). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Creates a managed database in an environment.

Terminal window
guv db create

API:

  • guv db create calls Create a database (POST /v1/projects/{project}/environments/{environment}/databases). In environments with protection turned on (usually production), changes by agents and by roles outside approver_roles return approval_required.

Runs the Guv MCP server over stdio, using your CLI sign-in. Point your AI client at guv mcp.

Terminal window
guv mcp