A self-hosted OAuth control plane for managing openai-codex ChatGPT OAuth
profiles and syncing them into one or more OpenClaw instances.
The UI is mobile-friendly, the storage is local SQLite, and the sync path is explicit: preview first, then apply with admin auth and confirmation.
- Stores and rotates multiple
openai-codexOAuth accounts - Shows usage windows such as
5handWeek - Lets you rename, reorder, refresh, and delete profiles
- Discovers local OpenClaw instances automatically
- Lets you register remote OpenClaw instances over SSH
- Builds a canonical auth payload and syncs it into each instance
- Scrubs stale session-level
authProfileOverridevalues during sync so old threads do not stay pinned to deleted OAuth profiles
- No dependency on unrelated infra state files
- Safe-by-default sync model
- Local encrypted token storage with AES-256-GCM
- Instance mutation is opt-in
OAUTH_ADMIN_ALLOW_INSTANCE_MUTATION=false by default.
That means:
GET /api/sync/previewis allowedPOST /api/sync/applyis blocked unless mutation is enabled- No OpenClaw instance is modified until you explicitly allow it
cp .env.example .env.local npm install npm run dev
Default local port: 18905
npm install npm run build npm run start
If you want a one-host deployment with systemd + Caddy, see:
This project is meant to manage your own OpenClaw fleet, not just the original server where it was developed.
See:
At a minimum you need:
- SSH access from the admin host to the target machine
- The target
agentDir - The target
configPath
See .env.example. The most important ones are:
OAUTH_ADMIN_MASTER_KEYOAUTH_ADMIN_TOKENOAUTH_ADMIN_PUBLIC_BASEOAUTH_ADMIN_BASE_PATHNEXT_PUBLIC_BASE_PATHOAUTH_ADMIN_ALLOW_INSTANCE_MUTATION
POST /api/oauth/startPOST /api/oauth/completeGET /api/profilesPOST /api/usage/refreshGET /api/instancesPOST /api/instancesGET /api/sync/previewPOST /api/sync/applyPOST /api/import/openclaw-auth
POST /api/sync/apply requires confirmText=APPLY_SYNC.
When sync is applied, the service writes:
<agentDir>/auth-profiles.json<configPath>.auth.profiles<configPath>.auth.order
Then it restarts the gateway:
openclaw gateway restart || openclaw gateway startOnly profiles with real stored secrets are included in the canonical synced order.
- Do not commit
.env*, databases, or backup files - Put the app behind a reverse proxy or network boundary
- Rotate
OAUTH_ADMIN_TOKENif it was ever exposed - Review SSH keys and instance metadata before enabling mutation
This repo now includes:
.gitignore- MIT license
- CI workflow for
npm ci && npm run build - self-hosting docs
- OpenClaw instance integration docs