Commitah is a Command Line Interface (CLI) tool that automates the process of generating Git commit messages using Generative AI powered by Gemini. This tool streamlines commit creation by analyzing git diff
and providing multiple commit message suggestions based on user-defined specifications.
- AI-Powered Commit Messages: Generates contextual commit messages based on staged changes.
- Customizable Configurations: Modify message specifications and Gemini API Key.
- Interactive UI: CLI prompts to choose from suggested messages.
- Error Handling: Ensures Git and required configurations are properly set up.
npm install --global commitah
Run the tool in a Git repository with staged changes:
commitah
ScreenRecording2024-12-11at19.06.28-ezgif.com-resize-video.mov
--config
: Show the current configuration.--config-update
: Update the Gemini API Key or message specification.--show
: Preview the selected commit message without committing.
commitah --show
Configuration is stored in ~/.commitahconfig
. When first run, the tool generates a default configuration. If the Gemini API Key is empty, the tool will open a browser for the user to generate the API Key and provide a prompt to paste it back into the CLI.
ScreenRecording2024-12-11at16.58.52-ezgif.com-resize-video.mp4
{
"geminiApiKey": "",
"messageSpec": "simple for each message, with Commit Conventions standard",
"sizeOption": 3
}
Use the following command to update configuration:
commitah --config-update
Commitah uses the following libraries:
- src/: Contains the source code.
- dist/: Compiled JavaScript files.
- config.js: Handles reading and writing configuration files.
- main.js: Entry point for the CLI.
To compile the TypeScript source files:
npm run build
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the ISC License.
Muhammad Utsman