- Inspired by git-aico
- The majority of the code was written using aider and cluade code
To install the tool using go install, run the following command:
go install github.com/komapotter/go-git-aico/cmd/git-aico@latestThis will install the git-aico executable in your $GOPATH/bin directory.
- Ensure you have staged changes in your git repository by running
git add. - Run the tool using
git aicoto generate commit message suggestions. - If you want verbose output, which includes the raw response from the AI model, run the tool with the
-vflag like this:git aico -v. - The tool will present you with a list of commit message suggestions based on the staged changes.
- Select the appropriate commit message by entering the number corresponding to the suggestion.
- The tool will automatically commit your staged changes with the selected commit message.
To use this tool, you need to set the following environment variables:
MODEL_PROVIDER: The AI provider to use: "openai" or "anthropic" (default: openai)NUM_CANDIDATES: The number of commit message candidates to generate (default: 3)
OPENAI_API_KEY: Your OpenAI API key (required when using OpenAI)OPENAI_MODEL: The OpenAI model to use (default: gpt-4o)OPENAI_TEMPERATURE: The OpenAI temperature parameter (default: 0.1)OPENAI_MAX_TOKENS: The maximum number of tokens for OpenAI (default: 450)
ANTHROPIC_API_KEY: Your Anthropic API key (required when using Anthropic)ANTHROPIC_MODEL: The Anthropic model to use (default: claude-3-haiku-20240307)ANTHROPIC_TEMPERATURE: The Anthropic temperature parameter (default: 0.1)ANTHROPIC_MAX_TOKENS: The maximum number of tokens for Anthropic (default: 450)
Example of setting environment variables for OpenAI:
export MODEL_PROVIDER="openai"
export OPENAI_API_KEY="your_openai_api_key"
export NUM_CANDIDATES=3
export OPENAI_MODEL="gpt-4o"
export OPENAI_TEMPERATURE=0.1
export OPENAI_MAX_TOKENS=450Example of setting environment variables for Anthropic:
export MODEL_PROVIDER="anthropic"
export ANTHROPIC_API_KEY="your_anthropic_api_key"
export NUM_CANDIDATES=3
export ANTHROPIC_MODEL="claude-3-haiku-20240307"
export ANTHROPIC_TEMPERATURE=0.1
export ANTHROPIC_MAX_TOKENS=450