Environment variables
DevBoy supports environment variables as an alternative to OS keychain for credential storage. This enables seamless use in CI/CD pipelines, containerized environments, and cloud workspaces where keychain access may be unavailable.
Credential resolution order
When resolving credentials, DevBoy checks sources in this order:
- Environment variables (highest priority)
DEVBOY_{PROVIDER}_TOKEN(prefixed, explicit){PROVIDER}_TOKEN(unprefixed, fallback)
- OS Keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service)
This means environment variables always take priority over keychain values, allowing you to override credentials in CI/CD without modifying your local setup.
Supported environment variables
Provider tokens
Context-scoped tokens
For multi-context setups, you can set tokens per context:
Proxy server tokens
For upstream MCP server proxies:
Proxy server URLs
You can also define proxy URLs via environment variables (no config file needed):
When both URL and TOKEN are set, DevBoy automatically creates the proxy connection without any config file.
Key to environment variable mapping
DevBoy converts credential keys to environment variable names using these rules:
- Convert to UPPERCASE
- Replace
.,/, and-with_ - Add
DEVBOY_prefix (checked first) - Try without prefix (fallback)
Examples
CI/CD examples
GitHub Actions
GitLab CI
Docker
Docker Compose
Kubernetes
Claude Code / Claude Desktop
Add to ~/.claude/claude_desktop_config.json or project .claude/settings.json:
Note: Use
"command": "devboy"if installed globally vianpm install -g @devboy-tools/cli, or specify the full path like"/path/to/devboy"for local builds.
Full context configuration via environment variables
You can define entire contexts (including provider settings) purely through environment variables, without any config file. This is useful for CI/CD, Docker, and Kubernetes deployments.
Pattern
Supported fields
Examples
GitHub context:
GitLab context:
ClickUp context:
Jira context:
Multiple providers in one context:
Complete env-only setup
Run DevBoy MCP with contexts defined entirely via environment:
Or as a one-liner:
Context naming
Context names are converted from UPPERCASE_WITH_UNDERSCORES to lowercase-with-dashes:
PROD→prodMY_PROJECT→my-projectDEV_TEAM_ALPHA→dev-team-alpha
Context-scoped tokens (with config file)
When using contexts defined in config file, you can still set tokens per context via environment:
Resolution for prod context:
DEVBOY_CONTEXTS_PROD_GITHUB_TOKEN(found, used)(skipped)DEVBOY_GITHUB_TOKENKeychain(skipped)
Resolution for staging context (no context-specific var):
DEVBOY_CONTEXTS_STAGING_GITHUB_TOKEN(not found)DEVBOY_GITHUB_TOKEN(found, used)Keychain(skipped)
Sentry error reporting
DevBoy supports optional Sentry integration for error reporting. This requires the sentry feature flag at compile time (cargo build -p devboy-cli --features sentry).
Configuration
Config file
Environment variables take priority over config file values.
Usage
Privacy
- Sentry is disabled by default — no data is sent unless a DSN is configured
- Sensitive data (tokens, API keys, credentials) is automatically scrubbed from error reports
- Zero overhead when the
sentryfeature is not compiled in; minimal overhead when compiled but no DSN is configured (Sentry tracing layer is not installed without a valid DSN)
Remote configuration
DevBoy can fetch TOML configuration from a remote URL on startup and merge it with the local config. Remote values override local values.
Configuration
Note: In config.toml, remote_config.token_key is a keychain key name (e.g., "remote_config.token"), not the token itself. The env var DEVBOY_REMOTE_CONFIG_TOKEN provides the token value directly.
Config file
CLI setup
This generates a minimal .devboy.toml with only the [remote_config] section — git remote auto-detection is suppressed when --remote-config-url is set, since the remote endpoint is expected to supply integration settings. Pass --detect-git to override that and also pin a locally auto-detected GitHub/GitLab provider. See Project initialization for details.
Behavior
- Remote config is fetched on each
devboy mcpstartup - TOML response is merged with local config (remote wins)
- If fetch fails — warning printed, local config used unchanged
- Timeout: 10 seconds, max response size: 1 MB
- Environment variables take priority over config file values
Special environment variables
DEVBOY_SKIP_KEYCHAIN
Completely disable keychain access (useful for CI where keychain may hang):
When set to 1 or true:
- Disables OS keychain access completely
- Tokens are only read from environment variables
- Write operations go to in-memory storage (not persisted)
DEVBOY_NO_CONFIG
Skip loading the config file, use only environment variables:
When set to 1 or true:
- Config file (
config.toml) is not loaded - All providers and proxies must be defined via environment variables
- Useful for pure env-only deployments (Docker, Kubernetes, CI)
Alternatively, use the --no-config CLI flag:
Full env-only mode
For completely config-free operation, combine both:
Or as a one-liner:
Security best practices
- Never commit tokens to version control
- Use CI/CD secrets (GitHub Secrets, GitLab CI Variables, etc.)
- Prefer prefixed variables (
DEVBOY_*) to avoid conflicts with other tools - Scope variables to specific jobs/stages when possible
- Rotate tokens regularly
- Use short-lived tokens when available (e.g.,
CI_JOB_TOKENin GitLab)
Troubleshooting
Token not found
If DevBoy can't find your token:
Keychain vs environment variable priority
Environment variables always take priority. If you have a token in both keychain and env var, the env var value is used.
To force using keychain:
CI hangs on keychain access
Some CI environments have a keychain that hangs waiting for user input. Use:
This disables keychain completely and only uses environment variables.