Commit, push, branch, stash, undo and more β with AI-generated commit messages, PR descriptions, security scans, and a built-in Git reference.
Installation β’ Uninstall β’ Setup β’ Usage β’ Features β’ Docs β’ Contributing β’ License
Make sure you have these installed:
| Tool | Check | Install |
|---|---|---|
| Git | git --version |
git-scm.com |
| Node.js (>=16) | node -v |
nodejs.org |
| jq | jq --version |
brew install jq / sudo apt install jq |
| curl | curl --version |
Pre-installed on most systems |
npm install -g @suhailroushan/gitaipnpm add -g @suhailroushan/gitaiyarn global add @suhailroushan/gitaigit clone https://github.com/suhailroushan13/gitai.git
cd gitai
npm install -g .To remove GitAI from your system, use the same package manager you used to install:
# npm (default with nvm; binary often in ~/.nvm/versions/node/*/bin/)
npm uninstall -g @suhailroushan/gitai
# pnpm
pnpm remove -g @suhailroushan/gitai
# yarn
yarn global remove @suhailroushan/gitaiIf you're not sure which one is active, run which gitai β if the path contains nvm, use npm; if it contains pnpm, use pnpm. If you installed with more than one manager, run the matching uninstall for each.
If you installed from source with npm install -g ., run npm uninstall -g @suhailroushan/gitai from any directory.
gitai --helpYou should see:
gitai β AI-powered Git CLI
Usage: gitai [option]
Options:
--docs, -d, docs Show full Git reference (setup, SSH, commands)
--help, -h Show this help
With no options, starts the interactive menu.
GitAI uses DeepSeek AI to generate commit messages, PR descriptions, and more.
- Go to platform.deepseek.com
- Sign up or log in
- Navigate to API Keys and create a new key
- Copy the key (starts with
sk-)
For zsh (default on macOS):
echo 'export DEEPSEEK_API_KEY="sk-your-key-here"' >> ~/.zshrc
source ~/.zshrcFor bash:
echo 'export DEEPSEEK_API_KEY="sk-your-key-here"' >> ~/.bashrc
source ~/.bashrcVerify it's set:
echo $DEEPSEEK_API_KEYgit config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git config --global init.defaultBranch mainSSH keys let you push/pull without entering your password every time.
Generate a new Ed25519 key:
ssh-keygen -t ed25519 -C "your.email@example.com"- Press Enter to accept the default path (
~/.ssh/id_ed25519) - Optionally set a passphrase
Start the SSH agent and add your key:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519Copy the public key:
# macOS
pbcopy < ~/.ssh/id_ed25519.pub
# Linux
cat ~/.ssh/id_ed25519.pubAdd to GitHub:
- Go to GitHub β Settings β SSH and GPG keys
- Click New SSH key
- Paste your key, give it a title, and click Add SSH key
Test the connection:
ssh -T git@github.comYou should see: "Hi username! You've successfully authenticated..."
gitai| Command | Description |
|---|---|
gitai |
Launch interactive menu |
gitai --docs |
Show full Git reference & notes |
gitai docs |
Same as above |
gitai -d |
Same as above |
gitai --help |
Show help |
gitai -h |
Same as above |
# Create a project
mkdir my-project && cd my-project
git init
# Write some code...
# Launch gitai
gitai
# Choose option 1 β AI Commit & Push
# GitAI will:
# 1. Stage all changes (git add .)
# 2. Generate an AI commit message from your diff
# 3. Commit with the message
# 4. Push to origin| # | Command | Description |
|---|---|---|
| 1 | AI Commit & Push | Auto-generate a semantic commit message using AI and push |
| 2 | Manual Commit & Push | Write your own message, commit, and push |
| 3 | Stage All & Status | git add . + git status |
| 4 | Force Push | Overwrite remote (with confirmation) |
| # | Command | Description |
|---|---|---|
| 5 | Pull & Rebase | Fetch + replay your commits on top |
| 6 | Pull & Merge | Fetch + merge commit |
| 7 | List Branches | All local + remote branches |
| 8 | Create & Switch Branch | git checkout -b <name> |
| 9 | Switch Branch | git checkout <name> |
| 10 | Delete Branch | Local and/or remote (prevents deleting current branch) |
| # | Command | Description |
|---|---|---|
| 11 | Git Log | Pretty graph of recent 25 commits |
| 12 | Show Diff | Staged, unstaged, or vs last commit |
| 13 | Git Status | Full working tree status |
| 14 | List Tags | All tags (newest first) |
| 15 | Search Commits | Grep through commit messages |
| # | Command | Description |
|---|---|---|
| 16 | Stash Changes | Save work temporarily |
| 17 | Pop Stash | Restore stashed changes |
| 18 | List Stashes | See all stash entries |
| 19 | Undo Last Commit | Soft reset (keeps changes staged) |
| 20 | Discard All Changes | Hard reset to last commit (with confirmation) |
| # | Command | Description |
|---|---|---|
| 21 | AI Explain Last Commit | Plain-English summary of what changed |
| 22 | AI Suggest Branch Name | Generate a branch name from your diff |
| 23 | AI Generate PR Description | Full PR write-up from recent commits |
| 24 | AI Security Scan Diff | Spot hardcoded secrets, API keys, and vulnerabilities |
| # | Command | Description |
|---|---|---|
| 25 | Show Git Config | Name, email, editor, remotes |
| 26 | List Remotes | All remote URLs |
| 27 | Add Remote | Add a new remote |
| 28 | Refresh | Re-fetch and redraw screen |
| # | Command | Description |
|---|---|---|
| 29 | Git Docs | Full Git reference with examples (also via gitai --docs) |
GitAI ships with a comprehensive built-in Git reference. Access it anytime:
gitai --docsThe docs cover:
| Section | Topics |
|---|---|
| Install Git | macOS, Ubuntu/Debian, Windows |
| Global Config | user.name, user.email, init.defaultBranch, core.editor, aliases |
| SSH Key Setup | ssh-keygen, ssh-agent, adding key to GitHub, testing |
| First Repo | git init β first commit β add remote β push |
| Clone | HTTPS and SSH |
| Daily Workflow | status, diff, add, commit, push, pull, branches, undo, stash, log, remotes, tags |
| Config Options | pull.rebase, push.autoSetupRemote, fetch.prune, aliases |
| Conventional Commits | feat, fix, docs, style, refactor, test, chore |
gitai/
βββ bin/
β βββ gitai.sh # Main CLI script
βββ assets/
β βββ gitai-banner.jpg
β βββ gitai-demo.png
β βββ gitai-ai-commit.png
β βββ gitai-docs.png
β βββ gitai-security-scan.png
βββ package.json
βββ LICENSE
βββ README.md
Contributions are welcome!
# Fork and clone
git clone https://github.com/<your-username>/gitai.git
cd gitai
# Make it executable
chmod +x bin/gitai.sh
# Link it globally for testing
npm link
# Make your changes...
# Test locally
gitai
# Create a PRMIT β Made with β€οΈ by Suhail Roushan


