deploy
Scaffold a new instance with interactive setup, or upgrade an existing one. Handles preset selection, agent configuration, channel wiring, network policy, and Vercel deployment.
Usage
clawrun deploy [preset] [--name <name>] [--yes]Create or upgrade and deploy an instance.
Arguments
| Argument | Required | Description |
|---|---|---|
preset | No | Preset name or folder path containing a preset.json |
Options
| Option | Short | Description |
|---|---|---|
--name | -n | Instance name. If omitted, a random name is generated (e.g., clawrun-pink-hoops-serve) |
--yes | -y | Skip confirmation prompts. Automatically selects all available tools |
New instance
When no existing instance matches the given name, deploy runs the full setup flow.
Platform prerequisites
Before deploying, the CLI verifies:
- Node.js version must be 20 or later
- Vercel CLI is installed. If not found, attempts
npm install -g vercelautomatically - Vercel authentication via
vercel whoami. If not authenticated, starts thevercel loginflow
The CLI also detects your Vercel account tier (hobby or paid) to set appropriate defaults for heartbeat frequency, concurrent sandbox limits, and snapshot expiration.
Setup flow
- Preset selection picks the preset from the argument, or auto-selects if only one preset exists
- Instance naming uses
--nameor generates a random name - Agent configuration prompts for LLM provider, messaging channels, and tools (see below)
- Network policy prompts for
allow-allorrestricted(see below) - Deployment scaffolds the app, deploys to Vercel, and starts the sandbox
- First message opens an interactive chat session with the agent
LLM providers
The deploy prompt offers:
openai, openrouter, anthropic, google, groq, mistral, deepseek
Channels
The deploy prompt offers:
telegram, discord, slack, matrix, whatsapp, linq, nextcloud_talk, dingtalk, qq, lark, nostr
Tools
The CLI fetches the list of available tools from the agent and presents a multi-select checklist. With --yes, all tools are selected by default.
Network policy
Two modes are available:
- allow-all: no restrictions (default)
- restricted: only allow traffic to specific domains
In restricted mode, the CLI automatically derives required domains based on your selections:
- Provider domains such as
api.openai.comfor OpenAI,api.anthropic.comfor Anthropic - Channel domains such as
api.telegram.orgfor Telegram,discord.comfor Discord - Platform infrastructure domains required by your sandbox provider
You can then add extra domains (comma-separated) and optionally specify blocked CIDRs. The CLI validates that each tool's install domains are covered by the allow-list and warns if any are missing.
What gets created
The deploy command creates the following on disk:
~/.clawrun/<instance-name>/
├── clawrun.json # Instance configuration
├── agent/
│ ├── config.toml # Agent config (provider, model, etc.)
│ ├── .secret_key # Agent identity key
│ └── [workspace files] # Seeded .md templates (SOUL.md, AGENTS.md, TOOLS.md)
└── .deploy/
├── package.json # Next.js app dependencies
├── .env # Environment variables
├── clawrun.json # Sanitized config (no secrets)
├── vercel.json # Vercel deployment config
└── [server app] # Scaffolded from @clawrun/serverCustom preset path
You can pass a directory path as the preset argument. The directory must contain a preset.json file:
clawrun deploy ./my-presetUpgrade existing instance
When --name matches an existing instance, deploy runs the upgrade flow:
- Offers to reconfigure the LLM provider and model
- Offers to reconfigure messaging channels
- Offers to reconfigure tools
- Offers to reconfigure network policy (keep current, change to restricted, or change to allow-all)
- Automatically adds newly required domains to the allow-list
- Re-seeds any missing workspace template files (does not overwrite existing ones)
- Redeploys and restarts the sandbox
Examples
# Interactive deploy with prompts
clawrun deploy
# Deploy with the starter preset
clawrun deploy starter
# Non-interactive deploy
clawrun deploy starter --name my-agent --yes
# Upgrade an existing instance
clawrun deploy --name my-agent
# Deploy from a custom preset directory
clawrun deploy ./presets/custom