GitAI is a command-line tool that uses AI to generate concise git commit messages based on your code changes.
You can install GitAI globally using npm:
npm install -g @zackbraksa/gitai
- Node.js
- Git
- An OpenAI API key
To use GitAI, run the following command in your terminal:
Set your OpenAI API key as an environment variable:
export OPENAI_API_KEY=<your-api-key>
Stage your changes and generate a commit message:
# add files to be committed
git add .
# generate commit message
gitai generate
This will generate a commit message based on the changes you have made to your code.
-d, --debug
: Output extra debugging information, including the full git diff.-o, --offline
: Run in offline mode (doesn't make any requests to the AI service).
This tool relies on OpenAI's API. Please ensure you comply with OpenAI's use-case policies and be aware of any associated costs.