{
  "slug": "neon-env-pull-writes-branch-environment-variables-to-env-5c5c44422132",
  "title": "neon env pull writes branch environment variables to .env",
  "tools": [
    "neonctl"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-09T20:05:22.000Z",
  "announced_at": "2026-06-09T20:05:22.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "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.",
    "examples": [
      "neonctl env pull"
    ],
    "gotchas": [
      "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."
    ]
  },
  "why_it_matters": "Populate a repository's local environment file with variables from a Neon branch.",
  "sources": [
    "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"
  ],
  "rank": 0.92042,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-3598bbddc8d65a5c-2:gate",
    "evidence_hash": "0baffe0f8585a4e9aa94498ac8b243046097987047dd823e2452cccd79a4b31a"
  },
  "review": {
    "draft_hash": "266d81631ac522fa12645f0c3e4996c964e7b459d50d1cba6ff5ce5de8c5df77",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.92 >= 0.9; 2 needed) and Jev gave 0.77 (>= 0.6 needed)."
  }
}
