Supported Variables
ANTHROPIC_API_KEY / CRAFT_ANTHROPIC_API_KEY
Provide an Anthropic API key without storing it locally. Both names are supported;CRAFT_ANTHROPIC_API_KEY takes precedence if both are set.
CRAFT_CLAUDE_OAUTH_TOKEN
Provide a Claude OAuth token (for Claude Pro/Max subscriptions) without storing it locally.ANTHROPIC_BASE_URL
Override the API endpoint URL. This is set automatically by Craft Agents when you configure a non-Anthropic provider (OpenRouter, Vercel AI Gateway, Ollama, or custom endpoint) via the UI.This variable is typically managed by Craft Agents based on your API Provider configuration. You only need to set it manually for automation or CI scenarios.
CRAFT_CONFIG_DIR
Override the default configuration directory. By default, Craft Agents stores configuration in~/.craft-agent/.
config.jsonpreferences.jsoncredentials.enc- Workspace configurations
CRAFT_LOCAL_MCP_ENABLED
Enable or disable local MCP server support (stdio subprocess servers).| Value | Behavior |
|---|---|
"true" | Enable local MCP servers (default when not set) |
| Any other value | Disable local MCP servers |
This variable requires the exact lowercase string
"true" to enable. Values like "True", "TRUE", "yes", or "1" will be treated as disabled.CRAFT_DEBUG
Enable debug logging for troubleshooting. When set, additional diagnostic information is written to the log file.Development Variables
These variables are primarily used for development and multi-instance scenarios.CRAFT_VITE_PORT
Override the Vite dev server port. Automatically set when running from numbered instance folders.CRAFT_APP_NAME
Override the application display name. Useful for distinguishing multiple instances.CRAFT_INSTANCE_NUMBER
Instance identifier for multi-instance support. When set, adds a badge to the dock icon.CRAFT_DEEPLINK_SCHEME
Custom deep link URL scheme. Default iscraftagents.
VITE_DEV_SERVER_URL
URL of the Vite development server. Used internally during development.Precedence
For API credentials, the lookup order is:CRAFT_ANTHROPIC_API_KEYorANTHROPIC_API_KEYenvironment variableCRAFT_CLAUDE_OAUTH_TOKENenvironment variable (for OAuth)- Stored credential in
~/.craft-agent/credentials.enc - Interactive prompt (if running interactively)
ANTHROPIC_BASE_URLenvironment variable- Connection base URL (configured in LLM connections)
- Default (
https://api.anthropic.com)
- LLM connection default model (if set)
- App-level model defaults (per provider)
- System default (Claude Sonnet)
CRAFT_CONFIG_DIRenvironment variable- Default
~/.craft-agent/