Automate your entire Git workflow with AI-generated commit messages and built-in security scanning.
One command to pull, stage, commit, scan, and push โ powered by Google Gemini & OpenAI.
Run git-auto in any project folder. The tool will:
| Step | Action |
|---|---|
| โ | Ask whether to pull โ press y / Enter for yes, n to skip |
| ๐ฅ | Pull latest changes from remote (if confirmed) |
| ๐ | Security scan โ checks working directory for secrets before staging |
| ๐ซ | Abort if secrets or sensitive files are detected โ saves a report |
| ๐ | Stage all modified files (only if scan passes) |
| ๐ง | Generate a commit message with Gemini AI (falls back to OpenAI) |
| ๐พ | Commit the changes |
| โ๏ธ | Push to GitHub / GitLab |
| ๐ | Print the direct commit URL (e.g. github.com/.../commit/abc123) |
| Command | Description |
|---|---|
git-auto |
Run the full workflow |
git-auto --config |
Set Gemini or OpenAI API keys interactively |
git-auto --custom-command |
Set a custom command alias (e.g. gitsync) |
git-auto --reset-command |
Reset alias back to git-auto |
git-auto --show-command |
Show the currently active command name |
git-auto --help |
Show the help screen |
git-auto --version |
Show version number |
- Node.js v18 or higher โ Download
- npm v7 or higher (comes with Node.js)
- A Git repository with a configured remote
npm install -g git-ai-pilotVerify the install:
git-auto --versionOn first run, the setup wizard will prompt for your Gemini and/or OpenAI API key.
git-auto automatically checks npm on every run and shows a banner when a newer version is available:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ Update available v1.2.2 โ v1.2.3 โ
โ Run: npm install -g git-ai-pilot โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Check your current version manually:
git-auto --version
# or
npm list -g git-ai-pilotUpdate to the latest release:
npm update -g git-ai-pilotTo install a specific version:
npm install -g git-ai-pilot@1.2.3Your API keys in
~/.git-ai-pilot/config.jsonare preserved across updates.
npm uninstall -g git-ai-pilotThis removes the git-auto command. To also delete your stored API keys:
# macOS / Linux
rm -rf ~/.git-ai-pilot
# Windows (PowerShell)
Remove-Item -Recurse -Force "$env:USERPROFILE\.git-ai-pilot"# 1. Install
npm install -g git-ai-pilot
# 2. Go to any project with uncommitted changes
cd your-project
# 3. Run
git-autoOn first run, the setup wizard will ask for your API key(s).
| Provider | Where to get it | Role |
|---|---|---|
| Google Gemini | aistudio.google.com/app/apikey | Primary |
| OpenAI | platform.openai.com/api-keys | Fallback |
Keys are stored locally in ~/.git-ai-pilot/config.json โ never in your project.
The scan runs before git add so secrets are caught before they ever enter git history.
Pull latest changes from remote? (y/n):
Press y or Enter to pull. Press n to skip.
Detects secrets in two ways:
1. Sensitive files by name โ flagged as CRITICAL the moment they appear in the diff:
| File | Label |
|---|---|
.env, .env.local, .env.production, .env.staging โฆ |
.env file / variant |
id_rsa, id_ed25519, id_ecdsa, id_dsa |
SSH private key |
*.pem |
PEM certificate/key |
credentials.json/yml, secrets.json/yml |
credentials / secrets file |
serviceAccountKey.json |
service account key |
*.keystore, *.jks, *.p12, *.pfx |
certificate keystore |
.netrc, .pgpass, .npmrc |
auth config file |
2. Inline patterns โ scanned on every added line:
| Pattern | Severity |
|---|---|
| AWS Access / Secret Key | CRITICAL |
| Google API Key | CRITICAL |
| OpenAI API Key | CRITICAL |
| GitHub Token | CRITICAL |
| Stripe Secret Key | CRITICAL |
| Private Key header | CRITICAL |
| Database URL with credentials | CRITICAL |
| ENV secret variables (unquoted) | HIGH |
| Slack Token, JWT Token | HIGH |
| Connection string passwords | HIGH |
| Hardcoded secrets in code | MEDIUM |
โโโ Security Scan Report โโโ
โ 2 secret(s) found:
Critical : 1
High : 1
[CRITICAL] Sensitive file committed (.env file)
.env
[HIGH] ENV Secret Variable
src/config.ts:8
โ OPENAI_API_KEY=sk-abc123...
Result: BLOCKED โ secrets detected
โ Aborted: secrets detected in working directory.
Report saved to: .security-reports/security-report-1234567890.json
Remove the secrets before running git-auto again.
Runs npm audit and reports severity counts alongside every scan:
โโโ Security Scan Report โโโ
โ No secrets detected
โ 3 npm vulnerabilities:
High : 1
Moderate : 2
โข lodash [high] โ fix available
Tip: Add
.security-reports/to your.gitignore.
git-ai-pilot/
โโโ apps/
โ โโโ cli/ # The npm package (git-ai-pilot)
โ โโโ src/
โ โ โโโ index.ts # Git workflow orchestration
โ โ โโโ ai-service.ts # Gemini โ OpenAI fallback
โ โ โโโ gemini.ts # Gemini integration
โ โ โโโ openai.ts # OpenAI integration
โ โ โโโ security.ts # Secret scanner & vulnerability audit
โ โ โโโ config.ts # Global API key management
โ โ โโโ update-check.ts # npm update notification
โ โโโ bin/
โ โ โโโ cli.js # CLI entry point
โ โโโ package.json
โโโ .github/
โ โโโ CODEOWNERS
โ โโโ workflows/
โโโ package.json # Monorepo root (Turborepo)
โโโ turbo.json
# Clone the repo
git clone https://github.com/mirzasaikatahmmed/git-ai-pilot.git
cd git-ai-pilot
# Install dependencies
npm install
# Build all packages
npm run build
# Watch mode (CLI)
cd apps/cli && npm run dev- Commit URL on push โ after every successful push the CLI prints the direct commit link (e.g.
https://github.com/user/repo/commit/abc123); works with both HTTPS and SSH remotes
- Auto update notifications โ on every run, the CLI silently checks npm for a newer version; if one exists a styled yellow banner is shown with the exact
npm install -g git-ai-pilotcommand to upgrade (times out in 3 s, never blocks the workflow)
- Windows fix โ
git-auto --custom-commandno longer fails withCommand failed: npm bin -g; switched tonpm prefix -g(the supported replacement) with correct path resolution on both Windows and Unix - Suppressed dotenv noise โ no more
[dotenv] injecting env (N)lines on startup across all commands
git-auto --configโ interactive menu to set Gemini or OpenAI API keys at any time; shows live configured/not-set status for each key
- Custom command alias โ
git-auto --custom-commandlets you set any name (e.g.gitsync); running that name triggers the full workflow - Reset alias โ
git-auto --reset-commandremoves the alias and restoresgit-autoas default - Show active command โ
git-auto --show-commandprints the currently active command - Beautiful
--helpscreen โ styled help with full workflow, security scan details, and live API key status - First-run API key prompt โ
git-autoasks for keys on first use if postinstall was skipped - Fixed postinstall in non-interactive environments โ
npm install -gno longer hangs; setup runs on firstgit-autocall instead - Emoji commit messages โ improved AI prompt with a full emoji guide (
โจ feat,๐ fix,๐ securityโฆ)
- Multi-language dependency audit โ auto-detects project type and runs the right audit tool
- ๐ข Node.js (
npm audit) ยท ๐ Python (pip-audit) ยท ๐ PHP (composer audit) - ๐น Go (
govulncheck) ยท ๐ Ruby (bundle-audit) ยท ๐ฆ Rust (cargo audit) - ๐ Flutter/Dart ยท โ Java ยท ๐ .NET (
dotnet list) ยท ๐ Swift
- ๐ข Node.js (
- Per-language results shown in the security report with install hints for missing tools
- Full terminal UI redesign โ header banner,
[1/5]step counters, bordered security report (โญโโฎ), success banner - Fixed false positives โ
.md,.txt,.rstfiles excluded from secret scanning
- Interactive pull prompt โ press
y/Enterto pull,nto skip - Security scan moved before
git addโ secrets never enter git history - Sensitive file detection by filename (
.env, SSH keys, PEM, keystores โฆ) - Unquoted ENV variable patterns (
API_KEY=valuewithout quotes) - Database URL credential detection (
postgres://user:pass@host) - Severity levels:
CRITICAL/HIGH/MEDIUMon every finding
- Fixed bin script name in package.json
--versionnow reads dynamically from package.json- Suppressed dotenv verbose output
- Added pre-push secret scanner โ blocks push on detected secrets
- Added npm vulnerability audit with severity breakdown
- Added
.security-reports/JSON report generation - AI fallback: Gemini โ OpenAI when primary fails
- Initial stable release with Gemini-powered commit messages
Pull requests are welcome! For major changes, please open an issue first.
- Fork the repository
- Create your branch:
git checkout -b feat/your-feature - Make changes and let
git-autocommit them ๐ - Push and open a PR
Please read CONTRIBUTING.md for full guidelines and CODE_OF_CONDUCT.md before participating. All contributors are listed in CONTRIBUTORS.md.
If Git AI Pilot saves you time, consider supporting the project:
Made with โค๏ธ by Mirza Saikat Ahmmed