Overview
Environment variables allow you to:- Store API keys and secrets securely
- Configure runtime behavior without code changes
- Use different settings across environments
Setting Variables
Via CLI
Via Console
- Open the Crewship Console
- Navigate to your project
- Go to Settings → Environment Variables
- Click Add Variable
Common Variables
LLM API Keys
Tool API Keys
Custom Configuration
Accessing in Code
Variables are available as standard environment variables:CrewAI Integration
CrewAI automatically uses standard environment variables:Reserved Variables
Crewship sets these automatically. They’re read-only:
Use them for logging and debugging:
Security
Encryption
All environment variables are:- Encrypted at rest using AES-256
- Encrypted in transit via TLS
- Never logged in build or run output
- Access controlled by project permissions
Best Practices
Never commit secrets
Never commit secrets
Add
.env to .gitignore. Use crewship env set instead.Use specific keys
Use specific keys
Create API keys specific to Crewship. Easier to rotate and audit.
Fail fast
Fail fast
Don’t use fallback values for required secrets:
Document requirements
Document requirements
List required variables in your README:
Loading from .env
For local development, use a.env file:
.env
python-dotenv:
Variable Scope
Variables are scoped to projects, not deployments:Updating Variables
Changes take effect immediately for new runs:Environment Separation
Use separate projects for different environments:Related
CLI env Command
Full CLI reference
Configuration
Project configuration