{
  "slug": "bk-job-environment-reads-a-job-s-environment-by-uuid-5ffda3e21132",
  "title": "bk job environment reads a job's environment by UUID",
  "tools": [
    "bk"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-23T00:30:59.000Z",
  "announced_at": "2026-10-23T00:30:59.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When inspecting or debugging a Buildkite repository build, run `bk job environment <job-uuid>` with the selected organization. Choose an output format; JSON and YAML return an `env` object, while text prints sorted, escaped `NAME=\"value\"` lines.",
    "examples": [
      "bk job environment <job-uuid> --json",
      "bk job environment <job-uuid> --json | jq -r '.env.CI'",
      "bk job environment <job-uuid> --text"
    ],
    "gotchas": [
      "Version: v3.66.0",
      "<job-uuid> (required): Job UUID whose environment variables to read.",
      "--json: Output as JSON; mutually exclusive with `--yaml` and `--text`.",
      "--yaml: Output as YAML; mutually exclusive with `--json` and `--text`.",
      "--text: Output text as sorted `NAME=\"value\"` lines with escaped values; mutually exclusive with `--json` and `--yaml`.",
      "--output, -o: Select `json`, `yaml`, or `text` output format.",
      "Prerequisite: Use a token with the `read_job_env` scope.",
      "Prerequisite: The command uses the selected organization; environment values may contain secrets and are not redacted.",
      "Uses the selected organization and existing authentication.",
      "Does not require pipeline or build identifiers.",
      "Reading requires the `read_job_env` token scope.",
      "Output may contain secrets."
    ]
  },
  "why_it_matters": "Read environment variables for a Buildkite job while inspecting or debugging its repository build.",
  "before": "Reading a job's environment required constructing an API request.",
  "sources": [
    "https://github.com/buildkite/cli/releases/tag/v3.66.0",
    "https://github.com/buildkite/cli/pull/1052",
    "https://github.com/buildkite/cli/blob/v3.66.0/cmd/job/environment.go",
    "https://github.com/buildkite/cli/blob/v3.66.0/pkg/output/flags.go"
  ],
  "rank": 0.99024,
  "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": "daily-20261026-04",
    "verdict_id": "daily-20261026-04:daily-20261026-04-4f8dfb4f956e1c74-0:gate",
    "evidence_hash": "c85b334bcc7ca90dc03298f90cb6aa6876e04c2d98e190e9da8fae4bf7c504d0"
  },
  "review": {
    "draft_hash": "d02fc4fb3e628a3113f06f09513904ed059be859c9ea2fc2702d449c8690809d",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-23T00:30:59.000Z",
    "decision": "daily-20261026-04:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.99 >= 0.9; 2 needed) and Jev gave 0.80 (>= 0.6 needed)."
  }
}
