neon env pull writes branch environment variables to .env
Introduced 2026-06-09 · score 0.92
HOW TO USE IT
When you need a local dotenv file populated with a Neon branch’s variables, run `neonctl env pull` from a directory with Neon context. It writes to `.env` if present, otherwise `.env.local`, and preserves other lines.
neonctl env pullWHY THIS HELPS
Populate a repository's local environment file with variables from a Neon branch.
REQUIREMENTS AND LIMITATIONS
- Version: v2.24.0
- --file <path>: Write to the specified dotenv file instead of the default selection.
- --branch <id|name>: Target another branch instead of the branch in the closest `.neon` file.
- Prerequisite: Authenticate with `neonctl auth` or supply an API key with `--api-key <neon_api_key>`; unauthenticated CLI commands launch browser authentication automatically.
- Prerequisite: A linked Neon project context is needed to resolve the branch; the branch comes from the closest `.neon` file unless `--branch` is supplied.
- The operation writes a branch's variables and preserves other lines in the file.
FIRST-PARTY EVIDENCE
- https://github.com/neondatabase/neonctl/releases/tag/v2.24.0
- https://github.com/neondatabase/neonctl/pull/518
- https://github.com/neondatabase/neonctl/blob/v2.24.0/README.md
Check the installed version and the source before using it. Entry JSON