Overview
Environment variables let you configure your crew without changing code. Use them for:- API keys (OpenAI, Anthropic, etc.)
- External service credentials
- Configuration that varies between environments
Commands
Set Variables
Options
| Option | Description |
|---|---|
--project <name> | Target project (defaults to current directory) |
List Variables
Values are masked for security. Only the first and last few characters are shown.
Get a Variable
Remove Variables
Examples
Setting API keys
Configuration variables
Using in your crew
Variables are automatically available as environment variables:Loading from .env
Load variables from a.env file:
Variable Scope
Environment variables are scoped to a project, not a deployment. This means:- All deployments in a project share the same variables
- Updating a variable affects all future runs
- No redeploy is needed after changing variables
Encryption
All environment variables are:- Encrypted at rest using AES-256
- Transmitted over TLS
- Never logged or exposed in build output
Reserved Variables
These variables are set by Crewship and cannot be overridden:| Variable | Description |
|---|---|
CREWSHIP_RUN_ID | Current run ID |
CREWSHIP_DEPLOYMENT_ID | Current deployment ID |
CREWSHIP_PROJECT | Project name |
Best Practices
Use descriptive names
Use descriptive names
Name variables clearly:
OPENAI_API_KEY not KEY1Separate environments
Separate environments
Use different projects for staging and production
Rotate secrets regularly
Rotate secrets regularly
Update API keys periodically for security
Don't hardcode fallbacks
Don't hardcode fallbacks
Fail fast if a required variable is missing instead of using default values for secrets