Documentation
Welcome to the official Git-Pilot documentation. Here you'll find everything you need to streamline your Git workflow with AI.
How It Works
Git-Pilot is a local-first CLI tool that connects directly to Google's Gemini API using your personal API key stored in your operating system's credential manager. Requests travel directly over TLS to Google without a hosted intermediary. You can review, edit, or cancel suggestions before they change your repository.
Installation
Make sure you have Node.js (v20+) and Git installed. Then, run the following command to install Git-Pilot globally from npm:
npm install -g @abhaydesu/git-pilotFirst-Run Setup
Stage the changes you want to commit, then run git pilot. If no key is configured, Git Pilot shows its data-sharing notice and starts setup. You can also start setup directly:
git pilot setupSetup shows which Gemini model will be used and what data is sent. The API key prompt is masked. Git Pilot validates the key and model with Google before saving the key to your OS credential manager. The default model is gemini-3.5-flash-lite; model access can vary by Google project. If Google reports that a model is unavailable, check model access for your key or change the model value in your Git Pilot config, then run setup again. Google currently restricts access to Gemini 2.5 models for many new projects. See the Gemini model catalog.
Commands
git pilot
Run git pilot with staged changes. It analyzes your staged diff to generate a clear and descriptive Conventional Commit message.
You can either provide your intent directly or let the AI figure it out by analyzing your diff.
Without an Intent:
If you omit the intent, the AI will analyze your staged changes on its own to generate the most appropriate message.
git pilotWith an Intent:
git pilot add your intent hereExample:
git pilot add user authenticationReview the suggested message, then choose to accept and commit, edit it, regenerate it, or abort. Pressing Enter defaults to abort. Add --dry-run to print a message without committing.
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