Environment variables
All environment variables recognized by the blodemd CLI.
You can configure the blodemd CLI entirely through environment variables. This is the recommended approach for CI/CD pipelines where you cannot use interactive login.
The CLI also reads these variables when they are present in the environment:
Each configuration value follows a precedence chain. The CLI uses the first available source:
| Value | CLI flag | Environment variable | Fallback |
|---|---|---|---|
| API key | --api-key | BLODEMD_API_KEY | Stored credentials |
| API URL | --api-url | BLODEMD_API_URL | https://api.blode.md |
| Project | --project | BLODEMD_PROJECT | name in docs.json |
| Branch | --branch | BLODEMD_BRANCH | GITHUB_REF_NAME, then git rev-parse --abbrev-ref HEAD, then main |
| Commit message | --message | BLODEMD_COMMIT_MESSAGE | git log -1 --pretty=%s |
When you run blodemd login, the CLI stores your session locally. The file location depends on your operating system:
~/.config/blodemd/credentials.json
The CLI respects XDG_CONFIG_HOME if set. The full path is $XDG_CONFIG_HOME/blodemd/credentials.json.
The credentials file stores either an OAuth session (from blodemd login) or an API key (from blodemd login --token). The BLODEMD_API_KEY environment variable always takes precedence over stored credentials.
Do not commit the credentials file to version control. It is stored outside
your project directory by default, but make sure ~/.config/blodemd/ is not
inadvertently included in backups or shared environments.
Set BLODEMD_API_KEY as a repository secret and reference it in your workflow:
- run: npx --yes blodemd push
env:
BLODEMD_API_KEY: ${{ secrets.BLODEMD_API_KEY }}Export the variable in your shell to avoid passing --api-key every time:
export BLODEMD_API_KEY="bmd_your_key_here"
blodemd pushOr use blodemd login for interactive authentication, which stores credentials automatically.