Configuration
DevHub uses two configuration files:
devhub.toml- Per-project configuration (in each project directory)~/.devhub/config.toml- Global configuration
Configuration Hierarchy
~/.devhub/config.toml (global defaults)
↓
project/devhub.toml (project-specific)
↓
.env files (environment variables)
↓
runtime environment (system env vars)
Environment Variable Loading
DevHub automatically loads .env files with the following priority (later sources override earlier):
- System environment variables
- Project root
.envfile - Project root
.env.localfile - Files listed in
env_filesin devhub.toml [environment]section in devhub.toml- Service-specific
env_file - Service
cwd/.envfile - Service
cwd/.env.localfile - Service
env = {}section
Variable Interpolation
Variables can reference other variables:
# .env file
DB_HOST=localhost
DB_PORT=5432
DATABASE_URL=postgres://${DB_HOST}:${DB_PORT}/mydb
View Resolved Environment
Use devhub env to see the final resolved environment:
# Show all services
devhub env my-project
# Show specific service
devhub env my-project -s api
# Export format for sourcing
devhub env my-project -s api -f export
Quick Links
- devhub.toml Reference - Project configuration
- Global Config - System-wide settings