Skip to content

Environment variables

gdc reads these environment variables. For the settings that also have a command-line flag, the flag takes priority; the environment variable takes priority over the configuration file.

gdc — model and data

Variable Equivalent flag Description
GDC_BASE_URL --base-url Model endpoint (OpenAI-compatible).
GDC_MODEL --model Model to request.
GDC_API_KEY --api-key API key for hosted endpoints. Kept out of help and error output.
GDC_CONFIG --config Path to a specific config file.
GDC_DB_PATH --db-path Session database location.
GDC_SESSION_ID --session-id Use a specific session id.
GDC_SERVE_BIND gdc serve --bind Address the server binds to.
GDC_SWARM_TLS_CA --swarm-tls-ca / --tls-ca Certificate authority bundle to pin for swarm connections.

gdc-tui — the terminal app

Variable Equivalent flag Description
GDC_TUI_BIND --bind Connect to a running server.
GDC_TUI_DB_PATH --db-path Session database (self-contained mode).
GDC_TUI_CONFIG --config Config file (self-contained mode).
GDC_TUI_PROFILE --profile Starting profile (self-contained mode).
GDC_TUI_CWD --cwd Project directory (self-contained mode).
GDC_TUI_LOG_DIR --log-dir Directory for a log file.

Behavior toggles

Variable Description
GDC_SHELL Shell to use for running commands, instead of the system default.
GDC_DISABLE_MOUSE Set to disable mouse capture in the terminal app.
RUST_LOG Logging verbosity (for example info or debug).

Standard system variables

gdc also respects the usual environment for locating your home and config directories:

Variable Description
HOME (or USERPROFILE on Windows) Your home directory — where ~/.gdc/ lives.
XDG_CONFIG_HOME Alternate config location (<here>/gdc/config.toml).
PATH Used to find programs the agent runs.

Example: configure via environment

export GDC_BASE_URL="http://localhost:11434/v1"
export GDC_MODEL="qwen2.5-coder:14b-instruct"
# export GDC_API_KEY="sk-..."   # only for hosted endpoints

gdc print "summarise this project"