Configuration

Flags take precedence over their corresponding environment variables.

FlagEnvironmentDefaultPurpose
--portPORT8080HTTP port
--hostHOST0.0.0.0Bind address
--tokenPI_UI_TOKEN.ui-token, then randomAPI bearer token
--dirPI_DIRcurrent directoryInitial agent workspace
--piPI_BINlocal development CLIpi executable
--pi-argsPI_ARGSemptyExtra pi --mode rpc arguments
--tunnel-binTUNNEL_BINcloudflaredTunnel executable
PERSISTENT_STOREsqlitepi session catalog: sqlite or jsonl
PI_CODING_AGENT_DIR~/.pi/agentpi-owned data directory
PI_UI_DB_PATH~/.pi/agent/oyster.sqliteOyster application database

Check startup configuration without serving HTTP:

1
PI_BIN=/absolute/path/to/pi node server/server.mjs --check-config

Keep the databases separate

PI_UI_DB_PATH stores Oyster-owned data such as settings, routines, and operation state. The pi session database is owned by the coding agent. The server refuses to start if both resolve to the same SQLite file.

Changing PERSISTENT_STORE selects a session backend; it does not migrate or delete either backend.

Mutable settings

PI_DIR or --dir establishes the startup workspace. A valid workspace later selected through the UI is stored in the application database and takes precedence on the next start. The default runner is persisted in the same way.

Browser presentation settings—such as thinking visibility and carousel position—remain device-local. Authentication values are never stored as general application settings.

Authentication

Authentication does not replace transport security. Remote clients must connect over HTTPS with valid TLS; see Security. Bind the Node server to loopback when a same-host TLS proxy or tunnel is the only entry point.

Authenticated requests accept one of:

1
2
3
Authorization: Bearer <token>
X-Auth-Token: <token>
Cookie: pi_ui_token=<token>

A token query parameter is accepted only for GET requests, primarily for EventSource and downloads. Never place tokens in mutating request URLs.