VOOZH about

URL: https://deepwiki.com/guanguans/ai-commit/3-user-guide

⇱ User Guide | guanguans/ai-commit | DeepWiki


Loading...
Menu

User Guide

This page is the entry point for all user-facing documentation covering how to operate ai-commit on a day-to-day basis. It introduces the available commands and their relationships, and provides a high-level orientation before the detailed sub-pages.


Available Commands

ai-commit exposes four user-facing commands. Run ./ai-commit list to see them.

CommandDescription
commitGenerate a conventional commit message with AI and commit it
configRead and write configuration options
self-updateUpdate the PHAR binary to the latest release
completionDump shell completion script
thanksDisplay acknowledgements

The commit and config commands are the two commands users interact with regularly. They are covered in detail in child pages 3.1, 3.2, and 3.3.


Command Map

The following diagram shows how the two primary commands map to their implementing classes and the configuration/generator systems they depend on.

Command to Code Entity Map


Sources: app/Commands/CommitCommand.php32-298 config/ai-commit.php1-260


Typical Workflow

The standard usage pattern for ai-commit involves two phases: one-time configuration, then repeated use of the commit command.

Typical User Workflow


Sources: app/Commands/CommitCommand.php52-105


Supported Generators

The active generator is selected with --generator or by setting generator in configuration. The default is openai_chat.

Generator KeyTypeRequired Credential
openai_chatAPIgenerators.openai_chat.api_key
openaiAPIgenerators.openai.api_key
moonshotAPIgenerators.moonshot.api_key
ernie_botAPIgenerators.ernie_bot.api_key + secret_key
ernie_bot_turboAPIgenerators.ernie_bot_turbo.api_key + secret_key
bito_cliCLI binarygenerators.bito_cli.binary (default: bito)
github_copilot_cliCLI binarygenerators.github_copilot_cli.binary (default: gh)
github_models_cliCLI binarygenerators.github_models_cli.binary (default: gh)

For per-generator configuration details, see AI Generators Overview.

Sources: config/ai-commit.php78-219


Available Commit Types

When running commit, the user is prompted to select a commit type. The list is drawn from the types key in configuration.

KeyDescription
autoLet the AI decide the commit type automatically
featA new feature
fixA bug fix
docsDocumentation only changes
styleFormatting changes with no logic impact
refactorCode change that neither fixes a bug nor adds a feature
perfA performance improvement
testAdding or correcting tests
buildBuild system or dependency changes
ciCI configuration changes
choreOther changes not modifying src or test files
revertReverts a previous commit

Selecting auto causes CommitCommand::promptFor() to reset the <type> placeholder to the raw marker and clear the type prompt, leaving the AI to infer the type from the diff.

Sources: config/ai-commit.php50-63 app/Commands/CommitCommand.php236-254


Common Usage Examples

Set an API key globally (persists across repositories):


Set the default generator globally:


Generate and commit using a specific generator:


Generate a message without committing (preview only):


Skip the editor and git hooks:


Provide a custom config file for a single invocation:


View the full prompt sent to the AI (verbose mode):


Sources: app/Commands/CommitCommand.php132-190 README.md55-133


Sub-Pages

PageContent
3.1 Commit Command WorkflowStep-by-step description of the commit command: staging, type selection, generation, confirmation loop, and git execution
3.2 Command Options and FlagsFull reference for every CLI option accepted by commit and config
3.3 Configuration ManagementHow to use config set/get/unset/reset/list/edit, global vs local config, and custom config files
3.4 AI Generators OverviewSurvey of all supported generators and how to select and configure each one