The env command manages a branch's Neon environment variables locally. neon link and neon checkout pull env variables automatically by default.
Subcommands: pull
neon env pull
Writes the branch's Neon environment variables to a local .env file.
neon env pull works with or without a neon.ts configuration file. Without one, it writes the branch's core variables (DATABASE_URL, DATABASE_URL_UNPOOLED, NEON_BRANCH). With a neon.ts, it also writes credentials for each service you declare (Managed Better Auth, Data API, AI Gateway, Object Storage).
neon env pull [options]Write the linked branch's Neon variables into .env.local (or .env if present):
neon env pullPull a specific branch into a specific file:
neon env pull --branch preview --file .env.preview







