Skip to main content

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

  1. Open the Crewship Console
  2. Navigate to your project
  3. Go to SettingsEnvironment Variables
  4. 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

Add .env to .gitignore. Use crewship env set instead.
Create API keys specific to Crewship. Easier to rotate and audit.
Don’t use fallback values for required secrets:
List required variables in your README:

Loading from .env

For local development, use a .env file:
.env
Then load with python-dotenv:
The .env file is not used in Crewship deployments. Always set production variables via crewship env set.

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:

CLI env Command

Full CLI reference

Configuration

Project configuration