Building an Open-Source Git Client with a Tool-Use AI Agent Loop (Electron + React + TS)
PrismGit - An Open-Source Git Client with AI Integration
Introduction
Developers interact with Git daily, but there's a gap between CLI-focused workflows and visually rich clients like SmartGit or GitKraken. I wanted more than just an AI commit message generator-I wanted an actual AI pair programmer that can assess repository status, run diffs, understand local context, and execute actions autonomously. This led to PrismGit, an open-source, cross-platform Git client built with Electron 32, React 18, Vite 5, TypeScript 5.6, and Zustand.
Technology Stack
PrismGit follows a strict process separation to maintain UI responsiveness:
- Electron Main Process (
electron/): Acts as the trusted environment, running a persistent file watcher and handling heavy Git operations through thesimple-gitlibrary wrapper. - Electron Renderer Process (
src/): A snappy React application styled with Tailwind (Ayu Dark/Light palettes) and powered by Vite for instant loading. Sincesimple-gitspawns OS child processes asynchronously via Promises, this fits perfectly into Electron's IPC model, ensuring the frontend never freezes-even during massive rebases.
AI Agent Tool-Use Loop
The standout feature of PrismGit v2.1+ is its multi-model AI assistant. It supports 12 LLM providers spanning local setups (Ollama, LM Studio for code privacy) to cloud models (Groq, Google Gemini, Anthropic, OpenAI).
Instead of a basic chatbot, PrismGit implements a Function Calling / Tool-Use loop:
- The user types a prompt (e.g., "Check what changed in my styling and commit it with a standard message").
- The LLM decides to trigger a tool (like
get_statusorget_diff). - The main process executes the corresponding
simple-gitcommand and returns raw data. - The LLM processes the output and triggers subsequent tools (stage, commit, push) until completion.
To conserve user token budgets on lengthy diffs, automatic context compression condenses older session messages while preserving critical repository metadata.
Key Features
Beyond AI, PrismGit brings desktop-grade power:
- Visual Interactive Rebase: A React-based drag-and-drop todo editor supporting pick, reword, edit, squash, fixup, and drop operations.
- 3-Pane Conflict Solver: Renders Base, Ours, and Theirs layouts, monitoring conflict files via status hooks to merge chunks gracefully.
- Advanced Ref Management: First-class UI support for Git Worktrees, Submodules, Reflogs, Stashes, and Git LFS.
Cross-Platform Build System
Building for multiple operating systems has traditionally been challenging due to native Node.js module compilation flags (node-gyp). PrismGit solves this by:
- Building everything inside decoupled Docker containers coordinated by a unified Makefile.
- Using Wine to generate Windows binaries smoothly within those containers.
This ensures deterministic, reproducible builds without pollution.
Licensing and Testing
PrismGit is fully open-source under the MIT License, offers 100% localization parity across 4 languages, and includes an extensive Vitest + Playwright testing pipeline. The project is available on GitHub.
Explore PrismGit on GitHub: https://github.com/Mirocow/prismgit
Comments
No comments yet. Start the discussion.