Git AI Agent is a local-first Git assistant with three interfaces:
- Web app (React + Vite)
- Local API backend (FastAPI)
- VS Code extension (Activity Bar chat)
It helps you run common Git workflows through natural language while still using your local Git installation and repositories.
Git AI Agent is designed for developers who want:
- A faster path for repetitive Git operations
- A guided chat interface for branch/sync workflows
- A visual commit graph without leaving their workspace
- Repository connection and status inspection
- Natural-language intent parsing for common Git tasks
- Guided
upload/syncflow (stage -> commit -> push) - Branch operations (create, switch, list)
- Remote sync operations (fetch, pull --rebase)
- History operations (merge, rebase, cherry-pick + abort flows)
- Commit graph API + frontend visualization
- VS Code sidebar chat powered by the same backend
User Interfaces
|- frontend/ (React web app)
|- vscode-extension/ (VS Code chat view)
|- gui_agent.py (legacy Tkinter UI)
Backend
|- backend/main.py (FastAPI app)
|- backend/api/routes.py (chat + repo + graph endpoints)
|- backend/core/ai_parser.py (heuristic NLP intent parser)
|- backend/core/git_engine.py (safe Git subprocess wrapper)
|- backend/core/state_manager.py (multi-step chat state)
.
|- backend/
| |- main.py
| |- requirements.txt
| |- api/routes.py
| |- core/
|- frontend/
| |- package.json
| |- src/
|- vscode-extension/
| |- package.json
| |- src/
|- gui_agent.py # legacy desktop UI
|- automation_engine.py # legacy engine
|- git_tools.py # legacy helpers
|- USER_MANUAL.md
- Python 3.10+
- Node.js 18+
- Git installed and available on
PATH - A local Git repository to operate on
- Start backend:
cd backend
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000 --reload- Start frontend in another terminal:
cd frontend
npm install
npm run dev- Open the Vite URL (usually
http://localhost:5173). - In the app, choose your repository path from
Repository & Status.
cd vscode-extension
npm install
npm run buildThen press F5 in VS Code to launch an Extension Development Host.
Extension settings:
gitAiAgent.backend.port(default:8000)gitAiAgent.backend.pythonPath(default:python)gitAiAgent.backend.autoStart(default:true)
Status and discovery:
status,what changed,checklist branches,show branchesfetchpull
Branching:
create branch <name>switch to <name>
Sync flow:
upload,sync,push,publish
History operations:
merge <branch>rebase onto <branch>abort rebasecherry-pick <commit-hash>abort cherry-pick
When you send an upload intent, backend flow is:
- Verify repository exists
- Verify
originremote exists (asks for URL if missing) git add .- Build commit message from staged diff
git commit -m "..."git push -u origin <current-branch>
If no changes are staged, it exits safely without pushing.
Base path: /api
POST /chat- parse intent and execute Git actionGET /status- repo metadata + categorized working tree statePOST /set_repo- set active repository pathGET /select_directory- open native folder chooserGET /graph- commit topology for visualization
Health:
GET /-> welcome message
Frontend:
VITE_API_URL(optional, defaults tohttp://localhost:8000/api)
Backend:
- CORS is open (
*) by default for local development.
backend/core/git_engine.py validates commands before execution:
- Requires command to start with
git - Allows only a defined list of Git subcommands
- Uses subprocess with
shell=False
This reduces command injection risk while keeping the tool local-first.
- Intent parser is regex-based and may misread ambiguous phrasing.
- Commit message generation is currently heuristic (placeholder text style).
- Pull/merge/rebase/cherry-pick require a clean working tree in many paths.
select_directorydepends on local GUI support (Tkinter dialog).- Legacy Tkinter pipeline remains in the repo but is not the main architecture.
Backend not reachable:
- Confirm backend is running on port
8000. - Check frontend
VITE_API_URL.
Not a git repository:
- Use
Repository & Statusto point to a valid local repo.
Push fails:
- Ensure remote
originexists and credentials are configured in Git.
Directory dialog fails:
- Use manual path input in the repository field.
Useful local commands:
# Backend
cd backend
uvicorn main:app --reload --port 8000
# Frontend
cd frontend
npm run dev
npm run build
# VS Code extension
cd vscode-extension
npm run build
npm run watch- Replace regex parser with pluggable LLM provider
- Better commit message generation from semantic diff analysis
- Add automated tests for parser and route flows
- Improve multi-remote workflows (
origin+upstream) - Add auth-aware PR workflows (GitHub/GitLab)