Skip to content
Browse documentation

Guides

CLI

Sign in, link a project, inject secrets, export files, and check environment metadata.

Install and sign in

Install bulgur 1.4.0 or newer from npm in a supported macOS or Linux project. The CLI uses Bulgur Cloud at https://api.bulgur.dev by default.

login stores a token for later commands. init links the current directory to a Bulgur project and environment in bulgur.json. A process BULGUR_TOKEN or project .env token can also authenticate without a saved login.

bash
cd ~/projects/my-app
npx bulgur init
# after accepting the script setup
pnpm dev  # or: npm run dev, yarn dev, bun run dev

Daily commands

  • run injects merged Shared and selected-environment values into one process; --watch restarts it when values change.
  • pull writes values to a file. For dart-define, xcconfig, and properties client builds, a sensitive value is refused unless you explicitly pass --allow-sensitive.
  • push imports all parsed keys from its input file and overwrites existing names by default; --no-overwrite changes that behavior. Keep CLI credentials out of the input file.
  • diff compares effective names and sensitive flags; check verifies required names from .env.example, a JSON manifest, or static environment reads in source files. Neither reads values. Both require bulgur.json. diff is full/MCP token-only. check can use an explicit workload OIDC mode with published CLI 1.4.1 or newer and the deployed Bulgur Cloud workload-enabled metadata route; ordinary runtime-scoped API tokens cannot use metadata discovery. Hosted 1.4.1 OIDC check runs passed 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. Exit codes are 0 for no differences or when all required names are present, 1 for differences or missing names, and 2 for an error or incomplete source scan.
bash
pnpm dev  # when init wrapped the dev script
npx bulgur run -- node scripts/task.js
npx bulgur run -e production -- node server.js
npx bulgur run --watch -- node server.js
npx bulgur pull -e development --out .env.bulgur
npx bulgur push .env.import -e development
npx bulgur diff staging production --json
npx bulgur check -e production --example .env.example
npx bulgur check -e production --source --dir . --exclude NODE_ENV

If init already wrapped npm run dev with bulgur run, use an unwrapped child command for the --watch example so Bulgur does not run twice.

Token scope and resource bounds

A token's operation scope and resource bound both apply. Bind a token to one project, or to one environment within that project, when creating it in the dashboard. The token owner must remain a member of the organization.

ScopeIntended use
FullSecret operations within its resource bound; suitable for CLI run and pull. A bound full token cannot administer projects, members, integrations, or tokens.
MCPList and change allowed secret metadata or values through write operations; cannot reveal or pull values. Can run diff and check.
RuntimeRead merged values for a deployment; cannot write or use the project metadata discovery required by diff and token-authenticated check.

An environment-bound token can read inherited Shared values through its allowed concrete environment, but cannot target Shared directly. Use a project-bound token if direct Shared access is required.