OpenClaw Mini is a lightweight OpenClaw-inspired agent runtime built with Next.js, Bun, Prisma, and local markdown-backed context files.
- Install dependencies:
bun install
- Initialize the database:
bun run db:push
- Run the interactive setup wizard:
This guides you through provider keys, auth, workspace bootstrap, and optional channel integrations. Run
bun run setup
bun run setup --doctorat any time to check install health. - Start the app:
bun run dev
Manual setup: If you prefer to configure by hand, copy
examples/openclaw.jsonto~/.openclaw/openclaw.json, setOPENCLAW_CONFIG_PATHto override the path, and seeSETUP.mdfor the full reference.
OpenClaw Mini now protects admin APIs and trusted service boundaries with Authorization: Bearer <token>.
- Set
OPENCLAW_API_KEYfor the Next.js admin APIs, scheduler, and WebSocket/broadcastingress. - The scheduler and internal WS client automatically send this bearer token once it is configured.
- Startup fails fast if
OPENCLAW_API_KEYis missing. - For local-only testing, you can temporarily set
OPENCLAW_ALLOW_INSECURE_LOCAL=trueto bypass internal auth with a warning. - Browser clients (
/chatand dashboard send-message actions) do not embed bearer tokens; they only work in local insecure mode or behind an authenticating reverse proxy. - Webhook signature verification remains separate; webhook secrets still use their own signature headers.
TELEGRAM_TRANSPORTcontrols inbound Telegram delivery.- The default is
webhook; set it topollingfor local or single-instance long polling. - Polling mode is single-consumer only, so run one scheduler instance per bot token.
- Keep
TELEGRAM_WEBHOOK_SECRETconfigured when using webhook mode.
OpenClaw Mini now uses the existing WebSocket service as an internal event backplane, so hooks and other listeners keep working across the Next.js app, scheduler, and browser clients.
Scheduler / Next.js service
|
| eventBus.emit() -> POST /broadcast
v
openclaw-ws service
| | \
| | \
| | -> browser dashboard clients (`admin` / agent rooms)
| -> Next.js backplane client (`internal` room)
|
-> agent-specific rooms
Next.js backplane client
|
-> eventBus.dispatchLocal() -> in-process listeners (hooks, subscriptions)
eventBus.emit()is now async and returnsPromise<void>because delivery goes through the WebSocket service.- Await
eventBus.emit()when you need delivery confirmation; usevoid eventBus.emit(...)for fire-and-forget paths. - The backplane client tags each emitted event with a process-unique
sourcevalue so self-originated events are not delivered twice.
Provider and model configuration now lives in openclaw.json.
- Default path:
~/.openclaw/openclaw.json - Override path:
OPENCLAW_CONFIG_PATH=/absolute/path/to/openclaw.json - Format: JSON5-compatible
openclaw.jsonwithprovidersandagentsections - Secrets: use
${ENV_VAR}in providerapiKeyfields instead of hardcoding keys - Reloads: config changes are watched and the provider registry reloads without restarting the app
- Required: the runtime fails fast with a helpful example if
openclaw.jsondoes not exist
A complete example is available at examples/openclaw.json:
{
"providers": {
"openai": {
"apiType": "openai-chat",
"apiKey": "${OPENAI_API_KEY}"
}
},
"agent": {
"provider": "openai",
"model": "gpt-4.1-mini"
}
}See SETUP.md for the full setup guide, sub-agent override behavior, troubleshooting, and background service instructions.