docs
v0.8.2

Environment Variables

All Codality configuration is stored in a .env file. The settings UI (Admin → Environment tab) lets you edit these values without touching the file directly.

Core settings

Variable Description Default Restart required
PORT Server listening port 8000 Yes
DATABASE_PATH Path to SQLite database file Yes
APP_URL Public URL of the application Yes
SESSION_SECRET Secret key for session cookies (64-char hex recommended) Yes
WORKTREE_BASE Base directory for git worktrees Yes

API keys (all required)

Variable Description Restart required
OPENAI_API_KEY Required. OpenAI API key for the AI agent Yes
SENDGRID_API_KEY Required. SendGrid API key for OTP login emails No
TAVILY_API_KEY Required. Tavily API key for web search and extraction tools No

Email

Variable Description Restart required
FROM_EMAIL Required. Sender email address for outgoing mail. Must be a verified sender in your SendGrid account. No

GitHub integration

These are set automatically by the GitHub App manifest flow. You rarely need to edit them manually.

Variable Description Restart required
GITHUB_APP_ID GitHub App ID No
GITHUB_APP_SLUG GitHub App slug (e.g., codality-dev-instance) No
GITHUB_CLIENT_ID GitHub App OAuth client ID No
GITHUB_CLIENT_SECRET GitHub App OAuth client secret No
GITHUB_WEBHOOK_SECRET Secret for verifying GitHub webhook signatures No
GITHUB_PRIVATE_KEY GitHub App private key (PEM-encoded, can be multiline) No
GITHUB_API_BASE_URL GitHub API base URL. Leave empty for github.com. Set for GitHub Enterprise. No
GITHUB_INSTALLATION_ID Default installation ID (set during app install callback) No

Editing in the UI

Go to Admin → Environment tab. Each variable shows its current value, description, and whether a restart is required after changing it.

Sensitive values (API keys, secrets) are masked by default. Click the field to reveal.

After saving changes that require a restart, click Restart Service to apply them.

Editing the file directly

The env file is at /etc/codality/codality.env (or ~/.config/codality/codality.env on macOS). Standard KEY=value format, one per line. Restart the service after editing:

bash
sudo systemctl restart codality

The file has mode 0600 and is owned by the codality system user. To edit manually:

bash
sudo nano /etc/codality/codality.env
sudo systemctl restart codality