Configuration¶
gitai uses LiteLLM model names and supports Gemini, OpenAI, and Anthropic.
Interactive Setup¶
Run:
The setup flow prompts for a provider, securely asks for the API key, offers a searchable list of known chat models for that provider, validates the selected model and key, and saves the configuration if validation succeeds.
Provider-specific examples:
gitai setup --provider gemini
gitai setup --provider openai --model openai/gpt-5
gitai setup --provider anthropic
Use --skip-validation only when you need to save configuration while offline
or when a provider endpoint is temporarily unavailable.
Saved Config¶
The setup command writes ~/.gitai/config.json with owner-only permissions
where the operating system supports them.
{
"default_provider": "gemini",
"providers": {
"gemini": {
"api_key": "...",
"model": "gemini/gemini-2.5-flash"
}
}
}
Do not commit this file.
Environment Variables¶
Environment variables take precedence over saved config:
For Gemini, GOOGLE_API_KEY is also accepted. Use .env.example as a template
for local development, and keep real .env files untracked.