Quickstart
This walks you through getting OMA running — choose the path that fits your environment.
Pick Your Path
Section titled “Pick Your Path”Fastest way from zero to a running agent. Requires only Docker.
Prerequisites
Section titled “Prerequisites”| Tool | Version | Why |
|---|---|---|
| Docker | Latest | Runs the sandbox, database, and vault sidecar |
| curl | Any | Test the API from the terminal |
| jq | Any | Parse JSON responses in the terminal |
-
Clone the repository.
Terminal window git clone https://github.com/duyet/oma.gitcd oma -
Configure environment variables.
Terminal window cp .env.example .envGenerate two required secrets and append them to
.env:Terminal window echo "BETTER_AUTH_SECRET=$(openssl rand -hex 32)" >> .envecho "PLATFORM_ROOT_SECRET=$(openssl rand -base64 32)" >> .env.env.examplealready setsAPI_KEY=dev-test-key-change-me(same as.dev.vars.example). A provider key is required for a successful turn — setANTHROPIC_API_KEYin.envor add a Model Card after you open the Console. -
Launch with Docker Compose.
Terminal window docker compose up -dThis starts the API, Console UI, and database. Wait a few seconds for migrations, then verify:
Terminal window curl localhost:8787/healthExpected (pid, uptime, and backend paths vary):
{"status": "ok","runtime": "node","pid": 1,"uptime_s": 12,"auth": "better-auth-sqlite","backends": {"agents": "sqlite","events": "sqlite","hub": "in-process","memory_blobs": "localfs /app/data/memory-blobs","db": "sqlite /app/data/oma.db"}} -
Create your first agent.
Terminal window export OMA_BASE="http://localhost:8787"export OMA_KEY="$(grep '^API_KEY=' .env | cut -d= -f2-)"# .env.example / .dev.vars.example ship API_KEY=dev-test-key-change-meAGENT_ID=$(curl -s -X POST "$OMA_BASE/v1/agents" \-H "x-api-key: $OMA_KEY" \-H "content-type: application/json" \-d '{"name": "hello-agent","model": "claude-sonnet-4-6","system": "You are a helpful assistant. Keep replies short.","tools": [{"type": "agent_toolset_20260401", "default_config": {"enabled": true}}]}' | jq -r .id)ENV_ID=$(curl -s -X POST "$OMA_BASE/v1/environments" \-H "x-api-key: $OMA_KEY" \-H "content-type: application/json" \-d '{"name":"local","config":{"type":"cloud"}}' | jq -r .id)echo "Agent: $AGENT_ID"echo "Environment: $ENV_ID" -
Send a message.
Terminal window SESSION_ID=$(curl -s -X POST "$OMA_BASE/v1/sessions" \-H "x-api-key: $OMA_KEY" \-H "content-type: application/json" \-d "{\"agent\": \"$AGENT_ID\", \"environment_id\": \"$ENV_ID\"}" | jq -r .id)curl -N -X POST "$OMA_BASE/v1/sessions/$SESSION_ID/messages" \-H "x-api-key: $OMA_KEY" \-H "content-type: application/json" \-d '{"content": "Say hello and tell me what tools you have available."}'You’ll see the model’s reply stream token-by-token. A real model key is required for a successful turn — set
ANTHROPIC_API_KEYin.env(or add a Model Card in the Console) and restart if the session stays silent. -
Open the Console.
Open localhost:8787 in your browser. Sign up, or for a single-user local trial set
AUTH_DISABLED=1in.env, recreate the container, and the Console skips login (default tenant). Do not use that flag in production. From here you can:- Add a Model Card — go to Model Cards → Add and enter your API key
- Create an agent — Agents → + New agent with the visual builder
- View sessions — Sessions to see all runs and monitor activity
Next Steps
Section titled “Next Steps”- Docker deploy guide — Postgres, production tuning
- Self-host overview
Cloudflare Workers + Durable Object simulators. No Docker and no Cloudflare account. Container sandboxes and Workers AI are off in this path.
-
Clone, install, and copy secrets.
Terminal window git clone https://github.com/duyet/oma.git && cd omapnpm installcp .dev.vars.example .dev.varsSet
PLATFORM_ROOT_SECRET=$(openssl rand -base64 32)andBETTER_AUTH_SECRET=$(openssl rand -hex 32)in.dev.vars. Do not reuse a value from this public repo. -
Start.
Terminal window pnpm dev# API + Console → http://localhost:8787curl localhost:8787/healthpredevbuildsapps/console/distif needed and copies.dev.varsnext to the worker configs (wrangler does not read the repo-root file). Optional HMR:pnpm dev:console→ http://localhost:5173.
Next Steps
Section titled “Next Steps”Deploy to Cloudflare Workers for a production setup.
Prerequisites
Section titled “Prerequisites”| Tool | Version | Why |
|---|---|---|
| Node.js | 22+ | CLI and dev tooling |
| pnpm | 10+ | Package manager (npm i -g pnpm) |
| Cloudflare account | Workers Paid ($5/mo) | Durable Objects + R2 required |
| wrangler CLI | Latest | npx wrangler login |
| Anthropic API key | Any | Or OpenAI compatible provider |
-
Clone, install, and login.
Terminal window git clone https://github.com/duyet/oma.gitcd omapnpm installnpx wrangler login -
Run the setup wizard.
Terminal window ./scripts/setup-cf.shThe wizard is fully interactive and idempotent:
- Creates D1 databases, KV namespace, R2 buckets
- Sets secrets (auto-generates auth secrets, prompts for
ANTHROPIC_API_KEY) - Applies migrations
- Deploys main + agent + integrations workers
- Prints your Console URL
-
Open the Console.
Visit the URL printed by the wizard (e.g.
https://oma-main.xxx.workers.dev). Sign up — your first user becomes the tenant owner.
Next Steps
Section titled “Next Steps”- Cloudflare deploy guide — custom domains, OAuth apps
- Architecture overview
Run sandbox pods on your Kubernetes cluster.
Prerequisites
Section titled “Prerequisites”- Kubernetes v1.25+ with Helm 3
- cert-manager installed
- OMA already deployed (Cloudflare or Docker)
Install k8s-bridge
Section titled “Install k8s-bridge”helm repo add oma https://charts.oma.duyet.nethelm repo update
export K8S_BRIDGE_TOKEN=$(openssl rand -base64 32)
helm install oma-k8s-bridge oma/oma-k8s-bridge \ --namespace oma-sandbox \ --create-namespace \ --set secret.token=$K8S_BRIDGE_TOKEN \ --set ingress.enabled=true \ --set ingress.host=k8s-bridge.example.comVerify
Section titled “Verify”kubectl -n oma-sandbox rollout status deployment/oma-k8s-bridgecurl -H "Authorization: Bearer $K8S_BRIDGE_TOKEN" \ https://k8s-bridge.example.com/api/v1/healthNext Steps
Section titled “Next Steps”Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause | Fix |
|---|---|---|
docker compose up fails | Port 8787 in use | Stop the conflicting process or change the port in docker-compose.yml |
health returns 503 | Migrations not finished, or missing BETTER_AUTH_SECRET / PLATFORM_ROOT_SECRET | Wait 10s and retry; for pnpm dev, set both secrets in repo-root .dev.vars |
pnpm dev asks for a Cloudflare account | Always-remote Workers AI binding | Use current pnpm dev (--local + wrangler.dev.jsonc; AI omitted) |
| Agent creation fails with 401 | Wrong API key | OMA_KEY must match API_KEY in .env (dev-test-key-change-me from .env.example) |
Session create returns 400 environment_id is required | No environment on the request | Create one with POST /v1/environments and pass environment_id (CLI: --env) |
| Session message returns no reply | No model card or ANTHROPIC_API_KEY | Add a Model Card in the Console, or set ANTHROPIC_API_KEY in .env and restart |
setup-cf.sh fails | Wrangler not logged in | Run npx wrangler login first |