Configuration
Acest conținut nu este încă disponibil în limba selectată.
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.
Provider defaults
Section titled “Provider defaults”Set the default provider and model:
export KHADIM_PROVIDER=anthropicexport KHADIM_MODEL=claude-sonnet-4Override either value for one run:
khadim --provider openai --model gpt-4.1-miniProvider credentials
Section titled “Provider credentials”Khadim reads provider API keys from standard environment variables.
| Provider | Environment variable |
|---|---|
| OpenAI | OPENAI_API_KEY |
| Anthropic | ANTHROPIC_API_KEY |
| Gemini | GEMINI_API_KEY |
| Groq | GROQ_API_KEY |
| xAI | XAI_API_KEY |
| OpenRouter | OPENROUTER_API_KEY |
| Mistral | MISTRAL_API_KEY |
| Copilot | GITHUB_TOKEN or GH_TOKEN |
| Codex | OPENAI_CODEX_API_KEY or OPENAI_API_KEY |
| Cerebras | CEREBRAS_API_KEY |
| HuggingFace | HF_TOKEN |
| NVIDIA | NVIDIA_API_KEY |
| Kimi | KIMI_API_KEY |
| MiniMax | MINIMAX_API_KEY |
| Z.AI | ZAI_API_KEY |
| OpenCode | OPENCODE_API_KEY |
KHADIM_API_KEY is a universal fallback for providers that can use a single
generic key.
OpenAI-compatible endpoints
Section titled “OpenAI-compatible endpoints”Point OpenAI-compatible providers at a custom base URL:
export OPENAI_BASE_URL=http://localhost:11434/v1export OPENAI_API_KEY=localkhadim --provider openaiInteractive settings
Section titled “Interactive settings”Open settings inside the terminal UI:
/settingsYou 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.
OAuth providers
Section titled “OAuth providers”Some providers use OAuth instead of API keys. Start login from the terminal UI:
/loginCopilot and Codex are the primary OAuth-backed providers.
Workspace instructions
Section titled “Workspace instructions”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.
Update checks
Section titled “Update checks”Disable the npm update prompt:
export KHADIM_NO_UPDATE_CHECK=1