Gitopus is an open-source command-line tool that leverages Google's Gemini AI to help generate meaningful commit messages and streamline your Git workflow through an interactive interface.
- 🤖 AI-powered commit message generation using Google's Gemini
- 🎯 Interactive menu for choosing between AI-generated or manual commit messages
- 📝 Conventional commit format support with predefined prefixes
- ⚡ Post-commit actions (push, status, log) for streamlined workflow
- ✨ Smart validation for commit message length and format
- 🔄 Option to edit AI-generated messages before committing
To install gitopus, you need to have Node.js and npm (Node Package Manager) installed on your machine.
-
Install Node.js: If you haven't already, download and install Node.js from nodejs.org.
-
Install gitopus globally: Open your terminal or command prompt and run:
npm install -g gitopus
-
Get Your Gemini API Key:
- Visit Google AI Studio
- Sign in with your Google account
- Click on "Create API Key"
- Copy your new API key
-
First-Time Setup: When you first run Gitopus, it will automatically:
gt
You'll see:
No API key found. Please enter your Gemini API key. You can get an API key from: https://makersuite.google.com/app/apikey
-
Enter Your API Key:
- Paste your API key when prompted
- The key will be securely stored in
~/.gitopus/config.json
- You won't need to enter it again on this machine
-
Verify Setup:
- After entering your API key, you should see:
API key stored successfully!
- The tool will then proceed to the main menu
- Location: Your API key is stored in
~/.gitopus/config.json
- Update Key: To update your API key, either:
- Edit the config file directly
- Delete the config file and run Gitopus again
- Security: Keep your API key secure and never share it
Once gitopus is installed and configured, follow these steps:
-
Stage your changes in the Git repository:
git add .
-
Run the command:
gitopus
or
gitoct
or
gt
-
Choose your preferred method:
- Generate commit message: AI will analyze your changes and suggest commit messages
- Custom commit message: Manually create a commit with conventional prefixes
- Exit: Cancel the commit process
When using the AI generation feature:
- The tool analyzes your staged changes
- Presents 5 AI-generated commit message options
- Select your preferred message
- Optionally edit the selected message
- Confirm and create the commit
For manual commit creation:
- Select a conventional commit prefix (feat, fix, docs, etc.)
- Enter your commit message
- Review and confirm the complete commit message
After committing, choose from:
- Push changes to remote repository
- View git status
- View latest commit in log
- Exit the tool
Gitopus stores its configuration in ~/.gitopus/config.json
, including your API key. You can manually edit this file if needed.
- No staged changes: Ensure you've staged your changes with
git add
- API key issues:
- Make sure your API key is valid
- Check if the config file exists at
~/.gitopus/config.json
- Try deleting the config file and entering the key again
- Long commit messages: Messages are limited to 70 characters for best practices
We welcome contributions to Gitopus! Here's how you can help:
git clone https://github.com/devoctane/gitopus.git
cd gitopus
npm install
Create a new branch and make your changes:
git checkout -b feature-name
Ensure your changes work as expected and add tests if necessary.
- Push your changes to your fork
- Create a Pull Request with a clear description of your changes
- Wait for review and address any feedback
MIT License - see LICENSE file for details
Built with ❤️ by Team Octane
For more information, check out the Gitopus GitHub repository.