Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment Variables

The config file is the recommended way to configure agsh. Environment variables are useful as overrides – for example, in CI pipelines, containers, or when you want to temporarily switch providers without editing your config.

Environment variables override config file values but are overridden by CLI flags.

agsh-Specific Variables

VariableDescriptionExample
AGSH_PROVIDERLLM provider nameopenai, anthropic
AGSH_MODELModel identifiergpt-4o, claude-sonnet-4-20250514
AGSH_PERMISSIONDefault permission modenone, read, write

Provider API Keys

VariableUsed When
OPENAI_API_KEYProvider is openai
ANTHROPIC_API_KEYProvider is anthropic

Provider Base URL

VariableDescription
OPENAI_BASE_URLCustom base URL for the OpenAI-compatible endpoint

Logging

agsh uses the tracing framework. The log level can be controlled with:

VariableDescriptionExample
RUST_LOGStandard Rust log filteragsh=debug, agsh=trace

If RUST_LOG is not set, the verbosity flag (-v, -vv, -vvv) controls the level:

FlagLevel
(none)warn
-vinfo
-vvdebug
-vvvtrace

Logs are written to stderr so they do not interfere with agent output.