Skip to content

Configuration reference

Most configuration happens at runtime in the app (see the Configuration guide). This page documents the process-level settings that live in .env — every one has a built-in default, so the file is optional.

Copy .env.example to .env and uncomment only what you want to override.

Server

VariableDefaultDescription
PRECURSOR_HOST127.0.0.1Bind address. Keep it on loopback unless you front the app with your own auth.
PRECURSOR_PORT8000The URL you open. In --dev, the Vite UI runs here and the backend moves to PORT + 1. A busy port auto-bumps to the next free one.
PRECURSOR_LOG_LEVELinfouvicorn/app log level.
PRECURSOR_SHUTDOWN_GRACE_SECONDS3Seconds to wait for in-flight requests (e.g. SSE streams) before force-closing on Ctrl-C, so the port is released promptly.

CLI flags mirror several of these: --port, --api-port, --host, --strict-port (fail instead of bumping a busy port), --port 0 (any free port), --open (open the browser when ready), --dev, and --no-frontend.

Database

VariableDefaultDescription
PRECURSOR_DATABASE_URLsqlite+aiosqlite:///./precursor.dbAsync SQLAlchemy URL. Point at Postgres for production.
bash
# SQLite (default — no setup)
PRECURSOR_DATABASE_URL=sqlite+aiosqlite:///./precursor.db

# PostgreSQL (needs the `postgres` extra for asyncpg)
PRECURSOR_DATABASE_URL=postgresql+asyncpg://user:pass@localhost:5432/precursor

LLM provider

The provider and its credentials are configured at runtimeSettings → Model — not via the environment. The GitHub providers fall back to your gh auth login session when no token is saved. See Configuration → Connecting a model.

Backup

A periodic copy of the SQLite DB + attachment blobs into a plain folder (e.g. a OneDrive/Dropbox/iCloud-synced directory). Enable it, pick the target folder, and set snapshot retention at runtimeSettings → Backup. Only the scheduling knobs are env-level:

VariableDefaultDescription
PRECURSOR_BACKUP_INTERVAL_SECONDS86400Minimum time between successful backups.
PRECURSOR_BACKUP_POLL_SECONDS3600How often the ticker checks whether a backup is due.

Skills directory

The skills folder is resolved the way the Copilot CLI resolves its home: COPILOT_HOMEXDG_CONFIG_HOME/copilot~/.copilot, with a PRECURSOR_SKILLS_DIR override.

Runtime settings win

Runtime settings layer over env defaults: each setting resolves as "env / .env default, overridden by an AppSetting row if present, clamped to a sane range". Don't read os.environ directly — the app resolves settings through services/app_settings.py.

Released under the MIT License.