Install and use the AgentEnv CLI (agv) to manage sandboxes, snapshots, browser sessions, clusters, and more from your terminal.

Installation

pip install agv
Two entrypoints are provided — agv (short) and agentenv (explicit). They are equivalent:
agv version
agentenv version

Authentication

# Browser-based login
agv login

# API key login
agv login --api-key sk_live_xxxxx

# Local dev login
agv login --username <user> --password <pass>

# Check status / manage keys
agv auth status
agv auth create-key "My CLI Key"
agv auth list-keys
agv logout

Sandboxes

# Create and run
agv run -- python3 -m http.server
agv run --type xl --expose 8080:http -- node server.js

# List / inspect / logs
agv ls
agv inspect <id>
agv logs -f <id>

# Lifecycle
agv stop <id>
agv start <id>
agv rm <id>

# Expose port / get URL
agv expose <id> 8080
agv url <id> 8080

Preset Types

TypeCPUMemory
micro500m512 MB
small2000m4 GB
medium4000m8 GB
large8000m16 GB
xl16000m32 GB
Set a default type with agv set type xl.

Snapshots

agv snapshot create <sandbox-id> --name "My Environment"
agv snapshot ls
agv snapshot restore <snapshot-id>

Browser Sessions

agv browser create
agv browser create --screen-width 1920 --screen-height 1080 --stealth
agv browser create --profile-mode ephemeral --rrweb
agv browser ls
agv browser inspect <id>

Notebook Sessions

agv notebook session create --workspace <workspace-id>
agv notebook session create --workspace <workspace-id> --type xl
agv notebook session create --workspace <workspace-id> --image docker://quay.io/jupyter/datascience-notebook:notebook-7.5.5
agv notebook session list
agv notebook session get <id>

Apps

agv app create --name web --port 8080 --min 0 --max 3
agv app create --name api --port 8080 --ready http_health --health-path /health
agv app deploy web --snapshot <snapshot-id>
agv app ls
agv app inspect <app-id-or-slug>
agv app logs <app-id-or-slug>
agv app rm <app-id-or-slug>
Ready types: port_accessible, http_health. If you specify http_health without --health-path, the CLI defaults to /health.

Clusters (Ray / Spark)

agv cluster ray 4x2xH100 --workspace <workspace-id>
agv cluster spark 2xH100 --workspace <workspace-id> --wait
agv cluster ls
agv cluster inspect <cluster-id>
agv cluster stop <cluster-id>
Install optional client dependencies for auto-connect:
pip install "agv[ray]"
pip install "agv[spark]"

Managed Agents

agv managed-agent create --name "Research Agent" --workspace <ws-id> --upstream-id <id>
agv managed-agent ls --workspace <ws-id>
agv managed-agent inspect <agent-id>
agv managed-agent messages <agent-id>
agv managed-agent send <agent-id> -- "summarize the repo status"
agv managed-agent wake <agent-id>
agv managed-agent fork <agent-id>
agv managed-agent rm <agent-id> --force

Workflows

agv workflow ls
agv workflow create "Daily Sync" --file workflow.json
agv workflow inspect <workflow-id>
agv workflow deploy <workflow-id>
agv workflow execute <workflow-id> --input '{"customerId":"cus_123"}'
agv workflow executions <workflow-id>
agv workflow metrics <workflow-id>
agv workflow node-definitions
agv workflow plugins

AI Gateway

agv ai chat "Hello!" --model gpt-4
agv ai upstreams list
agv ai pools create --name production

Workspaces

agv workspace create "My Workspace"
agv workspace ls
agv workspace use <workspace-id>
agv workspace secret-set <ws-id> KEY value

Files

agv file upload ./myfile.txt
agv file download /remote.txt ./local.txt
agv file ls

Billing

agv balance
agv billing history

Configuration

The CLI reads configuration from multiple sources (in priority order):
  1. Command-line flags (--api-url, --workspace, etc.)
  2. Environment variables (AGENTENV_API_URL, AGENTENV_API_KEY, etc.)
  3. Config file (~/.agentenv/config.yaml)
  4. Project .env file
  5. Built-in defaults
# ~/.agentenv/config.yaml
api_url: https://api.agentenv.io
workspace: wk_abc123

defaults:
  type: small
  image: docker.io/library/python:3.11-slim
  region: us-east-1
Set defaults from the CLI:
agv set type xl
agv set image python:3.11
agv set workspace <workspace-id>
agv config show

Global Flags

Every command accepts these flags:
FlagDescription
--api-urlAPI server URL
--api-keyAPI key for authentication
--workspace, -wWorkspace ID
--jsonOutput in JSON format
--debugEnable debug output
--config, -cConfig file path