Git-Pilot Documentation
Welcome to the official Git-Pilot documentation. Here you'll find everything you need to know to streamline your Git workflow with AI.
How It Works
Git-Pilot is a CLI tool that communicates with a secure backend API powered by Google's Gemini models. This architecture keeps your AI API keys safe and off your local machine. You always have the final say, with the ability to review, edit, or cancel any AI suggestion before it runs.
Installation
Make sure you have Node.js (v18+) and Git installed. Then, run the following command to install Git-Pilot globally from npm:
npm install -g @abhaydesu/git-pilot
Commands
git pilot commit
Analyzes your staged changes (git diff
) to generate a clear and descriptive commit message that follows the Conventional Commits specification. This is perfect for maintaining a clean history and auto-generating changelogs.
git pilot commit "your intent here"
Example:
git pilot commit "add user authentication"
git pilot run
Translates a plain English request into the precise Git command. Stop searching Stack Overflow and just ask the AI. The suggested command is always displayed for confirmation before execution.
git pilot run "your request in plain english"
Examples:
git pilot run "squash the last 3 commits into one"
------- Suggested Command -------
git rebase -i HEAD~3
---------------------------------
git pilot branch
Generates a clean, conventional branch name from a description of your work. This helps keep your repository organized and easy to navigate. Branch names are typically formatted as type/description
.
git pilot branch "a description of your new feature or fix"
Examples:
git pilot branch "add oauth login"
✔ Generating a conventional branch name...
--- Suggested Branch Name ---
feature/add-oauth-login
-----------------------------
✔ What would you like to do? Accept
✔ Switched to new branch "feature/add-oauth-login"
git pilot undo
The ultimate safety net. It analyzes your recent Git history (reflog
) to suggest the safest command to reverse your last significant action, whether it was a bad commit, a merge, or a rebase.
git pilot undo