CLI reference
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.
Install
Section titled “Install”# macOS and Linuxbrew install guv
# Windowsscoop install guv
# Anywhere with Node.jsnpx guv
# Script (checksums are signed)curl -fsSL https://guv.dev/install.sh | shThen sign in. The CLI opens your browser and you confirm with your passkey:
guv loginFlags every command accepts
Section titled “Flags every command accepts”| 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
Section titled “Exit codes”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.
guv login
Section titled “guv login”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.
guv loginAPI:
guv login --devcalls Sign in without a passkey (development only) (POST /v1/auth/dev-login)guv logincalls Start the CLI device flow (RFC 8628) (POST /v1/auth/device/code)
guv logout
Section titled “guv logout”Signs out and removes the stored tokens from your keychain.
guv logoutAPI:
guv logoutcalls Sign out the current session (POST /v1/auth/logout)
guv whoami
Section titled “guv whoami”Shows who you are signed in as, your workspace and your role.
guv whoamiAPI:
guv whoamicalls Who am I (GET /v1/me)
guv init
Section titled “guv init”Looks at the current repository, detects the stack and writes a starter guv.yaml. It then links the directory to a Guv project.
guv initAPI:
guv initcalls Detect the stack of a repository and suggest a guv.yaml (POST /v1/workspaces/{workspace}/github/detect)
guv up
Section titled “guv up”Deploys the current directory without needing git. The CLI uploads a source tarball and streams a friendly build log.
guv upguv deploy
Section titled “guv deploy”Deploys a service to an environment from its linked repository. Use --wait to block until the deployment is live or has failed.
guv deploy --service web --env production [--wait]API:
guv deploycalls Deploy (POST /v1/projects/{project}/environments/{environment}/services/{service}/deployments). In environments with protection turned on (usually production), changes by agents and by roles outsideapprover_rolesreturnapproval_required.
guv status
Section titled “guv status”One screen for the whole project: health, recent deploys, spend this month and the Safety Centre grade.
guv statusAPI:
guv status --apicalls Check API health (GET /v1/health)guv statuscalls Everything about a project in one call (GET /v1/projects/{project}/status)
guv logs
Section titled “guv logs”Searches and tails logs. -f follows live output; --since and --grep narrow it down.
guv logs -f --service api --since 10m [--grep "error"]API:
guv logscalls Search logs (GET /v1/projects/{project}/logs)guv logs -fcalls Live tail (Server-Sent Events) (GET /v1/projects/{project}/logs/tail)
guv run
Section titled “guv run”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.
guv run -- <cmd>guv shell
Section titled “guv shell”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.
guv shell --service apiguv db connect
Section titled “guv db connect”Opens psql to a database through a short-lived, audited tunnel. Production needs approval.
guv db connect mainAPI:
guv db connectcalls 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 outsideapprover_rolesreturnapproval_required.
guv db branch
Section titled “guv db branch”Makes a copy-on-write branch of a database in seconds, with masking rules applied for personal data.
guv db branch main --name feature-xAPI:
guv db branchcalls Branch a database (copy-on-write clone, masked) (POST /v1/projects/{project}/environments/{environment}/databases/{database}/branches)
guv secrets set
Section titled “guv secrets set”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.
guv secrets setAPI:
guv secrets setcalls 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 outsideapprover_rolesreturnapproval_required.
guv secrets list
Section titled “guv secrets list”Lists secret names and metadata. Values are never shown.
guv secrets listAPI:
guv secrets listcalls List secrets (names and metadata only) (GET /v1/projects/{project}/environments/{environment}/secrets)
guv secrets unset
Section titled “guv secrets unset”Removes a secret from an environment.
guv secrets unsetAPI:
guv secrets unsetcalls 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 outsideapprover_rolesreturnapproval_required.
guv secrets rotate
Section titled “guv secrets rotate”Rotates a secret that Guv manages, such as a database password, and redeploys the services that use it.
guv secrets rotateAPI:
guv secrets rotatecalls 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 outsideapprover_rolesreturnapproval_required.
guv domains add
Section titled “guv domains add”Adds a custom domain and prints the DNS records to create, with instructions for your registrar.
guv domains addAPI:
guv domains addcalls 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 outsideapprover_rolesreturnapproval_required.
guv domains verify
Section titled “guv domains verify”Checks DNS and ownership, then issues the certificate.
guv domains verifyAPI:
guv domains verifycalls Check DNS now (POST /v1/projects/{project}/environments/{environment}/domains/{domain}/verify)
guv domains list
Section titled “guv domains list”Lists domains and their certificate status.
guv domains listAPI:
guv domains listcalls List domains (GET /v1/projects/{project}/environments/{environment}/domains)
guv plan
Section titled “guv plan”Compares guv.yaml with what is running and prints the changes in plain English, with the monthly cost difference.
guv planAPI:
guv plancalls Plan guv.yaml against live state (POST /v1/projects/{project}/manifest/plan)
guv apply
Section titled “guv apply”Applies a plan. Nothing is ever deleted because it disappeared from the file: removed databases and volumes are kept and shown as orphaned.
guv applyAPI:
guv applycalls Apply a plan (POST /v1/projects/{project}/manifest/apply). In environments with protection turned on (usually production), changes by agents and by roles outsideapprover_rolesreturnapproval_required.
guv validate
Section titled “guv validate”Checks guv.yaml against the schema and prints every problem with its line number.
guv validateAPI:
guv validatecalls Validate guv.yaml (schema, references, policy) (POST /v1/projects/{project}/manifest/validate)
guv pull
Section titled “guv pull”Writes the live configuration of a project out as guv.yaml.
guv pullAPI:
guv pullcalls Export live state as guv.yaml (pull / eject) (GET /v1/projects/{project}/manifest)
guv import
Section titled “guv import”Converts railway.json, render.yaml, fly.toml, a Heroku Procfile or app.json, or a Compose file into guv.yaml.
guv importguv rollback
Section titled “guv rollback”Puts an earlier deployment back live, as a new deployment, so history is never rewritten.
guv rollback --service web [--to d-123]API:
guv rollbackcalls 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 outsideapprover_rolesreturnapproval_required.
guv spend
Section titled “guv spend”Shows spend this month against your cap. --forecast projects the month end.
guv spend [--forecast]API:
guv spendcalls Workspace spend this month, forecast and per-project breakdown (GET /v1/workspaces/{workspace}/spend)
guv doctor
Section titled “guv doctor”Diagnoses common failures and explains them in plain English, with the command that fixes each one.
guv doctorAPI:
guv doctorcalls Why a deployment failed and how to fix it (GET /v1/deployments/{deployment_id}/explanation)
guv setup agent
Section titled “guv setup agent”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.
guv setup agentguv approve
Section titled “guv approve”Approves an action an agent asked for. You confirm with your passkey; the agent never sees a credential.
guv approve <id>API:
guv approvecalls Approve a request (passkey required) (POST /v1/approvals/{approval_id}/approve)
guv tokens create-agent
Section titled “guv tokens create-agent”Creates an agent token with scopes, environments, a daily spend budget and an expiry. The token is shown once.
guv tokens create-agentAPI:
guv tokens create-agentcalls Create an agent token (POST /v1/workspaces/{workspace}/agent-tokens)
guv approvals wait
Section titled “guv approvals wait”Waits for a pending approval and exits with its outcome. Useful in scripts and for agents.
guv approvals waitAPI:
guv approvals waitcalls Get an approval request (GET /v1/approvals/{approval_id})
guv projects list
Section titled “guv projects list”Lists the projects in your workspace.
guv projects listAPI:
guv projects listcalls List projects (GET /v1/workspaces/{workspace}/projects)
guv env create
Section titled “guv env create”Creates an environment, such as staging.
guv env createAPI:
guv env createcalls Create an environment (POST /v1/projects/{project}/environments)
guv services update
Section titled “guv services update”Changes a service’s settings.
guv services updateAPI:
guv services updatecalls 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 outsideapprover_rolesreturnapproval_required.
guv restart
Section titled “guv restart”Restarts a service without a new build.
guv restartAPI:
guv restartcalls 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 outsideapprover_rolesreturnapproval_required.
guv variables set
Section titled “guv variables set”Sets a plain variable. Values are visible to project members, so use guv secrets set for anything sensitive.
guv variables setAPI:
guv variables setcalls 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 outsideapprover_rolesreturnapproval_required.
guv db create
Section titled “guv db create”Creates a managed database in an environment.
guv db createAPI:
guv db createcalls Create a database (POST /v1/projects/{project}/environments/{environment}/databases). In environments with protection turned on (usually production), changes by agents and by roles outsideapprover_rolesreturnapproval_required.
guv mcp
Section titled “guv mcp”Runs the Guv MCP server over stdio, using your CLI sign-in. Point your AI client at guv mcp.
guv mcp