OpenWorkers CLI
Command-line interface for managing OpenWorkers deployments.
Installation
Prebuilt binaries (recommended):
# Using cargo-binstall (auto-detects prebuilt binaries)
# Or download manually from GitHub Releases
|
# macOS (Intel)
|
# macOS (Apple Silicon)
|
Docker:
Build from source:
Quick Start
# Configure your API backend
# Login (prompts for API token)
# Create and deploy a worker
# Your worker is live at https://my-api.workers.rocks
Commands
| Command | Short | Description |
|---|---|---|
workers |
w |
Create, deploy, manage workers |
env |
e |
Environment variables/secrets |
storage |
s |
S3/R2 storage configurations |
kv |
k |
Key-value namespaces |
databases |
d |
SQL database bindings |
users |
u |
User management (DB only) |
alias |
Backend connection aliases | |
login |
Authenticate with API | |
migrate |
Database schema migrations |
Common operations: list (ls), get, create, delete (rm)
Workers
Workers are serverless functions deployed to the edge.
# Deploy a single file
# Deploy a folder with worker.js + static assets (SvelteKit, etc.)
Supported file types: .js, .ts, .wasm
Environments
Environments group configuration for your workers: variables, secrets, and bindings to resources.
# Variables (plain text, visible in logs)
# Secrets (encrypted, masked in output)
# Bindings connect resources to your worker code (accessible via env.CACHE, env.DB, etc.)
# Link environment to a worker
Storage
S3-compatible object storage for files, images, and static assets.
# Platform-managed storage
# Bring your own S3/R2 bucket
KV
Fast key-value store for caching, sessions, and feature flags.
Databases
SQL databases for persistent data. Query with env.DB.execute() in your worker.
# Platform-managed database
# Bring your own Postgres
Aliases
Aliases let you manage multiple backends (production, staging, local) from the same CLI.
# API backend (hosted platform)
# API backend (self-hosted, skip TLS verification)
# DB backend (direct PostgreSQL access for migrations)
Prefix any command with an alias name:
Config stored in ~/.openworkers/config.json.
Model Context Protocol (MCP)
OpenWorkers CLI includes an MCP server that exposes CLI commands as tools for AI assistants like Claude.
Available tools:
- Workers: list, get, create, deploy, delete, link
- Environments: list, set variables/secrets, bind resources
- KV: list, create, delete
- Storage: list, create, delete
- Databases: list, create, delete
Setup for Claude CLI
Create .mcp.json in your project:
Or with a specific alias:
Run claude in your project directory and enable the OpenWorkers server when prompted.
Setup for Claude Desktop
Edit Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Add:
Restart Claude Desktop. The 🔨 icon indicates MCP tools are available.
Usage
Once configured, you can use natural language:
"List my OpenWorkers workers"
"Create a new worker called my-api"
"Deploy worker.ts to my-api"
Claude will automatically use the appropriate MCP tools.
Note: The MCP server uses your configured alias for authentication. Ensure you have set up an alias and logged in before using MCP tools.
Migrations
Database schema migrations for self-hosted deployments. Requires a DB alias.
Config File
Development