VOOZH about

URL: https://deepwiki.com/guanguans/ai-commit/7-configuration-reference

⇱ Configuration Reference | guanguans/ai-commit | DeepWiki


Loading...
Menu

Configuration Reference

This page is the top-level reference for all configuration options in ai-commit. It covers the complete set of keys accepted in config/ai-commit.php (the built-in defaults), as well as how those keys carry over into JSON user configuration files.


Configuration Sources and Load Order

Configuration Layers and Their Sources


Sources: config/ai-commit.php1-260 app/Commands/CommitCommand.php198-216


Top-Level Configuration Keys

The following table lists every top-level key present in the default configuration. All keys may be overridden in the global or local JSON files.

KeyTypeDefault ValueDescription
commit_optionsstring[]["--edit"]Extra flags appended to git commit
diff_optionsstring[][":!*-lock.json", ":!*.lock", ":!*.sum"]Extra flags appended to git diff --cached
http_optionsobject{verify: false, connect_timeout: 30, timeout: 120}Guzzle request options applied to all HTTP generators
diff_markstring"<diff>"Placeholder substituted with the actual diff in prompt templates
type_markstring"<type>"Placeholder substituted with the selected commit type
type_prompt_markstring"<type-prompt>"Placeholder substituted with the formatted type directive
type_promptstring"- Use commit type \%s`."`sprintf format string used to build the type directive
typesobjectSee Commit TypesMap of commit type keys to human-readable descriptions
no_editboolfalsePermanently enables --no-edit on every git commit call
no_verifyboolfalsePermanently enables --no-verify on every git commit call
promptstring"conventional"Name of the prompt template to use by default
generatorstring"openai_chat"Name of the generator driver to use by default
generatorsobjectSee Generator ConfigMap of generator name → generator config block
promptsobjectSee Prompt TemplatesMap of prompt name → prompt template string

Sources: config/ai-commit.php14-260


Config Key to Code Mapping

The diagram below maps each configuration key to the code location that reads it.

Config Keys Resolved at Runtime


Sources: app/Commands/CommitCommand.php132-253


Prompt Construction Pipeline

Understanding how the marks (diff_mark, type_mark, type_prompt_mark) interact is essential for writing custom prompt templates.

Prompt Assembly Flow in CommitCommand::promptFor()


Sources: app/Commands/CommitCommand.php236-253 config/ai-commit.php39-48


Generator Configuration Structure

Each entry under generators follows this shape. Fields differ slightly for API-based vs CLI-based generators.

API-based generator block (e.g. openai_chat):

generators.openai_chat:
 driver → string (maps to GeneratorManager driver name)
 http_options → object (per-generator Guzzle overrides)
 api_key → string (env: OPENAI_API_KEY)
 parameters → object (passed directly in the API request body)
 model → string
 max_tokens → int
 temperature → float
 top_p → float
 n → int
 stream → bool
 stop → null|string
 presence_penalty → int
 frequency_penalty → int

CLI-based generator block (e.g. bito_cli):

generators.bito_cli:
 driver → string (maps to GeneratorManager driver name)
 binary → string (env: BITO_CLI_BINARY, default: 'bito')
 prompt_filename → string (temp file name written before invocation)
 options → object (CLI flags passed to the binary)
 parameters → object (Symfony Process constructor arguments)
 cwd → null|string
 env → null|array
 input → null|string
 timeout → int

Sources: config/ai-commit.php79-218


Supported Generator Names

The generator key (top-level) and each entry's driver key must match one of these registered names.

Config key / driver nameBacked byAPI key env var
openaiOpenAI Completions APIOPENAI_API_KEY
openai_chatOpenAI Chat APIOPENAI_API_KEY
moonshotMoonshot APIMOONSHOT_API_KEY
ernie_botBaidu Ernie Bot APIERNIE_API_KEY, ERNIE_SECRET_KEY
ernie_bot_turboBaidu Ernie Bot Turbo APIERNIE_API_KEY, ERNIE_SECRET_KEY
bito_cliBito CLI binaryBITO_CLI_BINARY (binary path)
github_copilot_cliGitHub CLI (gh copilot)GITHUB_COPILOT_CLI_BINARY (binary path)
github_models_cliGitHub CLI (gh models)GITHUB_MODELS_CLI_BINARY, GITHUB_MODELS_CLI_MODEL

Sources: config/ai-commit.php78-219


Default commit_options and diff_options

commit_options

Appended verbatim to the git commit command. The default ["--edit"] opens the editor after generation (equivalent to the standard git behavior).

To disable the editor globally, set no_edit: true or change commit_options to [].

diff_options

Appended verbatim to git diff --cached. The defaults exclude lock files and checksum files from the diff sent to the AI:

Exclusion patternPurpose
:!*-lock.jsonExcludes npm/yarn lock files
:!*.lockExcludes Composer, Cargo, etc. lock files
:!*.sumExcludes Go module checksums

Sources: config/ai-commit.php15-25 app/Commands/CommitCommand.php218-221


Global HTTP Options

The top-level http_options block is passed to Guzzle for all API-based generators. Generator-specific http_options blocks are merged on top of this. The keys follow Guzzle request option names.

Option constantDefaultDescription
GuzzleHttp\RequestOptions::VERIFYfalseDisable SSL certificate verification
GuzzleHttp\RequestOptions::CONNECT_TIMEOUT30Seconds to wait for a connection
GuzzleHttp\RequestOptions::TIMEOUT120Total request timeout in seconds

Sources: config/ai-commit.php30-36


Child Pages

Detailed reference for each major configuration section is in the following sub-pages:

PageTopic
7.1 Configuration File Format and PrecedenceJSON format, file locations, three-layer merge
7.2 Commit Types Configurationtypes map, type_mark, type_prompt_mark, type_prompt
7.3 Prompt Templates Configurationprompts map, placeholder substitution, custom templates
7.4 Generator-Specific ConfigurationFull per-generator config key reference