gitopus
v2.0.9
Published
A command-line tool that simplifies your Git commit process by providing an interactive interface for selecting conventional commit prefixes with the help of AI.
Downloads
1,061
Maintainers
Readme
Gitopus v2.0.5 stable
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.
Features
- 🤖 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
Installation
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
Getting Started
Setting Up Your API Key
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
API Key Management
- 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
Usage
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
AI-Generated Commits
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
Manual Commits
For manual commit creation:
- Select a conventional commit prefix (feat, fix, docs, etc.)
- Enter your commit message
- Review and confirm the complete commit message
Post-Commit Actions
After committing, choose from:
- Push changes to remote repository
- View git status
- View latest commit in log
- Exit the tool
Configuration
Gitopus stores its configuration in ~/.gitopus/config.json
, including your API key. You can manually edit this file if needed.
Common Issues
- 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
Contributing
We welcome contributions to Gitopus! Here's how you can help:
1. Fork and Clone
git clone https://github.com/devoctane/gitopus.git
cd gitopus
2. Install Dependencies
npm install
3. Make Changes
Create a new branch and make your changes:
git checkout -b feature-name
4. Test
Ensure your changes work as expected and add tests if necessary.
5. Submit PR
- Push your changes to your fork
- Create a Pull Request with a clear description of your changes
- Wait for review and address any feedback
License
MIT License - see LICENSE file for details
Built with ❤️ by Team Octane
For more information, check out the Gitopus GitHub repository.