Overview
Manage environment variables and secrets for your Qovery services. This command helps you import and parse environment variables.
Commands
Import Environment Variables
Import environment variables/secrets for a Qovery service:
Optionally pass a .env file path as an argument:
qovery env import ./my-vars.env
This command allows you to bulk import environment variables from a .env file into your Qovery application or container. It will interactively prompt you to select which variables to import, whether to import as environment variables or secrets, and whether to overwrite existing values.
Flags:
| Flag | Description |
|---|
--sort | Sort environment variables by key |
Parse Environment Variables
Parse environment variables and create a .env (dot env) file:
qovery env parse --heroku-json
This command parses environment variables from external sources and outputs them in .env format. Currently supports parsing Heroku config JSON from stdin.
Flags:
| Flag | Short | Description |
|---|
--heroku-json | -j | Parse environment variables from a Heroku JSON payload |
Examples
Import Variables from File
# Prepare your environment variables in a file
cat > vars.env <<EOF
API_KEY=your-api-key
DATABASE_URL=postgresql://localhost:5432/mydb
FEATURE_FLAG=enabled
EOF
# Import to Qovery service (interactive)
qovery env import vars.env
Import Variables Sorted by Key
qovery env import vars.env --sort
Parse Variables from Heroku
# Export config from Heroku and pipe to qovery env parse
heroku config -a <your_heroku_app_name> --json | qovery env parse --heroku-json
Development Workflow
# 1. Parse environment variables from Heroku and save to .env
heroku config -a my-app --json | qovery env parse --heroku-json > .env
# 2. Use .env file locally
cat .env
# 3. Run your application locally with same variables
npm run dev # or your local dev command
Managing Service-Specific Variables
For managing environment variables of specific services, use the service-specific commands:
# Application environment variables
qovery application env list
qovery application env create --key "API_KEY" --value "secret"
# Database environment variables
qovery database env list
# Container environment variables
qovery container env list
# Cronjob environment variables
qovery cronjob env list
# Lifecycle job environment variables
qovery lifecycle env list
Tips
Use qovery env import to migrate environment variables from another platform or bulk-update variables for your services.
Use qovery env parse --heroku-json to keep your local development environment in sync when migrating from Heroku.
Never commit .env files containing secrets to version control. Add .env to your .gitignore file.