bk job environment reads a job's environment by UUID
Introduced 2026-10-23 · score 0.99
HOW TO USE IT
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.
bk job environment <job-uuid> --jsonbk job environment <job-uuid> --json | jq -r '.env.CI'bk job environment <job-uuid> --textWHY THIS HELPS
Read environment variables for a Buildkite job while inspecting or debugging its repository build.
BEFORE THIS CHANGE
Reading a job's environment required constructing an API request.
REQUIREMENTS AND LIMITATIONS
- 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.
FIRST-PARTY EVIDENCE
- 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
Check the installed version and the source before using it. Entry JSON