ReArch can be configured at runtime using environment variables. These take precedence over values in rearch.config.mjs.
Set environment variables in your shell, a .env file, or your deployment platform.
REARCH_API_KEY=sk_live_abc123
Load from a .env file:
rearch dev --env-file .env.local
| Variable | Default | Description |
|---|
REARCH_API_KEY | — | API key for authentication (required) |
REARCH_ENV | development | Environment: development, staging, production |
REARCH_LOG_LEVEL | info | Log level: debug, info, warn, error, silent |
REARCH_CONFIG_PATH | ./rearch.config.mjs | Path to configuration file |
| Variable | Default | Description |
|---|
PORT | 3000 | Server port |
HOST | localhost | Server host |
REARCH_MAX_WORKERS | CPU count | Maximum worker threads |
REARCH_TIMEOUT | 30000 | Default request timeout in ms |
| Variable | Default | Description |
|---|
REARCH_AGENT_CONCURRENCY | 5 | Max concurrent agent runs |
REARCH_AGENT_TIMEOUT | 60000 | Agent execution timeout in ms |
REARCH_AGENT_RETRIES | 3 | Number of retry attempts |
REARCH_AGENT_LOG_DIR | ./logs/agents | Directory for agent logs |
| Variable | Default | Description |
|---|
REARCH_PIPELINE_BATCH_SIZE | 100 | Items per pipeline batch |
REARCH_PIPELINE_PARALLELISM | 4 | Parallel pipeline workers |
REARCH_PIPELINE_DLQ_ENABLED | true | Enable dead letter queue |
| Variable | Default | Description |
|---|
GITHUB_TOKEN | — | GitHub personal access token |
REARCH_GITHUB_AUTO_SYNC | false | Auto-sync to GitHub |
REARCH_SLACK_WEBHOOK | — | Slack webhook URL for notifications |
REARCH_SLACK_CHANNEL | #rearch | Default Slack channel |
| Variable | Default | Description |
|---|
DATABASE_URL | — | Database connection string |
REARCH_DB_POOL_SIZE | 10 | Connection pool size |
REARCH_DB_SSL | false | Enable SSL for database connections |
| Variable | Default | Description |
|---|
REARCH_CORS_ORIGINS | * | Allowed CORS origins (comma-separated) |
REARCH_RATE_LIMIT | 60 | Requests per minute per client |
REARCH_ENCRYPTION_KEY | — | Key for encrypting sensitive data at rest |
When the same setting is defined in multiple places, ReArch uses the following precedence (highest to lowest):
- Command-line flags
- Environment variables
.env file values
rearch.config.mjs values
- Default values