gai
stores its configuration options in a config.toml
found in your Operating Systems' user configuration directory.
~/.config/gai/config.toml
If an existing config doesn't exist, gai will create one with default values on the first run.
Configure AI provider settings, prompts, and behavior rules.
provider - Select your AI provider
"Gemini", "OpenAI", "Claude", "Gai""Gai"-p, --provider <PROVIDER>providers - Provider-specific configuration
[ai.providers.Gemini]
model = "gemini-2.5-flash"
max_tokens = 5000
[ai.providers.OpenAI]
model = "gpt-5"
max_tokens = 5000
[ai.providers.Claude]
model = "claude-3-5-haiku"
max_tokens = 5000
system_prompt - Custom system prompt override
None (uses built-in prompt)"You are an expert at writing concise commit messages"commit_convention - Custom commit convention override
None (uses Conventional Commits v1)include_convention - Include commit convention in prompt
truehint - Additional hinting for LLMs
None-H, --hint <TEXT>"Focus on security-related changes"include_file_tree - Include repository file tree (.gitignore respected)
trueinclude_git_status - Include git status output
trueinclude_untracked - Include untracked files
truefiles_to_truncate - Files to truncate before sending
[]["Cargo.lock", "package-lock.json"]group_related_files - Group related files by type
trueno_file_splitting - Keep files in single commits
trueseparate_by_purpose - Separate commits by purpose
trueverbose_descriptions - Use verbose commit descriptions
trueexclude_extension_in_scope - Exclude file extensions in scope
truefeat(git) vs feat(git.rs)allow_empty_scope - Allow empty scope field
truefeat: messageallow_body - Allow commit message bodies
truemax_header_length - Maximum commit header length
52max_body_length - Maximum body line length
72Git-specific settings for gai.
only_staged - Only generate commits for staged changes
falsegai commit -s, --stagedstage_hunks - Apply changes as hunks
falsegai commit -H, --hunks-f, --files to override back to file stagingcapitalize_prefix - Capitalize commit type prefix
falseFeat: vs feat:include_scope - Include scope in commits
truefeat(api): vs feat:include_breaking - Mark breaking changes
truebreaking_symbol - Custom breaking change symbol
None (uses !)feat!: breaking changeauto_request - Send request on launch
falsegai tui --auto-request[ai]
provider = "Gai"
include_convention = false
include_file_tree = true
include_git_status = true
include_untracked = true
files_to_truncate = []
[ai.providers.OpenAI]
model = "gpt-5-nano"
max_tokens = 5000
[ai.providers.Gemini]
model = "gemini-2.5-flash-lite"
max_tokens = 5000
[ai.providers.Claude]
model = "claude-3-5-haiku"
max_tokens = 5000
[ai.providers.Gai]
model = "gemini-2.5-flash"
max_tokens = 5000
[ai.rules]
group_related_files = true
no_file_splitting = true
separate_by_purpose = true
verbose_descriptions = true
exclude_extension_in_scope = true
allow_empty_scope = true
max_header_length = 52
allow_body = false
max_body_length = 72
[gai]
only_staged = false
stage_hunks = false
[gai.commit_config]
capitalize_prefix = false
include_scope = true
include_breaking = true
[tui]
auto_request = false
These flags work with any command:
-c, --compact - Print with compact outputs (no pretty trees)-i, --interactive - Launch the TUI interface-p, --provider <PROVIDER> - Override the configured provider (options:
gemini, openai, claude, gai)-H, --hint <TEXT> - Provide additional hinting to guide the AIgai auth - Authenticate with the Gai provider
gai auth login # Login via GitHub OAuth
gai auth status # Check authentication status and request limits
gai auth logout # Clear stored authentication token
gai status - Display repository status
gai status # Show repository status
gai status -v # Show verbose status with prompt and diffs
gai commit - Generate and apply commits
gai commit # Interactive commit generation
gai commit -y # Skip confirmation, apply immediately
gai commit -s # Only generate for staged changes
gai commit -H # Stage changes as hunks
gai commit -f # Stage changes as files (override -H)
gai commit -c KEY=VALUE # Override config options for this commit
Configure API keys using environment variables or a .env file:
OPENAI_API_KEY=your_openai_key
ANTHROPIC_API_KEY=your_anthropic_key
GEMINI_API_KEY=your_gemini_key