forked from huseynovvusal/gitai
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Jonathan edited this page Feb 6, 2026
·
3 revisions
gitai is highly configurable to suit your workflow. You can configure it using CLI flags, environment variables, or configuration files.
The configuration loading order is (highest to lowest priority):
-
CLI Flags: Arguments passed directly to the command (e.g.,
--provider=gpt). -
Environment Variables: Variables starting with
GITAI_(e.g.,GITAI_AI_PROVIDER). -
Config Files:
gitai.yaml,gitai.json, etc., in supported directories. - Defaults: Built-in default values.
gitai searches for a config file named gitai (with any supported extension like .yaml, .json, .toml) in the following directories, in order:
/etc/gitai/$HOME/.config/gitai/$HOME/.gitai/- The root of your Git repository
- The current working directory
ai:
provider: "gpt" # gpt, anthropic, groq, deepseek, xai, gemini, ollama
api_key: "sk-..." # Optional if using env vars
model: "" # Optional: override default model
temperature: 0.7
max_tokens: 256
ollama:
path: "/usr/local/bin/ollama" # Required only for 'ollama' provider
suggest:
editor: "builtin" # builtin, system, or command (e.g. "code -w")
bullet_point: "-"
hint: "" # Provide a default hint
no-hint: false # Skip the hint prompt by default
atomic: false # Enable atomic commit suggestion by default
security:
keywords: # Add custom sensitive keywords to block
- "my_secret_token"
- "internal_auth"All configuration keys can be set via environment variables. The prefix is GITAI_, and dots . are replaced with underscores _.
| Config Key | Environment Variable | Description |
|---|---|---|
ai.provider |
GITAI_AI_PROVIDER |
The AI backend to use. |
ai.api_key |
GITAI_AI_API_KEY |
API key for the provider. |
ai.model |
GITAI_AI_MODEL |
Specific model to use (e.g. gpt-4o). |
ai.temperature |
GITAI_AI_TEMPERATURE |
Creativity of the AI (0.0 - 1.0). |
ai.max_tokens |
GITAI_AI_MAX_TOKENS |
Max length of generated message. |
ollama.path |
GITAI_OLLAMA_PATH |
Path to Ollama binary. |
suggest.editor |
GITAI_SUGGEST_EDITOR |
Editor for commit messages. |
suggest.bullet_point |
GITAI_SUGGEST_BULLET_POINT |
Bullet char for lists. |
suggest.hint |
GITAI_SUGGEST_HINT |
Default hint for message generation. |
suggest.no-hint |
GITAI_SUGGEST_NO-HINT |
Skip the hint prompt by default. |
suggest.atomic |
GITAI_SUGGEST_ATOMIC |
Enable atomic commits by default. |
security.keywords |
GITAI_SENSITIVE_KEYWORDS |
Comma-separated blocklist. |
Note: Provider-specific legacy environment variables are also supported for backward compatibility and ease of use:
OPENAI_API_KEYANTHROPIC_API_KEYGEMINI_API_KEYGROQ_API_KEYDEEPSEEK_API_KEYXAI_API_KEY