Adds environment variables to an Alpic environment. Runs interactively by default. Variables are marked as secret by default, meaning their values are masked when listed.
Usage
alpic environment-variable add
Prompts for a key, value, and secret preference interactively.
Extended Usage
Add a single variable non-interactively:
alpic environment-variable add --key DATABASE_URL --value postgres://localhost/db
Add a non-secret (visible) variable:
alpic environment-variable add --key PORT --value 3000 --no-secret
Import all variables from a .env file:
alpic environment-variable add --env-file .env
Import from a .env file into a specific environment:
alpic environment-variable add --env-file .env --environment-id <environmentId>
Options
| Flag | Description |
|---|
--environment-id | The ID of the environment (optional — read from local config if omitted) |
--key | The environment variable key |
--value | The environment variable value |
--secret | Mark as secret (default: true). Use --no-secret to store in plain text |
--env-file | Path to a .env file to import (mutually exclusive with --key/--value) |
--non-interactive | Disable interactive prompts. Requires --key and --value (or --env-file) |
When running from a directory linked to an Alpic project (via alpic deploy), --environment-id is optional — the
CLI reads it from the local .alpic config file.