An AI-powered Git assistant that helps you with Git commands using natural language
GitMate is a command-line tool that uses AI to help you with Git operations. Instead of remembering complex Git commands, you can simply describe what you want to do in plain English, and GitMate will generate and execute the appropriate Git commands for you.
- 🤖 AI-powered Git assistance - Describe your Git needs in natural language
- 🔍 Smart context awareness - Automatically detects your current Git repository state
- ⚡ Interactive execution - Review and confirm commands before running them
- 🛡️ Safe execution - Commands are validated and you can cancel before execution
- 🎯 Git-focused - Specialized for Git operations with intelligent context gathering
- Node.js 18 or higher
- Git installed on your system
- OpenAI API key (for AI functionality)
-
Install globally via npm
npm install -g gitmate-cli
-
Set up your OpenAI API key The first time you run
gmate
, you'll be prompted to enter your OpenAI API key. It will be saved securely in~/.config/gmate/config.json
.
That's it! You're ready to use GitMate.
Once installed, you can use the gmate
command (short for GitMate) followed by your request:
# Commit changes
gmate commit all my changes with message "fix user authentication bug"
# Create and switch to new branch
gmate create a new branch called feature/user-dashboard and switch to it
# Push changes
gmate push my changes to the remote repository
# Check what files are modified
gmate show me what files I've changed
# Reset changes
gmate discard all my uncommitted changes
-
Context Gathering: GitMate automatically detects your current Git repository state, including:
- Current branch
- Modified, staged, and untracked files
- Last commit information
- Remote repository details
-
AI Processing: Your request, combined with the Git context, is sent to OpenAI's API to generate appropriate Git commands
-
Command Review: The generated command is displayed for your review
-
Interactive Execution: You can choose to run the command, cancel, or modify it
The tool stores configuration in ~/.config/gmate/config.json
:
{
"OPENAI_API_KEY": "your-openai-api-key-here",
"USE_OPENAI_MOCK": false
}
For development or testing, you can enable mock responses by setting USE_OPENAI_MOCK
to true
in the config file. This will use predefined responses instead of calling the OpenAI API.
If you want to contribute to GitMate, you'll need to build from source:
- Node.js 18+
- npm or yarn
-
Clone and install
git clone https://github.com/walterjansma/gitmate.git cd gitmate npm install
-
Build the project
npm run build
-
Link for development
npm link
-
npm run build
- Compile TypeScript to JavaScript -
npm test
- Run tests with Vitest -
npm run dev
- Start development mode with hot reload
Whether it's a bug fix, new feature, or documentation improvement, we welcome all pull requests. Don't hesitate to reach out if you have any questions.
- [ ] Return a short explanation next to (each) command
- [x] Add integration tests to test the whole flow
- [ ] Add test execution to CI
- [ ] Agentic command execution (solving merge conflicts?)
- [ ] CI/CD workflow for new package releases
Made with ❤️ by @walterjansma and @janvandorth