Skip to main content
The Basecut CLI reads configuration from environment variables. This is useful for CI/CD pipelines, containerized environments, and avoiding command-line repetition.

Core Variables

BASECUT_API_KEY

Type: String (required for snapshot create and self-hosted agent) Format: bc_live_* or bc_test_* Your Basecut API key for authentication with Basecut services.
Where to get it:
  • User keys: basecut login then view in dashboard
  • Org keys: Dashboard → Organization Settings → API Keys

BASECUT_NO_BROWSER

Type: String (set to any value) Disable automatic browser opening during basecut login (useful for SSH or headless environments).

BASECUT_NO_UPDATE_NOTIFIER

Type: String (set to any value) Disable the CLI update notification check in interactive terminals.

BASECUT_DATABASE_URL

Type: String (PostgreSQL connection) Format: postgresql://user:password@host:port/database Default database connection string. Used when --source or --target flags are omitted.
Examples:

Cloud Storage Variables

AWS S3

AWS_ACCESS_KEY_ID

AWS access key for S3 bucket access.

AWS_SECRET_ACCESS_KEY

AWS secret key for S3 bucket access.

AWS_SESSION_TOKEN

AWS session token for temporary credentials (optional).

AWS_REGION

Default AWS region for S3 buckets. Used as a fallback when output.region is not set in basecut.yml (including self-hosted agent --async runs).
Alternative: Use AWS CLI profiles (~/.aws/credentials)

Google Cloud Storage

GOOGLE_APPLICATION_CREDENTIALS

Path to GCS service account JSON key file.
Alternative: Use gcloud auth application-default login

Agent Configuration

Agent settings are configured via CLI flags (not environment variables):
  • --agent-id (optional)
  • --poll-interval (default: 5s)
  • --heartbeat-interval (default: 1m)
  • --run-once (useful for testing)

Configuration Precedence

When a value can come from multiple sources, precedence is:
  1. CLI flags (highest priority)
  2. Environment variables
  3. Config file (basecut.yml)
  4. Defaults (lowest priority)
Example:

Security Best Practices

  • Never commit credentials (.env, API keys) to source control
  • Use a read-only database user for extraction — see Agent Deployment
  • Use your CI platform’s secret management for BASECUT_API_KEY and cloud storage credentials
  • Use IAM roles or Workload Identity instead of static credentials when possible

Troubleshooting

”BASECUT_API_KEY not set”

Solution:

“BASECUT_DATABASE_URL not set”

Solution:

“Invalid AWS credentials”

Solution:

Next Steps

CLI Reference

Command-line flag documentation

CI/CD Integration

Using environment variables in pipelines

Agent Deployment

Environment variables for production agents

Troubleshooting

Debug configuration issues