Skip to content

drewcotten/farfield

Repository files navigation

Farfield

A local UI for the Codex app — read your conversations, send messages, switch models, and monitor agent activity, all from a clean web interface running on your machine.

Built by @anshuchimala.

This is an independent project and is not affiliated with, endorsed by, or sponsored by OpenAI. I'm just an indie dev who likes to build with AI!

Buy Me A Coffee

Farfield screenshot

What it does

Farfield connects to the Codex desktop app over its local IPC socket and app-server API, then exposes a polished web UI at localhost:4312. You get:

  • Thread browser — sidebar grouped by project with all your active Codex threads
  • Chat view — read and send messages, switch collaboration mode, model, and reasoning effort
  • Plan mode toggle — flip Codex into plan mode for any thread
  • Agent monitoring — live stream events, pending user input requests, and interrupt controls
  • Debug tab — full IPC history, payload inspection, and replay

Requirements

  • Node.js 20+
  • pnpm 10+
  • Codex desktop app installed and running locally

Install

pnpm install

Run

pnpm dev

That's it. Both the backend and frontend start in parallel.

  • Backend: http://127.0.0.1:4311
  • Frontend: http://127.0.0.1:4312 — open this in your browser

The frontend proxies /api and /events to the backend automatically.

Remote Access via Tailscale (Recommended)

Farfield now supports a secure remote flow for iPhone access:

  • Network access over your private Tailscale tailnet
  • App PIN login (HTTP-only session cookie)
  • Full control remotely (send, interrupt, and respond to input requests)
  • Remote Debug endpoints disabled by default

1. Start Tailscale on your Mac

tailscale up

2. Start Farfield in remote mode with a PIN

FARFIELD_AUTH_PIN=1234 pnpm dev:remote

FARFIELD_AUTH_PIN is required when binding HOST=0.0.0.0.

Optional env vars:

  • FARFIELD_SESSION_TTL_SECONDS (default: 604800, 7 days)
  • FARFIELD_REMOTE_DEBUG_ENABLED (default: 0)
  • FARFIELD_AUTH_COOKIE_NAME (default: farfield_session)

3. Get your Tailscale IP and open Farfield from iPhone

tailscale ip -4

Open http://<tailscale-ip>:4312 in Safari on your iPhone (with Tailscale connected to the same tailnet), then enter your PIN.

iPhone flow

  1. Install and sign in to Tailscale on iPhone.
  2. Connect Tailscale on iPhone and Mac.
  3. Open http://<tailscale-ip>:4312 in Safari.
  4. Enter your Farfield PIN on the lock screen.

Remote Debug behavior

  • Local loopback requests: Debug is always available.
  • Remote requests: Debug is blocked unless FARFIELD_REMOTE_DEBUG_ENABLED=1.

Troubleshooting

Symptom Cause Fix
AUTH_REQUIRED / lock screen loops Missing or expired session Enter PIN again via the lock screen.
FARFIELD_AUTH_PIN is required when HOST is not loopback dev:remote started without PIN Start with FARFIELD_AUTH_PIN=... pnpm dev:remote.
No Tailscale URLs shown Tailscale is not installed/running Install Tailscale and run tailscale up.
iPhone cannot connect Wrong address or not on same tailnet Verify tailscale ip -4, then open http://<ip>:4312.
Debug tab unavailable remotely Remote debug is intentionally disabled Set FARFIELD_REMOTE_DEBUG_ENABLED=1 only when needed.

Other commands

pnpm build       # Build all packages
pnpm test        # Run all tests
pnpm typecheck   # TypeScript type checking across all packages
pnpm lint        # Lint all packages

Run a single app:

pnpm --filter @farfield/server dev
pnpm --filter @farfield/web dev

Project layout

apps/
  server/       HTTP + SSE backend (TypeScript)
  web/          React frontend (Vite + Tailwind)
packages/
  protocol/     Zod schemas and inferred types for all wire formats
  api/          Typed clients for the Codex app-server and desktop IPC
scripts/
  sanitize-traces.mjs   Redact trace files for safe fixture use
  • packages/protocol is the single source of truth for all data shapes. Everything is Zod — no silent coercion, no shape drift, hard failures on unknown payloads.
  • packages/api wraps the Codex IPC socket and app-server HTTP API with typed clients and a high-level service layer.
  • apps/server serves the REST and SSE endpoints the UI depends on, and manages the IPC connection lifecycle.
  • apps/web is a Vite + React + Tailwind app. No heavy framework.

Trace capture (debug)

The Debug tab lets you record IPC traffic as trace files. Raw traces go in traces/ (git-ignored). To generate sanitized test fixtures:

pnpm sanitize:traces

Sanitized files land in packages/protocol/test/fixtures/sanitized/.

License

MIT

About

Remote-control the OpenAI Codex app from anywhere

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors