A local command and observability system for Codex-based development work, focused on:
- Task control
- Session observability
- Approval flows
- local repository and worktree control
- mobile access by browser and optional Telegram
This repository contains a working v1 foundation with a local API server, browser/PWA interface, approval and policy logic, scheduler, and optional Telegram integration.
New to this project? Start with the step-by-step First Run Onboarding. It walks from clone to first safe task in stub mode, including expected results and common first-run errors.
Fastest path:
npm run setup:quickThis creates .env.local.ps1, installs dependencies, installs Playwright Chromium, and builds the repo. For a direct first server start:
npm run setup:quick:startsetup:quick uses a PowerShell wrapper. On Windows it works with pwsh or powershell. On macOS/Linux it expects PowerShell 7 as pwsh; otherwise use the manual path below.
Manual path:
npm install
npx playwright install --with-deps chromium
npm run typecheck
npm run lint
npm run build
npm run test:runGitHub CI runs with Node 22 and checks:
npm run typechecknpm run lintnpm run buildnpm run test:run
Start the server locally:
npm run build
npm run start --workspace @codex-command-center/serverBuild the web app and open it locally in a browser:
npm run build
start .\apps\web\index.htmlThe web app stores API Base URL and optional bearer token locally in the browser. For file-based usage, the server serves CORS headers for the API.
Mobile/PWA foundation:
- Approval inbox under
#/approvals - Automation view under
#/automations - mobile bottom navigation for
Home,Approvals,Automations,Sessions,Tasks manifest.webmanifest,sw.jsand homescreen metadata for PWA Add-to-Home-Screen setup- on iPhone, Safari shows an install prompt:
Add to Home Screen
Important environment variables:
CC_HOST: local API server host binding, default127.0.0.1CC_PORT: API port, default8787CC_DB_PATH: path to the SQLite fileCC_API_TOKEN: optional bearer token for/api/*CC_CODEX_RUNNER_MODE:cli,app-server, orstub, defaultcli. Useapp-serverfor live Codex command/file approvals.CC_CODEX_COMMAND: Codex CLI binary, defaultcodex.cmdon WindowsCC_CODEX_ARGS_JSON: optional JSON array of extra args for the CLICC_CODEX_APP_SERVER_TRANSPORT:spawnstarts a managed app-server process,proxyattaches throughcodex app-server proxyCC_CODEX_MODEL: optional default model forPOST /api/tasks/:id/runCC_CODEX_SANDBOX: default sandbox for runs, defaultworkspace-writeCC_CODEX_OUTPUT_DIR: output folder for run artifactsCC_APPROVAL_TTL_MINUTES: lifetime of automatically created approvals, default60CC_AUTOMATION_TICK_SECONDS: scheduler polling interval, default30CC_TELEGRAM_BOT_TOKEN: bot token for Telegram alerts and webhook actionsCC_TELEGRAM_ALLOWED_CHAT_IDS: comma-separated allowed chat IDs for alerts and commandsCC_TELEGRAM_WEBHOOK_SECRET: required secret forPOST /api/telegram/webhookwhen Telegram is enabledCC_TELEGRAM_API_BASE_URL: optional Telegram API host, defaulthttps://api.telegram.orgCC_TELEGRAM_LIVE_BOT_TOKEN: optional for live test insidenpm run test:runCC_TELEGRAM_LIVE_CHAT_ID: optional for live test insidenpm run test:run
Security/hardening rules:
- if
CC_HOSTis not127.0.0.1,localhost, or::1, thenCC_API_TOKENis required CC_API_TOKENmust be at least16characters long- if Telegram is enabled, both
CC_TELEGRAM_WEBHOOK_SECRETandCC_TELEGRAM_ALLOWED_CHAT_IDSare required CC_TELEGRAM_WEBHOOK_SECRETmust be at least16characters long
Key API endpoints for the current state:
GET /api/events: recent events, optionally filtered withlimit,entityType,entityId,eventTypeGET /api/telemetry/summary: simple metrics for dashboard and mobile overviewGET /api/tasks/:id/events: timeline for a taskGET /api/sessions/:id/events: timeline for a sessionPOST /api/tasks/:id/policy-check: validates run policy without executingPOST /api/tasks/:id/run: starts only if policy rules are met or approvals already existPOST /api/approvals/:id/resolve: approve or reject open approvalsGET /api/automations: lists scheduled automations withlastRunAtandnextRunAtPOST /api/automations: creates a new hourly or daily automationPATCH /api/automations/:id: enable/disable or update an automationPOST /api/automations/:id/run: starts a manual test run for an automationPOST /api/telegram/webhook: Telegram webhook for commands and inline approvals
Supported schedule formats for v1:
hourlyhourly:2throughhourly:24daily@09:00
Telegram in v1:
- message on new pending approvals with inline buttons for
Approve/Reject - message on
task completed - message on
task failed - commands
/approvals,/status,/helpvia webhook - webhook accepts requests only when secret and allowed chat IDs match
Live verification with real Telegram:
- set
CC_TELEGRAM_LIVE_BOT_TOKENandCC_TELEGRAM_LIVE_CHAT_ID - run
npm run test:run - live test is opt-in and is skipped automatically without these variables
Recommended v1 operation:
CC_HOST=127.0.0.1- set a strong
CC_API_TOKEN - expose mobile access only through Tailscale or a similar mesh VPN, not via public internet port
- Telegram only with
CC_TELEGRAM_WEBHOOK_SECRETand explicitCC_TELEGRAM_ALLOWED_CHAT_IDS
Recommended flow for mobile access:
- Bind server only to
127.0.0.1. - Enable Tailscale on both host and iPhone.
- Access via Tailscale IP or local reverse proxy inside the Tailscale network.
- Store
CC_API_TOKENin the mobile browser.
Not recommended:
CC_HOST=0.0.0.0withoutCC_API_TOKEN- exposing public internet ports without VPN or reverse-proxy hardening
- Telegram operation without a secret or without a chat allowlist
For local verification without real Codex runs, set the runner to stub mode:
$env:CC_CODEX_RUNNER_MODE="stub"
npm run start --workspace @codex-command-center/serverapps/ web UI and server applications
packages/ shared blocks and integrations
docs/ product, architecture, and MVP documentation
infra/ local infrastructure and telemetry components
examples/ sample configurations for agents, skills, and policies
Current contents:
apps/server: TypeScript bootstrap for the local API serverapps/web: TypeScript bootstrap for the later web and mobile interfacepackages/*: reserved shared components for later tasks
- First Run Onboarding
- Local Setup
- Architecture v1
- API Basics
- Mobile Access And Telegram
- Developer Onboarding
- Product blueprint
- MVP v1
- Project tasks
- Policy example
This project is under the MIT License.