Skip to main content
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.
Authentication is required. Run alpic login or set ALPIC_API_KEY before using this command.

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

FlagDescription
--environment-idThe ID of the environment (optional — read from local config if omitted)
--keyThe environment variable key
--valueThe environment variable value
--secretMark as secret (default: true). Use --no-secret to store in plain text
--env-filePath to a .env file to import (mutually exclusive with --key/--value)
--non-interactiveDisable 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.