Skip to content
Browse documentation

Guides

Check environment readiness

Compare secret names across environments and find names your application reads, without fetching values.

Compare two environments

Run diff from the application directory containing bulgur.json. It compares effective secret names and sensitive flags in two environments. Shared names are included, and a same-named value in the selected environment overrides Shared metadata.

The command reports names present only on one side and names whose sensitive flag changed. It does not compare secret values or where each value was defined.

bash
npx bulgur diff development production
npx bulgur diff staging production --json

Check a list of required names

check verifies that every required name exists in an environment's effective metadata. By default it reads .env.example in the current directory; use --example for another dotenv example file or --manifest for a JSON list. These inputs supply names only, so placeholder values and empty assignments are never compared with Bulgur values.

If --env is omitted, check uses the default environment in bulgur.json. The manifest, example, and source inputs are mutually exclusive.

bash
npx bulgur check -e production
npx bulgur check -e production --example config/.env.example
npx bulgur check -e production --manifest bulgur.requirements.json --json
json
{"required":["DATABASE_URL","PAYMENTS.API-KEY"]}

An .env.example can contain comments, export prefixes, quotes, and multiline placeholders. A manifest must contain one non-empty required array and no extra fields.

Find names used in source code

With bulgur 1.3.0 or newer, --source scans JavaScript, TypeScript, Python, and Go files for static environment reads. It reports each name and its file and line, then checks those names against the chosen Bulgur environment. --dir defaults to the current directory. Repeat --exclude for names provided by the runtime, such as NODE_ENV.

This is a bounded static scan. Computed names, whole-object reads such as destructuring process.env, and reads in JavaScript template expressions are reported as unsupported. An incomplete or unsupported scan exits with an error even if every static name is present. Use a manifest when the application needs an explicit authoritative list.

bash
npx bulgur check -e production --source --dir . --exclude NODE_ENV
npx bulgur check -e production --source --dir src --json

The scan skips Git-ignored paths, symlinks, hidden and build directories, dependency directories, and non-source files. It does not read local environment values or Bulgur secret values.

Check with a workload identity

With CLI 1.4.1 or newer and a Bulgur API that supports the new workload-enabled effective metadata route, check can authenticate with an explicit workload OIDC mode and identity UUID. It requires bulgur.json in the current directory to select the organization and project. The selected environment must match the identity's concrete policy boundary. The request reads metadata for that bound environment, including inherited Shared names; it does not read secret values.

CLI 1.4.0 does not include OIDC check. Version 1.4.1 is published and the matching Bulgur Cloud API rollout succeeded. Hosted OIDC check runs using the published 1.4.1 package passed against api.bulgur.dev with native GitHub Actions, CircleCI, Bitbucket Pipelines, and Buildkite tokens. AWS, Fly.io, Google Cloud, GitLab.com, and Azure hosted check runs have not yet been verified. Earlier 1.4.0 CircleCI, Bitbucket, and Buildkite Cloud tests covered run, pull, and SDK reads.

Supported CLI auth modes are github-oidc, aws-oidc, fly-oidc, gcp-oidc, gitlab-oidc, azure-oidc, circleci-oidc, bitbucket-oidc, and buildkite-oidc. Vercel OIDC is SDK-only. OIDC auth is explicit and never falls back to a saved or environment token. diff remains full/MCP token-only; ordinary runtime-scoped API tokens cannot use project metadata discovery.

bash
bulgur check --auth github-oidc --identity "$BULGUR_IDENTITY_ID" --env production --source --dir . --exclude NODE_ENV

Access and results

Both commands require bulgur.json in the current directory. diff requires a full or MCP API token. check accepts those tokens, or an explicitly selected workload identity with CLI 1.4.1+ and the matching API. Ordinary runtime-scoped API tokens remain unsupported for check; the supported workload OIDC session is the auth mode used for the bound metadata request. Output contains names and flags, never secret values.

Exit codeMeaning
0No diff, or all required names are present.
1A diff exists, or required names are missing.
2Arguments, input, access, metadata request, or source scan failed.