How to Deploy GSV
This guide walks you through deploying GSV to Cloudflare, updating an existing deployment, and tearing it down.
Prerequisites
- A Cloudflare account (free tier works)
- A Cloudflare API token with the "Edit Cloudflare Workers" template
- An API key for your LLM provider (Anthropic, OpenAI, Google, or OpenRouter)
- The
gsvCLI installed:
curl -sSL https://install.gsv.space | bashFirst-time deploy with the wizard
The wizard walks you through account selection, component selection, LLM provider setup, and optional channel configuration:
gsv deploy up --wizardThe wizard prompts for:
- Cloudflare API token (if not already configured)
- Cloudflare account (auto-selected if you only have one)
- Components to deploy (gateway, channel-whatsapp, channel-discord)
- LLM provider and model (defaults to Anthropic / Claude Sonnet)
- LLM API key
- Discord bot token (if deploying the Discord channel)
On completion, the wizard saves the gateway URL and auth token to your local config so gsv client and gsv node work immediately.
Deploy all components non-interactively
If you already have credentials configured, skip the wizard:
gsv deploy up --all \
--api-token "$CF_API_TOKEN" \
--account-id "$CF_ACCOUNT_ID" \
--llm-provider anthropic \
--llm-model claude-sonnet-4-20250514 \
--llm-api-key "$ANTHROPIC_API_KEY"Deploy specific components
Deploy only the gateway:
gsv deploy up -c gatewayDeploy the gateway and WhatsApp channel:
gsv deploy up -c gateway -c channel-whatsappAvailable components: gateway, channel-whatsapp, channel-discord.
Deploy from local bundles
If you're building from source or testing local changes:
./scripts/build-cloudflare-bundles.sh
gsv deploy up --bundle-dir ./release/local --version local-dev --all --force-fetchSet secrets and API keys after deploy
Use gsv config set to update gateway configuration remotely:
# Change the LLM provider and model
gsv config set model.provider anthropic
gsv config set model.id claude-sonnet-4-20250514
# Set or rotate an API key
gsv config set apiKeys.anthropic sk-ant-...
# Set the auth token
gsv config set auth.token your-secret-tokenFor channel worker secrets (like Discord bot tokens), pass them during deploy:
gsv deploy up -c channel-discord --discord-bot-token "$DISCORD_BOT_TOKEN"Check deployment status
gsv deploy status --allOr for a specific component:
gsv deploy status -c gatewayUpdate an existing deployment
Re-run gsv deploy up with the same components. It fetches the latest release bundles and applies them:
gsv deploy up --allTo force re-download of bundles (e.g., if a release was re-published):
gsv deploy up --all --force-fetchTo deploy a specific version:
gsv deploy up --all --version v0.3.0Tear down
Remove all deployed workers:
gsv deploy down --allRemove specific components:
gsv deploy down -c channel-whatsappTo also delete the R2 storage bucket (this destroys all agent data, workspace files, and session archives):
gsv deploy down --all --delete-bucket --purge-bucketUse --wizard for an interactive teardown flow:
gsv deploy down --wizardSave Cloudflare credentials locally
To avoid passing --api-token and --account-id every time:
gsv local-config set cloudflare.api_token "$CF_API_TOKEN"
gsv local-config set cloudflare.account_id "$CF_ACCOUNT_ID"Configure a second machine
After deploying from one machine, set up the CLI on another:
curl -sSL https://install.gsv.space | bash
gsv local-config set gateway.url wss://gsv.your-subdomain.workers.dev/ws
gsv local-config set gateway.token your-auth-tokenYou can retrieve the auth token from the deploying machine with:
gsv config get auth.token