The AI-Powered Git Commit Assistant
GitSmart is an open-source Command Line Interface (CLI) tool that leverages Artificial Intelligence (AI) to automate the creation of meaningful Git commit messages. By analyzing your changes, GitSmart generates concise and standardized commit messages—making it easier to track work and collaborate.
- Automated Commit Messages: Save time by generating precise commit messages automatically.
- Standardized Messages: Keep a clean, organized commit log for easier tracking and debugging.
- User-Friendly CLI: An interactive interface built for efficiency and ease of use.
- Accurate Summaries: Generate commit messages that reflect your changes, improving review quality.
- Adaptive AI Insights: Pick from OpenAI, Anthropic, or Llama to tailor AI assistance to your coding style.
- AI-Powered Commit Messages
- Track Changes
- Revert to Previous Versions
- Branch and Merge
- Collaborate Seamlessly
- MCP Server Integration - Real-time git operations via Server-Sent Events
GitSmart now includes a Model Context Protocol (MCP) server that provides real-time git operations through Server-Sent Events (SSE). This allows external tools and applications to interact with your git repository safely and efficiently.
-
Enable MCP server in your
config.ini:[MCP] enabled=true port=8765 host=127.0.0.1
-
Start GitSmart:
gitsmart
You'll see:
MCP Server started on http://127.0.0.1:8765 -
Available Tools:
stage_file- Stage files for commitunstage_file- Unstage filesgenerate_commit_and_commit- AI commit message generation and commit
Check server status:
curl http://127.0.0.1:8765/mcp/statusStage a file:
curl -X POST http://127.0.0.1:8765/mcp/call \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "stage_file",
"arguments": {"files": ["README.md"]}
}
}'Generate and commit:
curl -X POST http://127.0.0.1:8765/mcp/call \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "generate_commit_and_commit",
"arguments": {}
}
}'- Python Client: See
examples/mcp_client_example.py - Web Client: Open
examples/mcp_web_client.htmlin your browser - Full Documentation: See
MCP_SERVER.md
The MCP server enables seamless integration with IDEs, CI/CD pipelines, and custom development tools.
╭─────────────────────────────────── assets/no-bg.png [Staged] ────────────────────────────────────╮
│ │
│ 1 diff --git a/assets/no-bg.png b/assets/no-bg.png │
│ 2 new file mode 100644 │
│ 3 index 0000000..caa7508 │
│ 4 Binary files /dev/null and b/assets/no-bg.png differ │
│ │
╰───────────────────────────────────────────── +0, -0 ─────────────────────────────────────────────╯Step-by-Step Thinking:
1. **Observations**
* README updated: image link changed from `assets/comit.png` to `assets/no-bg.png`
* New file added: `assets/no-bg.png`
* Indicates a visual update (aesthetic/branding)
2. **Rationale**
* Icon: 💄 for UI improvement
* Theme: graphical asset update for branding/layoutGenerated Commit
💄 Update README Image Asset
**WHAT:** Replaced `comit.png` with `no-bg.png` in README.md
**WHY:** Refresh project’s visual identity by updating the overview image to one without a background, enhancing UI consistency.
**DETAILS:**
- **Affected Files:**
- `README.md` (image link updated)
- `assets/no-bg.png` (new asset)
- **Impact:** Modernizes the project’s front-facing visuals for a more engaging first impression.git clone https://github.com/clarkandrew/GitSmart.git
cd GitSmart
chmod +x setup.sh
./setup.sh
# Then:
gitsmart # or simply: cThis script will:
- Create a Python virtual environment
- Install all dependencies
- Generate a default
config.ini - Add
gitsmartandcaliases to your shell
Follow the prompts to finish setup.
-
Clone the repo
git clone https://github.com/clarkandrew/GitSmart.git cd GitSmart -
Create & activate a venv
python -m venv venv # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt pip install -e . -
Configure
cp example.config.ini config.ini
Edit
config.ini:[API] auth_token = YOUR_API_TOKEN api_url = https://api.yourservice.com/v1/chat/completions model = your-model-name max_tokens = 500 temperature = 0.7
-
Add aliases to your shell config (
.bashrc/.zshrc):alias gitsmart="python -m GitSmart.main" alias c="python -m GitSmart.main"
Reload:
source ~/.bashrc # or source ~/.zshrc
gitsmart # or: cFollow the prompts to generate and commit your changes.
-
NEW: MCP Server Integration
- Real-time git operations via Server-Sent Events
- Three core tools: stage, unstage, generate & commit
- HTTP API with full documentation
- Python and web client examples
-
Initial release
- AI-powered commit messages
- Interactive staging/unstaging
- CLI diff visualizations
- Beta with basic commit generation
- 1.2.0: Multi-AI provider support & customizable templates
- 1.3.0: GUI & enhanced diff highlighting
- 1.4.0: Advanced MCP tools & webhook support
Requirements:
- Packages in
requirements.txt(includingflask&flask-corsfor MCP) - Valid credentials in
config.ini - Internet for AI API calls
- Optional: MCP server configuration for external integrations
Best Practices:
- Secure
config.ini(add to.gitignore) - Use Git hooks for automation
- Keep dependencies updated
-
Fork the repo
-
Create a branch:
git checkout -b feature/awesome-feature
-
Commit & push:
git commit -m "Add awesome feature" git push origin feature/awesome-feature -
Open a PR for review
Follow PEP 8, write tests, and update docs. See LICENSE for MIT terms and Code of Conduct.
Before: Vague messages like “fix stuff” or “update files”.
After: AI-powered, clear, standardized commits—effortless tracking and collaboration.
- AI: Artificial Intelligence
- API: Application Programming Interface
- CLI: Command Line Interface
- Commit: A record of changes
- Diff: Changes between file versions
- Staging: Selecting changes for the next commit
- Unstaging: Removing changes from staging
Start transforming your Git workflow today with GitSmart. Enhance productivity, improve collaboration, and maintain a clean project history—effortlessly. Get Started Now


