Safety-first local control center for OpenClaw.
Language: English | 中文
Overview: health, current state, decisions waiting, and operator-facing summariesUsage: usage, spend, subscription windows, and connector statusStaff: who is really working now versus only queuedTasks: current work, approvals, execution chains, and runtime evidenceDocuments and Memory: source-backed workbenches scoped to active OpenClaw agentsExample UI from a local OpenClaw environment:
|
|
| Token attribution See which timed jobs are actually consuming tokens and how the share splits across them. | Staff page See who is working now, who is on standby, recent output, and schedule state. |
npm install
cp .env.example .env
npm run build
npm test
npm run smoke:ui
UI_MODE=true npm run dev
Then open:
http://127.0.0.1:4310/?section=overview&lang=enhttp://127.0.0.1:4310/?section=overview&lang=zhopenclaw.json, so deleted agents do not keep showing up.For:
control-center/.READONLY_MODE=true by default.LOCAL_TOKEN_AUTH_REQUIRED=true by default.IMPORT_MUTATION_ENABLED=false by default.IMPORT_MUTATION_DRY_RUN=false by default.APPROVAL_ACTIONS_ENABLED=false default).APPROVAL_ACTIONS_DRY_RUN=true).~/.openclaw/openclaw.json.npm installcp .env.example .envGATEWAY_URL or path overrides if your OpenClaw setup is non-standard.npm run buildnpm testnpm run smoke:uiUI_MODE=true npm run devYou should already have:
node and npmFor the richest dashboard data, it also helps if this machine has:
~/.openclaw~/.codexgit clone https://github.com/TianyiDataScience/openclaw-control-center.git
cd control-center
npm install
cp .env.example .env
If OpenClaw claims the repo is missing src/runtime or other core source files, do not start patching code. The canonical repo layout already includes:
package.jsonsrc/runtimesrc/ui.env.exampleThat error usually means:
openclaw-control-center repo rootThe best first-run path is not manual setup. The best path is to give your own OpenClaw one install instruction block and let it do the safe wiring for you.
If you want a copy-ready standalone file, use:
It should handle:
.env creation or correctionbuild / test / smokeThis install instruction already accounts for common real-world differences such as:
~/.openclaw, ~/.codex, Gateway URL, or UI portnode / npm, no npm-registry connectivity, or insufficient write permissions in the repoCopy the full block below into OpenClaw:
You are installing and connecting OpenClaw Control Center to this machine's OpenClaw environment. Your goal is not to explain theory. Your goal is to complete a safe first-run setup end to end. Hard rules: 1. Work only inside the control-center repository. 2. Do not modify application source code unless I explicitly ask. 3. Do not modify OpenClaw's own config files. 4. Do not enable live import or approval mutations. 5. Keep all high-risk write paths disabled. 6. Do not assume default agent names, default paths, or a default subscription model. Use real inspection results from this machine. 7. Do not treat missing subscription data, missing Codex data, or a missing billing snapshot as an install failure. If the UI can run safely, continue and clearly mark which panels will be degraded. 8. Do not fabricate, generate, or overwrite any provider API key, token, cookie, or external credential. If OpenClaw itself is missing those prerequisites, report the gap instead of guessing. Follow this order: Phase 1: inspect the environment 1. Check whether the OpenClaw Gateway is reachable and confirm the correct `GATEWAY_URL`. 2. Confirm the correct `OPENCLAW_HOME` and `CODEX_HOME` on this machine. 3. If the subscription or billing snapshot is stored outside the default path, find the correct `OPENCLAW_SUBSCRIPTION_SNAPSHOT_PATH`. 4. Confirm which prerequisites are truly present and which are missing-but-degradable. At minimum, evaluate: - `node` - `npm` - write access to the repo directory - npm-registry reachability if dependencies are not installed yet - the OpenClaw Gateway - `openclaw.json` - OpenClaw session/runtime data - `CODEX_HOME` - the subscription/billing snapshot - whether the provider/backend prerequisites used by OpenClaw are already present (check presence only; never print secrets) 5. If more than one plausible `OPENCLAW_HOME`, Gateway, or workspace exists, do not guess. Prefer the combination backed by a live Gateway, a readable `openclaw.json`, and the strongest evidence that it belongs to the current project. If it is still ambiguous, stop and list the candidates. 6. If a path, process, or file is missing in a way that makes the control center impossible to start at all, such as missing `node` / `npm`, no ability to download dependencies, a non-writable repo, or an unreadable OpenClaw root, stop and tell me exactly what is missing instead of guessing. 7. If the missing item only affects richer dashboards, such as subscription snapshots, Codex telemetry, part of the runtime data, or Codex-specific telemetry on a machine that actually uses API-key/provider mode, continue the install and mark those areas as "install can continue, but this surface will be partial". 8. Do not assume any fixed agent names. If `openclaw.json` is readable, treat it as the source of truth. If not, fall back to runtime-visible agents and explicitly say that roster confidence is lower. Phase 2: install the project 9. Confirm that the current directory is the control-center repo root. 10. First verify the repo is complete. At minimum, confirm these paths exist: - `package.json` - `src/runtime` - `src/ui` - `.env.example` 11. If `src/runtime`, `src/ui`, or `package.json` is missing, do not continue and do not guess where the code should come from. Classify it as "wrong repo / incomplete checkout / wrong working directory", then: - leave the incorrect directory - re-clone `https://github.com/TianyiDataScience/openclaw-control-center.git` - continue only after entering the new repo root 12. Install dependencies. 13. If `.env` does not exist, create it from `.env.example`. If it already exists, update it while preserving safe first-run defaults. Do not delete unrelated user settings; only change the keys required for this connection. Phase 3: apply safe first-run settings 14. Keep these values: - READONLY_MODE=true - LOCAL_TOKEN_AUTH_REQUIRED=true - APPROVAL_ACTIONS_ENABLED=false - APPROVAL_ACTIONS_DRY_RUN=true - IMPORT_MUTATION_ENABLED=false - IMPORT_MUTATION_DRY_RUN=false - UI_MODE=false 15. Only change these when the machine actually requires it: - GATEWAY_URL - OPENCLAW_HOME - CODEX_HOME - OPENCLAW_SUBSCRIPTION_SNAPSHOT_PATH - UI_PORT 16. If this machine runs OpenClaw on provider API keys or a non-Codex backend instead of a Codex / GPT subscription, do not treat that as an error. Continue the install as long as OpenClaw itself can run, and say clearly that subscription/quota surfaces may be partially visible or unavailable. 17. If `CODEX_HOME` does not exist, or this machine simply does not have Codex / GPT subscription data, do not invent a path. Leave it unset and say clearly that Usage / Subscription will be partially visible or unavailable. 18. If no subscription snapshot exists, do not fabricate `OPENCLAW_SUBSCRIPTION_SNAPSHOT_PATH`. Continue the install and say that quota/subscription cards will show disconnected or estimated states. 19. If `4310` is already in use, choose a free local port, write it to `UI_PORT`, and report the new address clearly. 20. Do not change application logic just because my agent roster differs from the examples in this repo. The control center should reflect the agents configured or visible on my own machine. Phase 4: verify the install 21. Run: - npm run build - npm test - npm run smoke:ui 22. If any step fails, stop and tell me: - which step failed - why it failed - what I should do next 23. If build / test / smoke pass but the live Gateway is still unreachable, do not classify the install as failed. Classify it as "local UI ready, live observability not connected yet". 24. If OpenClaw itself cannot produce live data because external provider credentials are missing, do not call that a control-center install failure. Classify it separately as "control center installed, upstream OpenClaw prerequisite missing". Phase 5: hand off a ready-to-run result 25. If verification passes, print: - which env values you changed - which env values stayed on the defaults - the exact command I should run next to launch the UI - the first 3 dashboard pages I should open - which missing signals are normal for a partially connected environment - which capabilities are working now - which capabilities are degraded because this machine lacks those data sources - which env values or prerequisites I would need later if I want to connect subscription / Codex / live Gateway data - which missing provider credentials, external auth, or upstream OpenClaw services are outside the control-center repo and still need operator action Format your final answer as: - Environment check - Differences and degradation assessment - Actual changes - Verification result - Next command - First pages to open
Only use this path if you do not want OpenClaw to handle setup for you.
For a safe first run, keep the mutation guards in place.
Use this baseline:
GATEWAY_URL=ws://127.0.0.1:18789 READONLY_MODE=true APPROVAL_ACTIONS_ENABLED=false APPROVAL_ACTIONS_DRY_RUN=true IMPORT_MUTATION_ENABLED=false IMPORT_MUTATION_DRY_RUN=false LOCAL_TOKEN_AUTH_REQUIRED=true UI_MODE=false UI_PORT=4310 # Optional only when your paths differ from the defaults: # OPENCLAW_HOME=/path/to/.openclaw # CODEX_HOME=/path/to/.codex # OPENCLAW_SUBSCRIPTION_SNAPSHOT_PATH=/path/to/subscription.json
Change only these values if your environment needs it:
GATEWAY_URL: when your OpenClaw Gateway is not on the default local socketOPENCLAW_HOME: when OpenClaw is not stored in ~/.openclawCODEX_HOME: when Codex data is not stored in ~/.codexOPENCLAW_SUBSCRIPTION_SNAPSHOT_PATH: when your billing/subscription snapshot lives somewhere customUI_PORT: when 4310 is already in useRun:
npm run build
npm test
npm run smoke:ui
Expected result:
http://127.0.0.1:<port>UI_MODE=true npm run dev
Then open:
http://127.0.0.1:4310/?section=overview&lang=enhttp://127.0.0.1:4310/?section=overview&lang=zhIf you changed UI_PORT, replace 4310 with your chosen port.
On your first launch, check these pages in order:
Overview: the app opens and shows current system state.Usage: usage and subscription panels either show real numbers or a clear missing-connector state.Staff: live work status matches real active sessions.Tasks: current work, approvals, and execution-chain cards load without raw payload noise.Documents and Memory: the visible agent tabs match your active agents from openclaw.json.GATEWAY_URL is wrong or the OpenClaw Gateway is not running.Documents / Memory agents usually means OPENCLAW_HOME points to the wrong OpenClaw root or openclaw.json is missing.CODEX_HOME or OPENCLAW_SUBSCRIPTION_SNAPSHOT_PATH needs to be set.npm run buildnpm run devnpm run dev:continuousnpm run dev:uinpm run smoke:uinpm run command:backup-exportnpm run command:import-validate -- runtime/exports/<file>.jsonnpm run command:acks-prunenpm testnpm run validateFor protected command modes (command:backup-export, command:import-validate, command:acks-prune), set LOCAL_API_TOKEN=<token> unless LOCAL_TOKEN_AUTH_REQUIRED=false.
If you are publishing the repository itself, not just installing it, use this section. Normal operators can skip it.
npm run release:audit before public pushesdocs/PUBLISHING.md for the standalone repo release flowGET /snapshot: raw snapshot JSONGET /projects: list projects with optional query filters status, ownerGET /api/projects: same as /projects for compatibilityPOST /api/projects: create project (projectId, title, optional status, owner)PATCH /api/projects/:projectId: update project title/status/ownerGET /tasks: flattened task list with optional query filters status, owner, projectGET /api/tasks: same as /tasks for compatibilityPOST /api/tasks: create task with schema validationPATCH /api/tasks/:taskId/status: update task status with schema validationGET /sessions: paginated session visibility list with optional filters state, agentId, q, and pagination params page, pageSize, historyLimitGET /sessions/:id: per-session JSON detail with latest history entries (historyLimit query supported)GET /api/sessions/:id: explicit API alias for per-session JSON detailGET /session/:id: localized session drill-down UI page (lang=en|zh) with latest messages, execution-chain evidence, and safe truncationGET /api/sessions: compatibility endpoint for /sessionsGET /api/commander/exceptions: exceptions-only summary (blocked/errors/pending approvals/over-budget/tasks-due)GET /exceptions: routed exceptions feed with levels (info, warn, action-required), sorted by severity then newest eventGET /done-checklist: final integration checklist + readiness scoring (observability/governance/collaboration/security)GET /api/done-checklist: API alias for done checklistGET /api/action-queue: notification center queue derived from exceptions feed + ack state + relevant session/task/project linksGET /api/action-queue/acks/prune-preview: token-gated dry-run preview of stale ack prune counts (before/removed/after, no state mutation)POST /api/action-queue/:itemId/ack: acknowledge an action-required queue item (persisted), optional ttlMinutes or snoozeUntil to auto-expire ack stateGET /graph: project-task-session linkage graph JSON (for future Gameboy view)GET /view/pixel-state.json: pixel-ready adapter state (rooms, entities, links) for future Gameboy canvasGET /usage-cost: product route alias that redirects to /?section=usage-costGET /api/usage-cost: usage/billing observability snapshot (period totals, context windows, breakdowns, burn-rate, subscription consumed/remaining/cycle, connector TODOs)GET /export/state.json: bundled export with sessions/tasks/projects/budgets/exceptions + persisted debug snapshot + backup bundle in runtime/exports/ (requires local token auth)POST /api/import/dry-run: dry-run validator for export bundles (fileName or inline bundle) with zero state mutation (requires local token auth)POST /api/import/live: optional live import mutation endpoint (high-risk, local-only); requires local token + IMPORT_MUTATION_ENABLED=true, blocked in readonly unless dryRun=true, and now returns validation errors instead of 500 for bad fileName pathsGET /notifications/preview: notification policy preview with quiet-hours + severity routingGET /cron: cron overview with next run and health summaryGET /healthz: system health payload (build info + snapshot freshness + monitor lag)GET /digest/latest: rendered HTML page from latest markdown digest fileGET /api/ui/preferences: persisted dashboard UI preferences (runtime/ui-preferences.json)PATCH /api/ui/preferences: update dashboard UI preferences (compactStatusStrip, quickFilter, taskFilters)GET /api/search/tasks: safe substring search over tasks (q, limit), with count = total matches and returned = current response sizeGET /api/search/projects: safe substring search over projects (q, limit), with count = total matches and returned = current response sizeGET /api/search/sessions: safe substring search over sessions (q, limit), with count = total matches, returned = current response size, and live-session merge parity with /sessionsGET /api/search/exceptions: safe substring search over exception feed (q, limit), with count = total matches and returned = current response sizeGET /api/replay/index: replay/debug index from timeline + digests + export snapshots + export bundles, optional from/to ISO time window filters, plus per-source stats (total, returned, filteredOut, window-vs-limit breakdown, latencyMs, latencyBucketsMs with p50/p95, totalSizeBytes, returnedSizeBytes)GET /api/docs: route + schema summary endpointGET /docs: localized docs index page (read-only) with direct return path to the Documents sectionGET /docs/readme|runbook|architecture|progress: local markdown docs views (read-only, lang accepted for index/back-link flow)POST /api/approvals/:approvalId/approve: approval action service (gate + dry-run + audit)POST /api/approvals/:approvalId/reject: rejection action service (gate + dry-run + audit)GET /audit: local audit timeline page (newest-first, severity filter)GET /api/audit: audit timeline JSON (severity=all|info|warn|action-required|error)/api/search/*./api/replay/index./auditDocuments and Memory now follow active OpenClaw agent config instead of stale workspace folders:
~/.openclaw/openclaw.json firstworkspace/agents/Main instead of 共享updatedAt, size, path)Execution chain cards no longer surface raw JSON payloads as the visible headline or summary.Main · Cron 隔离执行.成功 · 查询 30 · 成功 30失败 · 错误 locked成功 · 扫描 120 · 入选 2 · 发送 2Working / 工作中 now means live execution, not just “still owns unfinished tasks”.Working on / 正在处理什么Next up / 下一项3s; live-session polling baseline remains 5s.Documents / Memory no longer revive deleted agents just because stale folders still remain on disk.Main only instead of showing stale agent folders.Overview renders dropped to about 0.41sUsage renders dropped to about 0.41sOverview / Settings / Usage completed in about 1.13sOverviewOffice SpaceProjects/TasksAlertsReplay/AuditSettingsOffice Space view shows who is busy on what, grouped by office zones.Not activated yet.Usage & Cost section in the primary sidebar IA.today, 7d, 30d)Data source not connected labels for disconnected metrics (instead of fake zeros)GET /api/usage-costCommand Deck, Usage & Billing, Pixel Office, Work Board, Decisions, Timeline, Control Room~/.openclaw/openclaw.json via src/runtime/agent-roster.tssrc/runtime/usage-cost.ts for connected/partial/not_connected statesInformation certainty card to Overview and Settings:
Execution certainty board to Tasks:
evidence is strong from needs follow-up and evidence is weakContent-Type: application/json.x-local-token: <LOCAL_API_TOKEN>Authorization: Bearer <LOCAL_API_TOKEN>{"ok":false,"requestId":"...","error":{"code":"...","status":<http>,"message":"...","issues":[],"requestId":"..."}}requestId and all responses include x-request-id header for correlation.POST /api/import/live is intentionally disabled by default.runtime/projects.json, runtime/tasks.json, runtime/budgets.json).READONLY_MODE=true and IMPORT_MUTATION_ENABLED=false in normal operation.runtime/last-snapshot.jsonruntime/timeline.logruntime/projects.jsonruntime/tasks.jsonruntime/budgets.jsonruntime/notification-policy.jsonruntime/model-context-catalog.jsonruntime/ui-preferences.jsonruntime/acks.jsonruntime/approval-actions.logruntime/operation-audit.logruntime/digests/YYYY-MM-DD.jsonruntime/digests/YYYY-MM-DD.mdruntime/export-snapshots/*.jsonruntime/exports/*.jsondocs/ARCHITECTURE.mddocs/RUNBOOK.mddocs/PROGRESS.md