MCPcopy Index your code
hub / github.com/chrysb/alphaclaw

github.com/chrysb/alphaclaw @v0.9.18

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.9.18 ↗ · + Follow
2,407 symbols 6,372 edges 452 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

image

AlphaClaw

The ultimate OpenClaw harness. Deploy in minutes. Stay running for months.

Observability. Reliability. Agent discipline. Zero SSH rescue missions.

CI npm version License: MIT

AlphaClaw wraps OpenClaw with a convenient setup wizard, self-healing watchdog, Git-backed rollback, and full browser-based observability. Ships with anti-drift prompt hardening to keep your agent disciplined, and simplifies integrations (e.g. Google Workspace, Google Pub/Sub, Telegram Topics, Slack, Discord) so you can manage multiple agents from one UI instead of config files.

First deploy to first message in under five minutes.

Deploy on Railway Deploy to Render Download for macOS

Platform: AlphaClaw currently targets Docker/Linux deployments. macOS local development is not yet supported.

Features

  • Setup UI: Password-protected web dashboard for onboarding, configuration, and day-to-day management.
  • Guided Onboarding: Step-by-step setup wizard — model selection, provider credentials, GitHub repo, channel pairing.
  • Multi-Agent Management: Sidebar-driven agent navigation with create, rename, and delete flows. Per-agent overview cards, channel bindings, and URL-driven agent selection.
  • Gateway Manager: Spawns, monitors, restarts, and proxies the OpenClaw gateway as a managed child process.
  • Watchdog: Crash detection, crash-loop recovery, auto-repair (openclaw doctor --fix), Telegram/Discord/Slack notifications, and a live interactive terminal for monitoring gateway output directly from the browser.
  • Channel Orchestration: Telegram, Discord, and Slack bot pairing with per-agent channel bindings, credential sync, and a guided wizard for splitting Telegram into multi-threaded topic groups as your usage grows.
  • Google Workspace: OAuth integration for Gmail, Calendar, Drive, Docs, Sheets, Tasks, Contacts, and Meet, plus guided Gmail watch setup with Google Pub/Sub topic, subscription, and push endpoint handling.
  • Cron Jobs: Dedicated cron tab with job management, an interactive rolling calendar, run-history drilldowns, trend analytics, and per-run usage breakdowns.
  • Nodes: Guided local-node setup for VPS deployments with per-node browser attach checks, reconnect commands, and routing/pairing controls.
  • Webhooks: Named webhook endpoints with per-hook transform modules, request logging, payload inspection, editable delivery destinations, and OAuth callback support for third-party auth flows.
  • File Explorer: Browser-based workspace explorer with file visibility, inline edits, diff view, and Git-aware sync for quick fixes without SSH.
  • Prompt Hardening: Ships anti-drift bootstrap prompts (AGENTS.md, TOOLS.md) injected into your agent's system prompt on every message — enforcing safe practices, commit discipline, and change summaries out of the box.
  • Git Sync: Automatic hourly commits of your OpenClaw workspace to GitHub with configurable cron schedule. Combined with prompt hardening, every agent action is version-controlled and auditable.
  • Version Management: In-place updates for both AlphaClaw and OpenClaw with in-app release notes, changelog review, and one-click apply.
  • Codex OAuth: Built-in PKCE flow for OpenAI Codex CLI model access.

Why AlphaClaw

  • Zero to production in one deploy: Railway/Render templates ship a complete stack — no manual gateway setup.
  • Self-healing: Watchdog detects crashes, enters repair mode, relaunches the gateway, and notifies you.
  • Everything in the browser: No SSH, no config files to hand-edit, no CLI required after first deploy.
  • Stays out of the way: AlphaClaw manages infrastructure; OpenClaw handles the AI.

No Lock-in. Eject Anytime.

AlphaClaw simply wraps OpenClaw, it's not a dependency. Remove AlphaClaw and your agent keeps running. Nothing proprietary, nothing to migrate.

Quick Start

Deploy (recommended)

Deploy on Railway Deploy to Render

Set SETUP_PASSWORD at deploy time and visit your deployment URL. The welcome wizard handles the rest.

Railway users: after deploying, upgrade to the Hobby plan and redeploy to ensure your service has at least 8 GB of RAM. The Trial plan's memory limit can cause out-of-memory crashes during normal operation.

Local / Docker

npm install @chrysb/alphaclaw
npx alphaclaw start

Or with Docker:

FROM node:22-slim
RUN apt-get update && apt-get install -y git curl procps cron tini && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package.json ./
RUN npm install --omit=dev
ENV PATH="/app/node_modules/.bin:$PATH"
ENV ALPHACLAW_ROOT_DIR=/data
EXPOSE 3000
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["alphaclaw", "start"]

Setup UI

Tab What it manages
General Gateway status, channel health, pending pairings, Google Workspace, repo sync schedule, OpenClaw dashboard
Browse File explorer for workspace visibility, inline edits, diff review, and Git-backed sync
Usage Token summaries, per-session and per-agent cost and token breakdown with source/agent dimension comparisons
Cron Cron job management, interactive rolling calendar, run-history drilldowns, trend analytics, and per-run usage breakdowns
Nodes Guided local-node setup for VPS deployments, per-node browser attach, reconnect commands, and routing/pairing controls
Watchdog Health monitoring, crash-loop status, auto-repair toggle, notifications, event log, live log tail, interactive terminal
Providers AI provider credentials (Anthropic, OpenAI, Gemini, Mistral, Voyage, Groq, Deepgram) and model selection
Envars Environment variables — view, edit, add — with gateway restart prompts
Webhooks Webhook endpoints, transform modules, request history, payload inspection, OAuth callbacks, Gmail watch delivery flows

CLI

Command Description
alphaclaw start Start the server (Setup UI + gateway manager)
alphaclaw git-sync -m "message" Commit and push the OpenClaw workspace
alphaclaw telegram topic add --thread <id> --name <text> Register a Telegram topic mapping
alphaclaw version Print version
alphaclaw help Show help

Architecture

graph TD
    subgraph AlphaClaw
        UI["Setup UI

<small>Preact + htm + Wouter</small>"]
        WD["Watchdog

<small>Crash recovery · Notifications</small>"]
        WH["Webhooks

<small>Transforms · Request logging</small>"]
        UI --> API
        WD --> API
        WH --> API
        API["Express Server

<small>JSON APIs · Auth · Proxy</small>"]
    end

    API -- "proxy" --> GW["OpenClaw Gateway

<small>Child process · 127.0.0.1:18789</small>"]
    GW --> DATA["ALPHACLAW_ROOT_DIR

<small>.openclaw/ · .env · logs · SQLite</small>"]

Watchdog

The built-in watchdog monitors gateway health and recovers from failures automatically.

Capability Details
Health checks Periodic openclaw health with configurable interval
Crash detection Listens for gateway exit events
Crash-loop detection Threshold-based (default: 3 crashes in 300s)
Auto-repair Runs openclaw doctor --fix --yes, relaunches gateway
Notifications Telegram, Discord, and Slack alerts for crashes, repairs, and recovery
Event log SQLite-backed incident history with API and UI access

Environment Variables

Variable Required Description
SETUP_PASSWORD Yes Password for the Setup UI
OPENCLAW_GATEWAY_TOKEN Auto Gateway auth token (auto-generated if unset)
GITHUB_TOKEN Yes GitHub PAT for workspace repo
GITHUB_WORKSPACE_REPO Yes GitHub repo for workspace sync (e.g. owner/repo)
TELEGRAM_BOT_TOKEN Optional Telegram bot token
DISCORD_BOT_TOKEN Optional Discord bot token
SLACK_BOT_TOKEN Optional Slack bot token (Socket Mode)
WATCHDOG_AUTO_REPAIR Optional Enable auto-repair on crash (true/false)
WATCHDOG_NOTIFICATIONS_DISABLED Optional Disable watchdog notifications (true/false)
PORT Optional Server port (default 3000)
ALPHACLAW_ROOT_DIR Optional Data directory (default /data)
TRUST_PROXY_HOPS Optional Trust proxy hop count for correct client IP
REMOTE_MCP_URL Optional Upstream remote MCP server URL. When set together with REMOTE_MCP_API_TOKEN, AlphaClaw writes a managed mcp.servers.<name> entry to openclaw.json on every gateway start.
REMOTE_MCP_API_TOKEN Optional Bearer token for the remote MCP server. Persisted in openclaw.json as the ${REMOTE_MCP_API_TOKEN} reference, never as plaintext.
REMOTE_MCP_NAME Optional Key under mcp.servers.<name>. Defaults to remote. Set it to label the entry (e.g. sure, notion).
REMOTE_MCP_PROXY_URL Optional When set, OpenClaw connects here instead of REMOTE_MCP_URL. Intended for a same-host scanning proxy (e.g. pipelock mcp proxy --listen <REMOTE_MCP_PROXY_URL> --upstream <REMOTE_MCP_URL>). Implementation is proxy-agnostic.

OpenAI-compatible /v1 proxy

AlphaClaw can expose an OpenAI-compatible API surface on the same public port as the Setup UI. It is disabled by default. Enable it from the Setup UI under General -> Features -> API; the setting is persisted in alphaclaw.json in the OpenClaw repo so workspace sync can commit the change.

Path Method Notes
/v1/chat/completions POST Streams when stream: true. Use model: "openclaw/default" or openclaw/<agentId>.
/v1/responses POST OpenClaw's /v1/responses surface (enabled together with chat completions).
/v1/embeddings POST Routes to OpenClaw's embeddings endpoint.
/v1/models, /v1/models/<id> GET Lists OpenClaw agent targets.

When enabled, the proxy forwards requests to the loopback OpenClaw gateway. AlphaClaw requires Authorization: Bearer <OPENCLAW_GATEWAY_TOKEN> and rejects requests when the gateway token is missing or does not match before forwarding to OpenClaw. Failed bearer-token attempts are rate-limited before proxying. The setup-UI cookie is stripped be

Core symbols most depended-on inside this repo

showToast
called by 219
lib/public/js/components/toast.js
authFetch
called by 149
lib/public/js/lib/api.js
parseJsonOrThrow
called by 100
lib/public/js/lib/api.js
createAgentsService
called by 58
lib/server/agents/service.js
parsePositiveInt
called by 43
lib/server/utils/number.js
coerceInt
called by 33
lib/server/db/usage/shared.js
formatTokenCount
called by 27
lib/public/js/components/cron-tab/cron-helpers.js
usePolling
called by 27
lib/public/js/hooks/usePolling.js

Shape

Function 2,407

Languages

TypeScript100%

Modules by API surface

lib/public/js/lib/api.js145 symbols
lib/public/js/components/icons.js43 symbols
lib/server/agents/shared.js40 symbols
lib/server/gateway.js39 symbols
lib/public/js/components/file-tree.js39 symbols
lib/server/cron-service.js37 symbols
lib/server/routes/system.js36 symbols
lib/server/watchdog.js34 symbols
lib/server/chat-ws.js33 symbols
lib/server/auth-profiles.js33 symbols
lib/server/gmail-watch.js31 symbols
lib/server/webhooks.js29 symbols

For agents

$ claude mcp add alphaclaw \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact