remote-codex
v0.11.1
Published
Local web supervisor for Codex workspaces and threads.
Downloads
1,732
Readme
Remote Codex Supervisor
Phase 1 implements the base supervisor foundation for a local Codex control surface:
FastifyAPI with health checks, runtime config, workspace registry, and WebSocket skeletonReact + Viteweb shell with a single-user landing page, workspace list, add flow, and read-only treeDrizzle + better-sqlite3persistence with explicit SQL migrations- Workspace browsing constrained to a configurable root path
Requirements
- Node.js
>= 20 - pnpm
>= 10
Install
pnpm install
cp .env.example .envOptional overrides:
WORKSPACE_ROOT=/absolute/pathDATABASE_URL=/absolute/path/to/sqlite.db
Defaults:
- development database:
.local/supervisor-dev.sqlite - production database:
~/.remote-codex/supervisor.sqlite - workspace root: current user home directory
Global CLI Install
Remote Codex can also be packaged as an npm global CLI:
npm install -g remote-codex
remote-codex start
remote-codex status
remote-codex stopThe global CLI starts the production API and web service:
- API:
http://127.0.0.1:45674 - Web:
http://127.0.0.1:45673 - service logs/state:
~/.remote-codex/service/ - production database:
~/.remote-codex/supervisor.sqlite
Environment overrides:
SERVICE_HOSTandSERVICE_PORTSERVICE_API_HOSTandSERVICE_API_PORTREMOTE_CODEX_SERVICE_DIRDATABASE_URLWORKSPACE_ROOTCODEX_HOMECODEX_COMMAND
Development
pnpm db:migrate
pnpm devThis starts:
- API:
http://127.0.0.1:8787 - Web:
http://127.0.0.1:5173
Service Mode
Build first, then use the service manager:
pnpm build
pnpm service:start
pnpm service:status
pnpm service:stopThis starts a quieter long-running stack:
- API:
http://127.0.0.1:8787 - Web:
http://127.0.0.1:4173
Logs are written to ~/.remote-codex/service/ by default. Set REMOTE_CODEX_SERVICE_DIR to override this.
Remote Access via Tailscale
If you want to open the supervisor from another device on your tailnet:
pnpm dev
tailscale serve --bg 5173Or, if you are using service mode:
pnpm build
pnpm service:start
tailscale serve --bg 4173Useful Tailscale commands:
tailscale serve status
tailscale serve resetNotes:
tailscale serve --bg 5173is required for the current remote-access workflow and was previously undocumented.- In both dev mode and service mode, the web entrypoint proxies
/api,/healthz, and/wsto the API on127.0.0.1:8787, so you do not need a separatetailscale serverule for the API port. - If the Tailscale hostname for the target machine changes, update
allowedHostsinapps/supervisor-web/vite.config.tsbefore using remote access.
Common Commands
pnpm build
pnpm lint
pnpm typecheck
pnpm test
pnpm db:migrateAPI Endpoints
GET /healthzGET /api/versionGET /api/config/runtimeGET /api/workspacesGET /api/workspaces/:idPOST /api/workspacesPOST /api/workspaces/:id/favoritePOST /api/workspaces/:id/openGET /api/workspaces/tree?path=...&showHidden=...GET /ws
Manual Acceptance
- Remove prior build and local state:
rm -rf node_modules .local apps/*/dist packages/*/dist- Reinstall and start:
pnpm install
pnpm db:migrate
pnpm dev- Verify API health:
curl http://127.0.0.1:8787/healthz
curl http://127.0.0.1:8787/api/version
curl http://127.0.0.1:8787/api/config/runtime- Open the web UI at
http://127.0.0.1:5173, add a valid workspace, then verify:
- it appears in the workspace list
- the detail page shows the tree
- hidden files can be toggled on and off
- Verify failure paths by attempting to add:
- a non-existent directory
- a directory outside
WORKSPACE_ROOT - a non-directory path
- Run the full quality gate:
pnpm lint
pnpm typecheck
pnpm test
pnpm build