Gå til innholdet

Configuration

Dette innholdet er ikke tilgjengelig på ditt språk.

Khadim reads configuration from command-line options, environment variables, the interactive settings file, and workspace instruction files. Command-line options apply to one run. Settings and environment variables persist outside a single run.

Set the default provider and model:

Terminal window
export KHADIM_PROVIDER=anthropic
export KHADIM_MODEL=claude-sonnet-4

Override either value for one run:

Terminal window
khadim --provider openai --model gpt-4.1-mini

Khadim reads provider API keys from standard environment variables.

ProviderEnvironment variable
OpenAIOPENAI_API_KEY
AnthropicANTHROPIC_API_KEY
GeminiGEMINI_API_KEY
GroqGROQ_API_KEY
xAIXAI_API_KEY
OpenRouterOPENROUTER_API_KEY
MistralMISTRAL_API_KEY
CopilotGITHUB_TOKEN or GH_TOKEN
CodexOPENAI_CODEX_API_KEY or OPENAI_API_KEY
CerebrasCEREBRAS_API_KEY
HuggingFaceHF_TOKEN
NVIDIANVIDIA_API_KEY
KimiKIMI_API_KEY
MiniMaxMINIMAX_API_KEY
Z.AIZAI_API_KEY
OpenCodeOPENCODE_API_KEY

KHADIM_API_KEY is a universal fallback for providers that can use a single generic key.

Point OpenAI-compatible providers at a custom base URL:

Terminal window
export OPENAI_BASE_URL=http://localhost:11434/v1
export OPENAI_API_KEY=local
khadim --provider openai

Open settings inside the terminal UI:

/settings

You can also press F2. The settings panel can store provider, model, API key, theme, and related preferences.

Use /config to print the config directory path. The terminal settings file is stored under the Khadim config directory.

Some providers use OAuth instead of API keys. Start login from the terminal UI:

/login

Copilot and Codex are the primary OAuth-backed providers.

Khadim discovers AGENTS.md files in the workspace. Use them for durable local instructions:

# Agent instructions
- Run `cargo test` after Rust changes.
- Keep generated files out of manual edits.
- Ask before changing database migrations.

Nested AGENTS.md files apply to files under their directory scope.

Disable the npm update prompt:

Terminal window
export KHADIM_NO_UPDATE_CHECK=1