Environment Variables Reference

## API Keys

All API keys are read from environment variables for security. Never put API keys in config files.

VariableProviderDescription
OPENROUTER_API_KEYOpenRouterOpenRouter API key (openrouter.ai)
OPENAI_API_KEYOpenAIOpenAI API key (platform.openai.com)
ANTHROPIC_API_KEYAnthropicAnthropic API key (console.anthropic.com)
DEEPSEEK_API_KEYDeepSeekDeepSeek API key (platform.deepseek.com)
GOOGLE_APPLICATION_CREDENTIALSGooglePath to Google Cloud credentials JSON file
AWS_ACCESS_KEY_IDAmazonAWS access key for Bedrock
AWS_SECRET_ACCESS_KEYAmazonAWS secret key for Bedrock
AWS_REGIONAmazonAWS region for Bedrock
CLOUDFLARE_API_TOKENCloudflareCloudflare Workers AI token

Octomind also loads .env files from the current directory via dotenvy. Variables in .env override system environment variables.

Octomind Configuration

VariableDescription
OCTOMIND_CONFIG_PATHOverride config directory path (default: ~/.local/share/octomind/config/)
OCTOMIND_SKILLSComma-delimited skill names to preload at session start (e.g., programming-rust,git-workflow). Skills are activated permanently without evaluating declarative rules.
OCTOMIND_CAPABILITIESComma-delimited capability names to force-enable at session start (e.g., cron,docker). Bypasses the auto-activation embedding pipeline; capabilities are loaded deterministically regardless of intent matching. Already-active entries are no-ops.
OCTOMIND_SHARE_URLBase URL of the web viewer used by /share (upload endpoint) and /analyze (viewer link). Defaults to https://octomind.run. Override only when pointing at a self-hosted instance or a local dev server.

Installation Script

Variables used by install.sh for automated/CI environments.

VariableDescription
GITHUB_TOKENGitHub API token to avoid rate limits during installation
GH_TOKENAlternative token variable (GitHub CLI convention)
OCTOMIND_INSTALL_DIROverride installation directory (default: ~/.local/bin/)
OCTOMIND_VERSIONInstall a specific version instead of latest

OpenRouter-Specific

VariableDefaultDescription
OPENROUTER_APP_TITLE"Octomind"Application title sent to OpenRouter
OPENROUTER_HTTP_REFERER"https://octomind.run"HTTP referer sent to OpenRouter

Template Variables

Available in system and welcome config fields. Use octomind vars to see current values.

VariableDescription
{{CWD}}Current working directory path
{{ROLE}}Active role name
{{DATE}}Current date
{{SHELL}}User's shell (e.g., bash, zsh)
{{OS}}Operating system name
{{BINARIES}}Available binary tools on PATH
{{GIT_STATUS}}Git repository status (branch, changes)
{{README}}Contents of README.md in project root
{{CONTEXT}}Session context (for layer system prompts)
{{SYSTEM}}Parent system prompt (for layer system prompts)

Webhook Hook Environment Variables

Available to hook scripts when processing incoming webhooks.

VariableDescription
HOOK_NAMEName of the hook that triggered
HOOK_METHODHTTP method (GET, POST, etc.)
HOOK_PATHRequest path
HOOK_QUERYQuery string
HOOK_CONTENT_TYPEContent-Type header value
HOOK_SESSIONSession name the hook is attached to
HOOK_HEADER_*Each HTTP header as HOOK_HEADER_<NAME> (uppercased, hyphens to underscores)

.env File Support

Octomind automatically loads .env files from the working directory. This is useful for project-specific API keys:

# .env
OPENROUTER_API_KEY=sk-or-v1-...
ANTHROPIC_API_KEY=sk-ant-...

The EnvTracker system tracks whether each variable came from the system environment or .env file, which can be seen in debug mode.