@suhailroushan/gitai
v1.0.6
Published
AI-powered Git CLI — commit, push, branch, and more with DeepSeek AI
Maintainers
Readme
gitai
AI-Powered Git CLI
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
📦 Installation
Prerequisites
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 |
Install with npm
npm install -g @suhailroushan/gitaiInstall with pnpm
pnpm add -g @suhailroushan/gitaiInstall with yarn
yarn global add @suhailroushan/gitaiInstall from source
git clone https://github.com/suhailroushan13/gitai.git
cd gitai
npm install -g .Uninstall
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.
Verify installation
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.🔧 Setup
1. Get a DeepSeek API Key
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-)
2. Add the API Key to your shell
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_KEY3. Configure Git (if not already done)
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global init.defaultBranch main4. Set up SSH Keys (recommended)
SSH keys let you push/pull without entering your password every time.
Generate a new Ed25519 key:
ssh-keygen -t ed25519 -C "[email protected]"- 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 [email protected]You should see: "Hi username! You've successfully authenticated..."
🚀 Usage
Start the interactive menu
gitaiQuick commands
| 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 |
First commit workflow
# 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✨ Features
29 commands organized into 7 categories:
🚀 Commit & Push
| # | 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) |
🔄 Sync & Branches
| # | 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) |
📜 History & Diff
| # | 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 |
📦 Stash & Undo
| # | 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) |
🤖 AI Tools
| # | 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 |
⚙️ Config
| # | 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 |
📖 Docs
| # | Command | Description |
|---|---------|-------------|
| 29 | Git Docs | Full Git reference with examples (also via gitai --docs) |
📖 Built-in 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 |
🖥️ Screenshots
AI Commit & Push
AI Security Scan
Built-in Docs
🗂️ Project Structure
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🤝 Contributing
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 PR📝 License
MIT — Made with ❤️ by Suhail Roushan
Star this repo if you find it useful!
