Skip to Content
Octopus Energy Packages

Variables

How oe.env chooses which variables to sync

oe.env sync resolves values from your .env.schema, chooses the variable names to sync, and rejects names that are reserved for the tool itself.

Source environments

Every target has a source environment: development, preview, or production. For each source environment, oe.env resolves your schema with APP_ENV set to that value.

This lets schemas route secrets by environment:

.env.schema
# @type=enum(development, preview, production, test)
APP_ENV=development

API_KEY=op("op://Vault/Project ${APP_ENV}/API_KEY")

The test value is useful for local scripts, but it is not a sync target.

Reserved configuration variables

APP_ENV and every variable with the OE_ENV_ prefix are reserved for routing and configuration. They are never synced to Vercel, GitHub, or CircleCI.

Use this prefix for values that help choose sync destinations:

.env.schema
# @type=enum(oegb, oefr)
OE_ENV_TERRITORY=oegb

OE_ENV_VERCEL_PROJECT=project-${OE_ENV_TERRITORY}

Known service configuration variables are:

VariablePurpose
OE_ENV_VERCEL_PROJECTOverrides Vercel project resolution per source environment.
OE_ENV_GITHUB_ENVIRONMENTResolves a GitHub environment per source environment.
OE_ENV_CIRCLE_CI_API_TOKENAuthenticates with CircleCI.
OE_ENV_CIRCLE_CI_PROJECTSelects the CircleCI project slug.

Local overrides

Local overrides can configure OE_ENV_ routing and credentials for local sync runs. Local-only application values are not synced to target services.

Include and exclude variables

By default, oe.env sync syncs every non-reserved variable that resolves for the selected source environments.

Use --include to sync only specific names:

npm exec oe.env sync --include=API_KEY,SENTRY_AUTH_TOKEN

Use --exclude to omit names from the selected set:

npm exec oe.env sync --exclude=DEBUG_KEY,LOCAL_SECRET

When both flags are provided, --include selects the starting set and --exclude removes names from it.

Reserved names cannot be included or excluded. For example, --include=OE_ENV_TERRITORY fails because OE_ENV_TERRITORY is configuration, not a value to sync.

On this page