Remote control for your local Codex on your Mac from your iPhone.
This project started as a local-only fork of Zane (credit: https://github.com/z-siddiqi/zane):
curl -fsSL https://raw.githubusercontent.com/ddevalco/codex-pocket/main/scripts/install-local.sh | bash
tailscale up
tailscale serve --bg http://127.0.0.1:8790
http://127.0.0.1:8790/admin and sign in with your Access Token.If anything doesn’t work, run:
~/.codex-pocket/bin/codex-pocket ensure
docs/INSTALL.mddocs/CLI.mddocs/ADMIN.mddocs/TROUBLESHOOTING.mddocs/TROUBLESHOOTING_PROVIDERS.mddocs/ARCHITECTURE.mddocs/CI.mddocs/NATIVE_IOS_ROADMAP.mddocs/DIFFERENCES_FROM_ZANE.mddocs/DEVELOPMENT.mddocs/TESTING.mdCONTRIBUTING.mdWe track the canonical backlog in GitHub Projects:
All bugs, features, and reliability work are tracked as GitHub Issues:
Workflow rules:
Fixes #... or Refs #...).Prioritized engineering recommendations are maintained in:
codex-pocket: command not found
~/.codex-pocket/bin/codex-pocket.~/.codex-pocket/bin/codex-pocket summaryecho 'export PATH="$HOME/.codex-pocket/bin:$PATH"' >> ~/.zshrcexec zsh./bin/codex-pocket ... (if you cd bin, use ./codex-pocket, not codex-pocket)."Serve is not enabled on your tailnet"
tailscale serve --bg http://127.0.0.1:8790 and follow the link Tailscale prints to enable Serve.Admin shows "Failed to fetch" or stays on "Loading..."
~/.codex-pocket/bin/codex-pocket ensure.Admin asks for the Access Token again
~/.codex-pocket/bin/codex-pocket token to print it.iPhone opens the tailnet URL but shows disconnected / no device
/admin on the Mac and click Validate then Repair.Port conflict / service won’t start
~/.codex-pocket/bin/codex-pocket diagnose to see what’s listening and the latest logs.Codex Pocket now supports multiple AI providers in a single interface:
If you have the GitHub Copilot CLI installed (gh copilot or copilot):
Phase 1 provides read-only access:
Codex Pocket uses a pluggable adapter architecture. See docs/PROVIDERS.md for a guide on adding new AI providers.
Codex Pocket is a focused fork for a single use case: run Codex locally on macOS and access it securely from iPhone over Tailscale.
Key differences:
local-orbit) with token-based auth (legacy access token + per-device sessions).127.0.0.1 and is designed to be exposed via tailscale serve to devices on your tailnet (no public internet required).launchd integration (with background fallback), and a full codex-pocket CLI (doctor/summary/urls/token/start/stop/restart/status/logs/pair/open-admin/ensure/smoke-test/update).update/ensure/self-test and CI smoke tests are designed to catch regressions like blank threads quickly; index.html is served with Cache-Control: no-store to reduce “cached broken bundle” issues after updates.http:// origins via a clipboard fallback), with iOS-friendly share-sheet behavior./admin): status, logs, start/stop Anchor, one-time pairing QR for your iPhonelocal-orbit) that serves:/ws) for realtime control/threads/:id/events)~/.codex/.codex-global-state.json)This repo includes a GitHub Actions workflow (.github/workflows/ci.yml) that builds the UI and runs smoke tests (including a WebSocket relay test) to catch regressions like “blank threads”.
/admin)./admin mints a short-lived one-time pairing code (shown as QR)./admin.Codex Pocket is built around a simple security goal: don’t expose your local Codex to the public internet. Tailscale is what makes that practical.
What it provides in this setup:
my-mac.tailXXXX.ts.net).How it fits Codex Pocket:
127.0.0.1.tailscale serve publishes that local-only service to your tailnet over HTTPS/WSS.~/.codex-pocket/uploads).0 days). You can set retention (days) in /admin./u/<token>). This avoids putting your Access Token in image URLs and allows <img> tags to load on iPhone.curl -fsSL https://raw.githubusercontent.com/ddevalco/codex-pocket/main/scripts/install-local.sh | bash
After install:
http://127.0.0.1:8790.pbcopy, best-effort).What the installer does:
~/.codex-pocket/.launchd agent. If your system blocks launchctl (common on managed Macs), it will fall back to running in the background and prints Service started via: ....tailscale serve so your iPhone can reach the service via MagicDNS.If you want a clean slate (stop service, disable tailscale serve, remove launchd agent, delete ~/.codex-pocket):
curl -fsSL https://raw.githubusercontent.com/ddevalco/codex-pocket/main/scripts/reset-and-install.sh | bash
If you only want to wipe without reinstalling, run the local script after install:
~/.codex-pocket/app/scripts/wipe-local.sh
If you do not have Tailscale yet:
tailscale up on the MacTerminology:
my-mac.tailXXXX.ts.net).Expose the service on your tailnet (run on Mac):
tailscale serve --bg http://127.0.0.1:8790
Note: Some tailnets require you to enable Tailscale Serve in the admin console the first time. If you see an error like "Serve is not enabled on your tailnet", follow the link it prints and enable it.
Then open on your Mac (to pair your iPhone):
http://127.0.0.1:8790/adminWhat to expect after pairing:
https://<your-mac-magicdns-host>/ and connect automatically (no manual “server URL” setup)./admin and ~/.codex-pocket/anchor.log.Note about the Codex desktop app:
services/local-orbit/src/index.tsservices/anchor/src/index.tsdocs/INSTALL.mddocs/ADMIN.mddocs/CLI.mddocs/ARCHITECTURE.mddocs/SECURITY.mddocs/CONFIG.mddocs/PROTOCOL.mddocs/HARDENING.mddocs/TROUBLESHOOTING.mddocs/NATIVE_IOS_ROADMAP.mdCHANGELOG.mdSee docs/ATTRIBUTION.md.