Auto-fix GitLab bugs with AI agents โ bring your own CLI or free API.
Project description
๐ FixFleet
Auto-fix GitLab bugs with AI agents โ bring your own CLI or free API.
Reads open Bug issues from GitLab โ parses stack traces and steps โ pre-narrows the search to relevant files โ dispatches to your AI agent of choice โ scores the fix's confidence. All locally. No commits. No lock-in.
One command. Any AI. Zero waste.
Claude Code ยท Codex ยท Gemini CLI ยท Cursor Agent ยท Aider ยท Qwen Code ยท Groq ยท Gemini API ยท OpenRouter ยท Cerebras ยท Ollama ยท LM Studio
๐ฏ What this tool does in one sentence: Pulls open bug tickets from GitLab, hands each one to an AI coding agent with the right context already pre-loaded, and scores how confident the fix is โ so you only review the ones worth reviewing.
Built by Yash Koladiya.
โจ What it does
- Fetches open issues with the
Buglabel from any GitLab project (gitlab.com or self-hosted). - Parses each issue body โ pulling out Description, Steps to Reproduce, Expected/Actual behavior, Logs, Stack Traces automatically.
- Pre-narrows the search space: extracts file paths, stack frames, symbols โ ranks candidate files in your local repo so the AI doesn't waste tokens hunting.
- Dispatches the structured prompt to your chosen AI agent (CLI or API).
- Computes a confidence score for the fix using diff metrics + model self-rating + hedge-density.
- Tracks token usage per backend per day so you don't blow through paid quotas.
- Never commits or pushes โ leaves the working tree dirty for human review.
๐ Quick start
Install (pick one)
Option A โ pipx (recommended, isolated)
pipx install git+https://github.com/Yash-Koladiya30/fixfleet.git
fixfleet
Option B โ uv tool
uv tool install git+https://github.com/Yash-Koladiya30/fixfleet.git
fixfleet
Option C โ one-shot run via uvx (no install)
uvx --from git+https://github.com/Yash-Koladiya30/fixfleet.git fixfleet
Option D โ plain pip
pip install git+https://github.com/Yash-Koladiya30/fixfleet.git
fixfleet
Option E โ clone + run (for hacking on the code)
git clone https://github.com/Yash-Koladiya30/fixfleet.git
cd fixfleet
python3 fix_bugs.py
Pure stdlib โ no runtime dependencies. Works on Python 3.9+.
Upgrade
pipx upgrade fixfleet # if installed with pipx
uv tool upgrade fixfleet # if installed with uv
Uninstall
pipx uninstall fixfleet
๐ Backend options
You need at least one of these. Mix and match per session.
CLI backends (use existing paid plans)
| CLI | Install | Login | Plan source |
|---|---|---|---|
| Claude Code | npm i -g @anthropic-ai/claude-code |
claude login |
Claude Pro/Max |
| Codex | npm i -g @openai/codex |
codex login |
ChatGPT Plus/Pro |
| Gemini CLI | npm i -g @google/gemini-cli |
gemini auth |
Google account (free tier) |
| Cursor Agent | install from cursor.sh | cursor-agent login |
Cursor Pro |
| Aider | pip install aider-chat |
API key | Bring your own |
| Qwen Code | npm i -g @qwen-code/qwen-code |
OAuth or key | Free tier |
API backends (free tier-friendly)
Single OpenAI-compatible client serves all of these:
| Provider | Free? | Get key |
|---|---|---|
| Groq | โ Free, fast (~500 tok/s) | https://console.groq.com/keys |
| Google Gemini | โ Free tier, big quota | https://aistudio.google.com/apikey |
| OpenRouter | โ Many free models | https://openrouter.ai/keys |
| Cerebras | โ Free tier | https://cloud.cerebras.ai |
| Ollama | โ Local, no key, offline | https://ollama.com |
| LM Studio | โ Local, no key | https://lmstudio.ai |
๐ Generating a GitLab token
- Go to gitlab.com โ top-right avatar โ Edit profile โ Access Tokens.
- Create a Personal Access Token with scope:
apiorread_api. - Copy the
glpat-...token. GitLab shows it once. - Paste when FixFleet asks. Typing is hidden via
getpass.
โ ๏ธ Never commit tokens. This repo's
.gitignorealready excludes.env,*.token,secrets.*, and the local config files (~/.bugfixer.json,~/.bugfixer-state.jsonare stored in your home dir, NOT in the repo).
๐งญ Flow
Step 0 Choose Backend โ pick installed CLI or configure API
Step 1 GitLab Token โ paste glpat-...
Step 2 GitLab Project โ paste full URL (or short path / numeric ID)
Step 3 Local Project Dir โ path to cloned repo on your Mac
Step 4 Date Filter โ YYYY-MM-DD or Enter for all
Step 5 Fetching Issues โ auto-paginated
Step 6 Select Issues โ 1,3,5 | all | unfixed | q
โ fixes each, shows budget + confidence per issue
After Step 0/2/3, defaults save to ~/.bugfixer.json โ next run press Enter to reuse.
Inputs accepted at Step 2
| Input | Auto-extracts |
|---|---|
https://gitlab.com/group/project |
gitlab.com host + path |
https://gitlab.com/group/project.git |
strips .git |
https://gitlab.com/g/p/-/issues |
strips UI suffix |
git@gitlab.com:group/project.git |
SSH form |
https://gitlab.example.com/team/repo |
self-hosted host |
group/project |
short form |
12345 |
numeric ID |
๐ฏ Confidence + Semantic Scoring
Every fix gets graded:
Confidence Report
Final score: 0.84 โโโโโโโโโโโโโโโโโโโโ (High)
Self-rating: 8/10
Root cause: Missing null check in handleSubmit
Diff focus: 0.92
File relevance: 0.85
Hedge density: 1.2%
Tests run: no
Files changed: 1 (12 lines)
Sources: model self-rating from the structured FIX REPORT block, git diff metrics, hedge-word density, file-relevance vs candidate list.
๐ฐ Token optimization
- Locator pre-greps the repo for candidate files โ top file inlined directly into prompt
- Section caps trim long descriptions/logs before sending
- Budget enforcement โ per-issue, session, daily caps in config
- State persistence โ skips already-fixed issues, tracks daily usage per backend
Typical savings vs naive prompt: 60โ80% tokens for bugs with file/trace hints.
โ๏ธ Configuration
Local config: ~/.bugfixer.json
{
"default_backend": "claude",
"default_project_id": "group/project",
"default_project_host": "gitlab.com",
"default_project_dir": "/Users/you/work/project",
"api": {
"preset": "groq",
"base_url": "https://api.groq.com/openai/v1",
"api_key": "gsk_...",
"model": "llama-3.3-70b-versatile"
},
"budgets": {
"session_max_tokens": 200000,
"per_issue_max_tokens": 30000,
"daily_max_tokens": 500000
},
"skip_already_fixed": true
}
๐ Lives in your home directory, NOT the repo. The
.gitignoreexcludes it from git regardless.
Override the backend per run with an env var:
BUGFIXER_BACKEND=codex python3 fix_bugs.py
๐งช Testing
python3 -m unittest tests.test_all -v
54+ unit tests cover parser, locator, budget, confidence, prompt, registry, diff-apply, state, config, URL parsing, path sanitization.
๐ Project layout
fixfleet/
โโโ bugfixer/
โ โโโ ui.py terminal styling
โ โโโ gitlab.py API client + URL parser
โ โโโ parser.py issue-body section extractor
โ โโโ locator.py signal extraction + file ranking + inlining
โ โโโ prompt.py structured prompt builder
โ โโโ budget.py token slimming + estimation + caps
โ โโโ confidence.py diff metrics + self-rating + hedge density
โ โโโ state.py ~/.bugfixer-state.json
โ โโโ config.py ~/.bugfixer.json
โ โโโ cli.py interactive flow orchestration
โ โโโ backends/
โ โโโ base.py Backend ABC
โ โโโ _subprocess.py tee runner
โ โโโ registry.py detect installed CLIs + API presets
โ โโโ cli/ claude ยท codex ยท gemini ยท cursor ยท aider ยท qwen
โ โโโ api/openai_compat.py
โโโ fix_bugs.py entry shim
โโโ tests/test_all.py
๐ก๏ธ Security notes
- Tokens / API keys typed via
getpassโ never echoed to terminal, never written to repo. - All issue body content is fenced in the prompt with adaptive fence length to prevent prompt-injection from malicious issue authors.
- The
.gitignoreexcludes config + state files, common secret files (.env,*.token,*.key). - The tool never commits or pushes โ manual review required before sharing fixes.
๐ Troubleshooting
| Symptom | Fix |
|---|---|
claude command not found |
Install one CLI or pick the API option in Step 0 |
HTTP 401 from GitLab |
Token expired or wrong scope (read_api/api needed) |
HTTP 404 |
Wrong project URL/ID format |
| "No bugs found" | GitLab issues need exact Bug label (case-sensitive) |
| Path with spaces fails | Drag-drop folder from Finder works (auto-unescapes) |
| Want to reset config | rm ~/.bugfixer.json ~/.bugfixer-state.json |
๐ค Contributing
Issues / PRs welcome. Guidelines:
- Pure stdlib โ no
requirements.txtdependencies in core - All new code paths need unit tests
- Run
python3 -m unittest tests.test_allbefore submitting
๐ License
MIT โ see LICENSE. Built by Yash Koladiya.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fixfleet-0.3.0.tar.gz.
File metadata
- Download URL: fixfleet-0.3.0.tar.gz
- Upload date:
- Size: 43.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00cf49deaeecdc2126d0b1e0b636fbd8bb88ede6eb1d7169ca01588946c0238b
|
|
| MD5 |
688150ce22d6dc0771d457d489642f2c
|
|
| BLAKE2b-256 |
cd697d96bae998461e45a74f856bfadd3c9e1bc4d6d7431d7dc77b2be51dd95a
|
File details
Details for the file fixfleet-0.3.0-py3-none-any.whl.
File metadata
- Download URL: fixfleet-0.3.0-py3-none-any.whl
- Upload date:
- Size: 41.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ecf19d10696a32de541bb95be242d56b26754b973f6d5cf7bfa6b316a342060
|
|
| MD5 |
2ecbf45104d286716f55f612dadd2cc6
|
|
| BLAKE2b-256 |
595297e6db378985d079897aab59e4958e52389e5d176053b363d112f8104fa4
|