Docs/Environment Variables

Environment Variables

Complete reference of all environment variables

Environment Variables

Complete reference of all environment variables supported by Clotion.

Notion Integration

VariableRequiredDefaultDescription
NOTION_API_KEYYes-Notion integration token (starts with secret_)
NOTION_DATABASE_IDYes-32-character database ID
NOTION_STATUS_BACKLOGNoBacklogStatus name for backlog items
NOTION_STATUS_TODONoTodoStatus name that triggers task pickup
NOTION_STATUS_IN_PROGRESSNoIn ProgressStatus name while working
NOTION_STATUS_IN_REVIEWNoIn ReviewStatus name after PR creation
NOTION_STATUS_DONENoDoneStatus name for completion

Repository

VariableRequiredDefaultDescription
REPO_PATHYes-Absolute path to git repository
WORKTREES_DIRNo{REPO_PATH}/.worktreesDirectory for git worktrees
BASE_BRANCHNomainBranch to create PRs against

Polling

VariableRequiredDefaultDescription
POLL_INTERVALNo10Seconds between database polls
COMMENT_POLL_INTERVALNo30Seconds between comment polls for blocked tasks

Task Management

VariableRequiredDefaultDescription
MAX_CONCURRENT_TASKSNo5Maximum parallel tasks
BLOCKED_TIMEOUTNo3600Seconds before blocked task times out
TASK_TIMEOUTNo7200Maximum seconds for a single task

Claude Code

VariableRequiredDefaultDescription
CLAUDE_MODELNo(default)Model to use for Claude Code
CLAUDE_MAX_TOKENSNo(default)Max tokens per response

Database

VariableRequiredDefaultDescription
DATABASE_PATHNoclotion.dbPath to SQLite database

Logging

VariableRequiredDefaultDescription
LOG_LEVELNoINFOLogging level
LOG_FORMATNotextLog format (text or json)
LOG_FILENo-File to write logs (optional)

Example .env File

# Required
NOTION_API_KEY=secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NOTION_DATABASE_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
REPO_PATH=/Users/yourname/projects/myapp

# Optional - Notion Status Names
NOTION_STATUS_BACKLOG=Backlog
NOTION_STATUS_TODO=Todo
NOTION_STATUS_IN_PROGRESS=In Progress
NOTION_STATUS_IN_REVIEW=In Review
NOTION_STATUS_DONE=Done

# Optional - Polling
POLL_INTERVAL=10
COMMENT_POLL_INTERVAL=30

# Optional - Task Management
MAX_CONCURRENT_TASKS=3
BLOCKED_TIMEOUT=7200
TASK_TIMEOUT=14400

# Optional - Repository
BASE_BRANCH=main

# Optional - Logging
LOG_LEVEL=INFO

Environment Variable Priority

Variables are loaded in this order (later overrides earlier):

  1. System environment variables
  2. .env file in current directory
  3. .env file in ~/.config/clotion/
  4. Command-line arguments

Security Notes

  • Never commit .env files to version control
  • Use secrets management in production
  • Rotate API keys periodically
  • Keep your Notion integration token private

Differences from Claudear

If you're migrating from Claudear (Linear-based), note these changes:

ClaudearClotion
LINEAR_API_KEYNOTION_API_KEY
LINEAR_WEBHOOK_SECRETNot needed
LINEAR_TEAM_IDNOTION_DATABASE_ID
LINEAR_STATE_*NOTION_STATUS_*
NGROK_AUTHTOKENNot needed
WEBHOOK_PORTNot needed
WEBHOOK_HOSTNot needed

Clotion uses polling instead of webhooks, so ngrok and webhook configuration are not required.