This guide covers running Duet by building and running the Go server directly.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jaypopat/cf_ai_duet/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Go 1.25.4 or later
- SSH key pair for host authentication
- Access to a Cloudflare Worker (see Cloudflare Worker setup)
Build from Source
Build the binary
Use the Makefile to build the Go binary:This creates the
duet binary in the bin/ directory.Configuration
The Duet server accepts the following command-line flags:| Flag | Default | Description |
|---|---|---|
-addr | :2222 | SSH server address and port |
-hostkey | .ssh/id_ed25519 | Path to SSH host key |
-worker | "" | Duet CF Worker base URL (e.g. https://duet-cf-worker.<subdomain>.workers.dev) |
The
-worker flag is required for AI agent and sandbox features. Without it, only basic SSH pair programming will be available.Development Mode
For local development with a local Cloudflare Worker:Start both services
Run the development command to start both the Worker and Go server:This runs:
- Cloudflare Worker on
http://localhost:8788 - Duet Go server on port
2222
Development mode starts the Worker locally but AI inference still happens on Cloudflare’s edge. Sandbox features require a paid Cloudflare plan.
Alternative: Use Remote Worker
To run the Go server locally while using a deployed Worker:Install Globally
To install Duet globally on your system:go install, making it available in your $GOPATH/bin.
Production Considerations
Connecting to Your Server
Once running, users can connect via:your-server.com with your actual domain or IP address, and 2222 with your configured port.