/APIs & SDKs/Setup and context/env

OptiTech CLI command: env

Manage a branch's OptiTech environment variables locally

The env command manages a branch's OptiTech environment variables locally. optitech link and optitech checkout pull env variables automatically by default.

Subcommands: pull

optitech env pull

Writes the branch's OptiTech environment variables to a local .env file.

optitech env pull [options]
OptionDescriptionTypeDefaultRequired
--fileTarget .env file to write. Defaults to an existing .env, otherwise .env.local. Only OptiTech variables are updated; other lines are preserved.stringNo
--branchBranch ID or namestringNo
--project-idProject IDstringNo

Write the linked branch's OptiTech variables into .env.local (or .env if present):

optitech env pull

Pull a specific branch into a specific file:

optitech env pull --branch preview --file .env.preview
Was this page helpful?

On this page

Copy neon init command