DocsConfigurationEnvironment Variables
Back to Docs
Configuration

Environment Variables

Override any YeePilot configuration setting using environment variables

Last updated: February 27, 2026

Overview

Every YeePilot configuration option can be overridden using environment variables. This is useful for CI/CD pipelines, containerized deployments, temporary overrides, and keeping secrets out of config files.

Environment variables always take precedence over values in ~/.yeepilot/config.yaml.


Naming Convention

Environment variables follow a consistent pattern:

  1. Start with the YEEPILOT_ prefix.
  2. Convert the config key to UPPERCASE.
  3. Replace dots and nested keys with underscores.

Examples

Config KeyEnvironment Variable
ai.providerYEEPILOT_AI_PROVIDER
ai.modelYEEPILOT_AI_MODEL
ai.api_keyYEEPILOT_AI_API_KEY
ai.max_tokensYEEPILOT_AI_MAX_TOKENS
ai.token_modeYEEPILOT_AI_TOKEN_MODE
security.modeYEEPILOT_SECURITY_MODE
sandbox.enabledYEEPILOT_SANDBOX_ENABLED
sandbox.use_namespacesYEEPILOT_SANDBOX_USE_NAMESPACES
personality.languageYEEPILOT_PERSONALITY_LANGUAGE
tui.themeYEEPILOT_TUI_THEME
update.auto_checkYEEPILOT_UPDATE_AUTO_CHECK

Configuration Precedence

When the same setting is defined in multiple places, YeePilot resolves them in this order (highest priority first):

  1. Environment variables -- Always win.
  2. Config file (~/.yeepilot/config.yaml) -- Used if no env var is set.
  3. Built-in defaults -- Used if neither env var nor config file value exists.
bash
# This overrides whatever is in config.yaml
export YEEPILOT_AI_PROVIDER=anthropic
export YEEPILOT_AI_MODEL=claude-sonnet-4-20250514
 
yeepilot run

Common Environment Variables

AI Provider Settings

bash
# Select provider and model
export YEEPILOT_AI_PROVIDER=openai
export YEEPILOT_AI_MODEL=gpt-4o
 
# API key (preferred over config file for security)
export YEEPILOT_AI_API_KEY=sk-...
 
# Custom API endpoint (e.g., for local models)
export YEEPILOT_AI_BASE_URL=http://localhost:11434/v1
 
# Token management
export YEEPILOT_AI_MAX_TOKENS=8192
export YEEPILOT_AI_TOKEN_MODE=saver
 
# Agent and thinking
export YEEPILOT_AI_AGENT_MODE=true
export YEEPILOT_AI_THINK_MODE=medium
export YEEPILOT_AI_AUTONOMY_PROFILE=strict_review

Security Settings

bash
# Security posture
export YEEPILOT_SECURITY_MODE=strict
export YEEPILOT_SECURITY_REQUIRE_CONFIRMATION=true
 
# Audit log location
export YEEPILOT_SECURITY_AUDIT_LOG_PATH=/var/log/yeepilot/audit.log

Sandbox Settings

bash
# Disable namespaces (useful on macOS or restricted environments)
export YEEPILOT_SANDBOX_USE_NAMESPACES=false
 
# Adjust resource limits
export YEEPILOT_SANDBOX_MAX_CPU_SECONDS=600
export YEEPILOT_SANDBOX_MAX_MEMORY_MB=1024

Personality and Display

bash
# Language and tone
export YEEPILOT_PERSONALITY_LANGUAGE=de
export YEEPILOT_PERSONALITY_TONE=professional
export YEEPILOT_PERSONALITY_VERBOSITY=brief
 
# TUI theme
export YEEPILOT_TUI_THEME=dark

Direct API Key Variables

In addition to YEEPILOT_AI_API_KEY, YeePilot also recognizes the standard API key environment variables used by each provider:

VariableProvider
OPENAI_API_KEYOpenAI
ANTHROPIC_API_KEYAnthropic
OPENROUTER_API_KEYOpenRouter

These work without the YEEPILOT_ prefix and are checked automatically when no other API key is configured.

bash
# These are equivalent for OpenAI:
export YEEPILOT_AI_API_KEY=sk-abc123
# or
export OPENAI_API_KEY=sk-abc123

If both YEEPILOT_AI_API_KEY and a provider-specific variable are set, YEEPILOT_AI_API_KEY takes precedence.


Practical Examples

Temporary Provider Switch

Switch to a different provider for a single session without changing your config file:

bash
YEEPILOT_AI_PROVIDER=anthropic \
YEEPILOT_AI_MODEL=claude-sonnet-4-20250514 \
ANTHROPIC_API_KEY=sk-ant-... \
yeepilot run

Production Server Lockdown

Set strict security via environment for all users on a shared server:

bash
# Add to /etc/environment or /etc/profile.d/yeepilot.sh
export YEEPILOT_SECURITY_MODE=strict
export YEEPILOT_AI_AUTONOMY_PROFILE=strict_review
export YEEPILOT_SANDBOX_ENABLED=true
export YEEPILOT_SANDBOX_USE_NAMESPACES=true
export YEEPILOT_SANDBOX_NETWORK_ACCESS=false

CI/CD Pipeline

Use YeePilot in a non-interactive pipeline:

bash
export YEEPILOT_AI_PROVIDER=openai
export YEEPILOT_AI_MODEL=gpt-4o-mini
export OPENAI_API_KEY="${OPENAI_SECRET}"
export YEEPILOT_SECURITY_MODE=strict
export YEEPILOT_AI_AUTONOMY_PROFILE=high
 
yeepilot exec "check disk usage and report servers over 80%"

Cost-Conscious Configuration

Minimize token usage and API costs:

bash
export YEEPILOT_AI_TOKEN_MODE=saver
export YEEPILOT_AI_MAX_TOKENS=2048
export YEEPILOT_AI_CONVERSATION_MAX_HISTORY=5
export YEEPILOT_AI_OUTPUT_TRUNCATE_LENGTH=200

Shell Configuration

To make environment variables persist across sessions, add them to your shell profile:

Bash

bash
# Add to ~/.bashrc or ~/.bash_profile
export YEEPILOT_AI_PROVIDER=openai
export OPENAI_API_KEY=sk-...

Zsh

bash
# Add to ~/.zshrc
export YEEPILOT_AI_PROVIDER=openai
export OPENAI_API_KEY=sk-...

Fish

fish
# Add to ~/.config/fish/config.fish
set -gx YEEPILOT_AI_PROVIDER openai
set -gx OPENAI_API_KEY sk-...

After editing, reload your shell or run source ~/.bashrc (or the equivalent for your shell).


Dev Mode

The YEEPILOT_DEV_MODE variable is a special case. It only takes effect when used with a development build of YeePilot (compiled with the dev build tag). Production binaries ignore this variable entirely.

bash
# Only works with dev builds
export YEEPILOT_DEV_MODE=1

This is used by contributors during development and is not relevant for normal usage.


Verifying Your Configuration

To see which settings are active (including environment variable overrides), run:

bash
yeepilot status

This displays the current provider, model, security mode, and other active settings, showing where each value comes from.