ActRail is a local control rail for CLI coding-agent sessions. It launches pi and codex runtimes, tracks live sessions in one place, and exposes a Go API plus a Preact UI for monitoring, prompt dispatch, queue control, and workspace inspection.
ActRail currently provides:
- session creation for
piandcodexbackends - session listing, focus, rename, delete, and metadata edits
- live transcript and session-state streaming over WebSocket
- prompt send, queue replace, interrupt, and UI-response commands over WebSocket
- HTTP bootstrap, auth, health, session snapshots, and other one-shot actions
- read-only workspace browsing and file reads for a session CWD
- Git file-history lookup for files inside the session workspace
- a Preact frontend in
web/and a Go backend incmd/actrail-server
The backend keeps session state in memory. It creates the configured data directory on startup, but durable session persistence is not wired through the runtime logic yet.
Realtime transport uses WebSocket at /api/ws.
HTTP is used for bootstrap and snapshot-style reads such as /api/bootstrap, /api/sessions, /api/sessions/{id}/messages, workspace reads, Git file-version lookups, auth, and one-shot mutations such as rename, focus, delete, restart, and handoff requests.
In practice: use HTTP to discover state, then keep the UI current through WebSocket subscriptions and realtime commands.
These areas are present as config flags, UI placeholders, or stubbed API shapes, but they are not fully implemented end to end yet:
- voice
- harness
- notifications
- workspace writes from the ActRail API
- session resume from an existing session id
- runtime restart
- session handoff
- durable storage backed by the computed SQLite path
- backend-served production frontend assets
cmd/actrail-server/- Go entrypointinternal/- application, adapters, HTTP API, WebSocket transport, and domain logicweb/- Preact frontendscripts/tmux/- local tmux launcher scripts for backend and frontend
Run the Go tests:
make testRun the backend with the default config:
make runEquivalent direct command:
go run ./cmd/actrail-serverBy default the backend listens on 127.0.0.1:8080.
Install frontend dependencies:
cd web
npm ciStart the Vite dev server:
cd web
CODEX_WEB_PORT=8080 npm run devCODEX_WEB_PORT tells the frontend proxy which backend port to use. The frontend config defaults it to 8743, which matches the tmux launcher. If you run the Go server directly with its default ACTRAIL_PORT=8080, set CODEX_WEB_PORT=8080 as shown above.
Run frontend tests:
cd web
npm testThe tmux scripts build the frontend with Vite, start the Go backend on a fixed backend port, then serve web/dist on a fixed frontend port through a local static file server.
This local deployment no longer proxies /api; put an edge proxy such as Caddy in front of it when you need one public entrypoint.
They also build cmd/actrail-iod into data/bin/actrail-iod and export ACTRAIL_IOD_BIN for the backend so session launch does not depend on a separately installed helper in PATH.
Start:
scripts/tmux/start.shStatus:
scripts/tmux/status.shStop:
scripts/tmux/stop.shDefault tmux launcher bind targets:
- backend:
0.0.0.0:8743 - frontend:
0.0.0.0:18743
Useful tmux launcher overrides live in scripts/tmux/common.sh, including:
ACTRAIL_TMUX_SESSIONACTRAIL_BACKEND_HOSTACTRAIL_BACKEND_PORTACTRAIL_FRONTEND_HOSTACTRAIL_FRONTEND_PORTACTRAIL_FRONTEND_DIST_DIRACTRAIL_PYTHON_BINACTRAIL_START_TIMEOUT_SECONDS
Core runtime settings:
| Variable | Default | Effect |
|---|---|---|
ACTRAIL_PORT |
8080 |
Backend listen port. |
ACTRAIL_AUTH_USERNAME |
unset | Required username when password auth is enabled. |
ACTRAIL_AUTH_PASSWORD |
unset | When set, enables username/password auth and requires login to access protected HTTP and WebSocket routes. When unset, ActRail runs in local no-password mode. |
ACTRAIL_DATA_DIR |
./data |
Data directory created on startup. Relative paths are resolved from the backend process working directory, so the default becomes ./data under wherever you start the server. |
Other useful backend settings:
| Variable | Default | Effect |
|---|---|---|
ACTRAIL_HOST |
127.0.0.1 |
Backend listen host. |
ACTRAIL_AVAILABLE_BACKENDS |
pi,codex |
Backend choices exposed to the launch UI. |
ACTRAIL_AVAILABLE_PROVIDERS |
unset | Optional provider list exposed in launch defaults. |
ACTRAIL_AVAILABLE_MODELS |
unset | Optional model list exposed in launch defaults. |
ACTRAIL_DEFAULT_BACKEND |
pi |
Default backend in launch defaults. |
ACTRAIL_CODEX_DANGEROUS_BYPASS |
true |
Adds --dangerously-bypass-approvals-and-sandbox before app-server for Codex launches. Set to false to disable. |
ACTRAIL_WS_PATH |
/api/ws |
WebSocket endpoint advertised by bootstrap. |
ACTRAIL_IOD_BIN |
unset | Optional explicit path to the actrail-iod helper binary used for session launch. |
ACTRAIL_DATA_DIR currently guarantees directory creation only. The config also computes a SQLite path at <data-dir>/actrail.db, but the live app still uses the in-memory session registry. Do not treat the current runtime as durable session storage.