RepoFix — run any GitHub repo locally with one command; auto-detects stack, installs deps, self-heals errors
Project description
RepoFix
Clone any GitHub repo, detect the stack, install dependencies, run it, and recover from failures — without a three-hour README scavenger hunt.
Installation · Quick start · Examples · Bring your own LLM · CLI reference · Contributing · llms.txt (LLM / discovery summary)
Why RepoFix exists
Every developer knows the loop: star a repo → clone → guess the Node version → fight pnpm vs yarn → discover a missing .env → port already in use → give up. READMEs are written for humans, not machines — and machines are better at grinding through setup errors than you are at 11pm.
RepoFix automates that grind: one command takes you from a URL (or local path) to a running app, with rule-based fixes, optional on-device LLM, and optional cloud LLM fallbacks (Gemini, OpenAI, Anthropic) when heuristics run out. It remembers what worked so the next repo costs less.
Pain points we optimize for
| You’ve been here before | What RepoFix does |
|---|---|
| “Works on my machine” in the README, not on yours | Detects stack and picks install/run commands from manifests (package.json, Makefile, Procfile, docker-compose, README hints) |
| Cryptic errors after install | Classifies failures, applies safe fixes (deps, ports, env), retries |
| Novel or project-specific failures | Escalates to local LLM and/or cloud APIs, with provider fallback |
| Re-cloning the same repo for every branch | Branch cache — reuses installed environments per branch |
| Long-running dev servers you lose track of | repofix ps / logs / stop / start / restart — process registry with log files |
Global npm install -g in a README |
Prompts for isolated vs system install; documents where binaries land |
Features
- One command to run a repo — GitHub URL or local directory.
- Multi-stack stack detection — Node, Python, Go, Rust, Java/Kotlin, PHP, Ruby, Docker / Compose, and more.
- Command discovery —
package.json,Makefile,Procfile,docker-compose.yml, README-driven deploy hints. - Self-healing pipeline — Retries with fixes for common classes of failures (missing dependencies, ports, environment).
- AI layer (optional) — On-device Qwen2.5-Coder-3B via
llama-cpp-python, plus Gemini / OpenAI / Anthropic with automatic fallback when configured. - Bring your own LLM — Pin any model id each vendor supports, or point the OpenAI integration at an OpenAI-compatible base URL (local gateway, proxy, or enterprise endpoint); see Bring your own LLM.
- Fix memory — Persists successful fixes and run history for faster repeat runs.
- Safety controls — Command allow/block lists and assist mode for approval before applying fixes.
- Deploy mode hints — When a README describes both self-hosted and local dev paths, RepoFix can prompt (or use
--prod/--devto skip). - Release binaries — Optional install from GitHub Releases when available (
--binary/--source). - Branch environment cache —
repofix branches,repofix branch-clean. - Process lifecycle —
ps,logs,stop,start,restartwith persisted metadata and log paths.
Default clone and config locations: ~/.repofix/repos/, ~/.repofix/config.toml, local model under ~/.repofix/models/.
Installation
Always required: git on your PATH.
Sometimes required: Docker when the project you run is Docker-based.
1. One-line install (recommended)
Installs the standalone binary from GitHub Releases. No Python is needed for RepoFix itself.
curl -sSfL https://raw.githubusercontent.com/sriramnarendran/RepoFix/main/scripts/install_binary.sh | bash
2. Install with pip
Requires Python 3.10+.
pip install repofix
Isolated CLI (recommended if you use pipx for tools):
pipx install repofix
Using a virtual environment:
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install repofix
repofix --help
Other ways to get the binary
Download from Releases or CI artifacts; filenames are repofix-linux-x86_64, repofix-macos-arm64, repofix-macos-x86_64, repofix-windows-x86_64.exe. Build locally: ./scripts/build_binary.sh.
Linux (glibc): the x86_64 binary is built on Ubuntu 22.04 so it runs on typical glibc-based distros from that era onward. If you see GLIBC_2.xx not found, your OS is older than what that build targets — use pip install repofix (or a venv) instead, or build the binary on your own machine with ./scripts/build_binary.sh.
repofix not found
pip install --user: add Python’s user script directory to your PATH (often~/.local/binon Linux/macOS).- Virtualenv: activate the venv before running
repofix. - Binary: ensure
/usr/local/bin(or yourINSTALL_PREFIX) is onPATH.
Install from source (contributors)
git clone https://github.com/sriramnarendran/RepoFix.git
cd RepoFix
pip install -e ".[dev]"
Quick start
# Run from a GitHub URL (first run may prompt for local LLM + optional cloud API key)
repofix run https://github.com/user/repo
# Specific branch
repofix run https://github.com/user/repo --branch develop
# Local checkout
repofix run ./my-project
# Safer: confirm each fix before applying
repofix run https://github.com/user/repo --mode assist
# Inject env vars from a file
repofix run https://github.com/user/repo --env-file ./secrets.env
First-run setup
On the first repofix run, you may be offered:
- On-device AI — Installs
llama-cpp-python(prebuilt wheel when available) and downloads ~2 GB model weights to~/.repofix/models/. You can skip and rely on cloud keys only, or disable later viarepofix config. - Cloud API key (optional) — Gemini, OpenAI, or Anthropic for harder errors.
Manage these anytime:
repofix config show
repofix config set-key --provider gemini
repofix config set-default --local-llm # or --no-local-llm
repofix model download # pre-fetch model before going offline
repofix model status
Examples
# Prefer production/self-hosting path from README (skip prompt)
repofix run https://github.com/org/app --prod
# Force local development path
repofix run https://github.com/org/app --dev
# Use a GitHub Release binary when detected (skip source build)
repofix run https://github.com/org/cli-tool --binary
# Always build from source
repofix run https://github.com/org/cli-tool --source
# Override port and cap retry cycles
repofix run https://github.com/org/api --port 8080 --retries 8
# No automated fixes (observe raw errors)
repofix run ./local-service --no-fix
# CI / non-interactive: skip confirmation prompts
repofix run https://github.com/org/app --auto-approve
# Override install or run commands explicitly
repofix run ./legacy-app --install "pip install -r requirements.txt" --command "uvicorn main:app --reload"
After the app is running
repofix ps # List processes started by RepoFix
repofix logs my-app --lines 100 # Tail log file
repofix logs my-app --follow # Stream logs
repofix stop my-app # Graceful stop (SIGTERM)
repofix stop my-app --force # SIGKILL
repofix start # Resume last stopped process
repofix start my-app
repofix restart my-app # Stop + relaunch same command (no reinstall)
Branch cache
repofix branches # List cached branch environments
repofix branches https://github.com/user/app
repofix branch-clean https://github.com/user/app --branch feature-x
repofix branch-clean --yes # Clear all branch caches (destructive)
Execution modes
| Mode | Behaviour |
|---|---|
auto (default) |
Applies fixes automatically within safety rules |
assist |
Prompts before applying each fix |
debug |
Verbose output for detection and fix decisions |
CLI reference
repofix run
repofix run <REPO> [OPTIONS]
Arguments:
REPO GitHub URL or local path
Options:
-b, --branch TEXT Git branch
-m, --mode TEXT auto | assist | debug (default: auto)
-p, --port INT Override listening port
-r, --retries INT Max fix/retry cycles (default: from config, else 5)
-e, --env-file PATH .env file to load
--no-fix Disable automated fixes
--auto-approve Skip confirmation prompts (e.g. npm global install choice)
-c, --command TEXT Override run command
-i, --install TEXT Override install command
--binary Prefer prebuilt release binary when available
--source Always run from source (skip binary)
--prod Use production/self-hosting path when README offers both
--dev Use local development path when README offers both
Other commands
| Command | Purpose |
|---|---|
repofix config show |
Current settings (keys shown as set/not set) |
repofix config set-key [--provider gemini|openai|anthropic] |
Store API key |
repofix config set-default ... |
Defaults: AI provider, models, OPENAI_BASE_URL, retries, local LLM, etc. |
repofix history [--limit N] |
Recent runs and fixes |
repofix clear-memory [--yes] |
Wipe fix memory + run history |
repofix ps |
Processes + PIDs + log paths |
repofix logs <name> [--lines N] [--follow] |
Show or follow logs |
repofix stop <name> [--force] |
Stop a process |
repofix start [name] |
Start stopped/crashed process (last one if name omitted) |
repofix restart <name> |
Stop + start same command |
repofix branches [repo] |
List cached branch environments |
repofix branch-clean [repo] [--branch B] [--yes] |
Clear branch cache |
repofix model download |
Install local LLM deps + download weights |
repofix model status |
Local model status |
repofix model remove [--yes] |
Delete local weights (~2 GB) |
Run repofix --help and repofix <command> --help for the full Typer-generated help.
Configuration
- File:
~/.repofix/config.toml - Environment variables:
GEMINI_API_KEY,OPENAI_API_KEY,ANTHROPIC_API_KEY, optionalOPENAI_BASE_URLfor OpenAI-compatible endpoints.
Provider preference (e.g. try Gemini then OpenAI vs a single primary) is configurable via repofix config set-default (--ai-provider, --ai-fallback / --no-ai-fallback).
Bring your own LLM
RepoFix does not lock you to one cloud model or one vendor.
Per-provider model ids — Set whichever checkpoint your org uses (as long as the provider’s API accepts that id):
repofix config set-default \
--gemini-model gemini-2.0-flash-lite \
--openai-model gpt-4o-mini \
--anthropic-model claude-3-5-haiku-20241022
OpenAI-compatible endpoints — The OpenAI path uses the chat-completions JSON shape. You can aim it at a local or self-hosted server (Ollama’s OpenAI shim, LM Studio, vLLM, LiteLLM, many corporate gateways) by setting a base URL. Env var wins over config:
export OPENAI_BASE_URL="http://127.0.0.1:11434/v1" # example: Ollama
export OPENAI_API_KEY="ollama" # required field; use dummy if the server ignores it
repofix config set-default --openai-model llama3.2 --ai-provider openai
Or persist in config:
repofix config set-default --openai-base-url http://127.0.0.1:11434/v1 --openai-model your-model-name
Pin the provider so traffic doesn’t bounce to Gemini/Anthropic when you intend to use only that gateway: --ai-provider openai (and disable cross-provider fallback with --no-ai-fallback if you want a single stack).
On-device default — The bundled local weights are fixed to Qwen2.5-Coder-3B (GGUF) for a consistent offline path; custom GGUF paths are not wired in config today—use cloud or OpenAI-compatible for a fully custom model choice there.
Supported stacks (high level)
| Ecosystem | Notes |
|---|---|
| Node.js | Next.js, React, Express, Vue, Angular, NestJS, etc. |
| Python | FastAPI, Flask, Django, Streamlit, etc. |
| Go | go run / module workflows |
| Rust | Cargo |
| Java / Kotlin | Maven, Gradle |
| PHP | Composer, Laravel |
| Ruby | Rails, Sinatra |
| Docker | Dockerfile, docker-compose |
Exact behaviour depends on project layout and detection heuristics. If something mis-detects, --install / --command overrides are the escape hatch.
How it works (short)
- Resolve Git URL or local path → clone or validate.
- Detect language, framework, and entry commands.
- Resolve environment (e.g.
.env.examplehints, missing vars). - Run install → build → run with live log streaming.
- On failure: classify → rule-based fix → retry up to limit.
- If still stuck: local and/or cloud AI suggests next steps (JSON-structured, safety-filtered).
- Record outcome in fix memory; register long-lived processes for
ps/logs/ lifecycle commands.
Security & privacy
- RepoFix executes shell commands in your checked-out repos. Use
assistmode or--no-fixwhen you don’t want automatic remediation. - Cloud AI sends error context and project snippets to the provider you configure — use local-only mode if that’s unacceptable for your org.
- Review
repofix fixing/safety.pyand the allow/block behaviour before running on untrusted codebases. sudoglobal npm installs are never silent; they require explicit user choice.
Development
pip install -e ".[dev]"
pytest
ruff check src tests
Contributing
We welcome issues and PRs. A few norms:
- Open an issue first for large features (detection rules, new stack support, AI behaviour) so we align on design.
- Small, focused PRs — one logical change per branch; match existing style (
ruff, type hints where used). - Tests — Add or extend tests under
tests/for detection, fixing, safety, or CLI behaviour you change. - No drive-by refactors — Keep diffs tight; unrelated formatting churn makes review harder.
- Document user-visible flags — If you add CLI options, update this README and Typer help strings.
License: MIT — see LICENSE.
Support
- Bug reports & feature requests: GitHub Issues
- Questions & show-and-tell: GitHub Discussions
When reporting bugs, include: OS, Python version, RepoFix version, the repo URL or stack, full --mode debug output (redact secrets), and whether local LLM / cloud AI was enabled.
Roadmap & status
Project status is alpha (Development Status :: 3 - Alpha on PyPI). Expect breaking CLI or config changes until v1.0. Priorities include broader stack coverage, sharper safety defaults, and more regression tests for real-world READMEs.
RepoFix — paste the URL. Run the code.
MIT License · Built for developers who’d rather ship than configure.
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 repofix-0.1.2.tar.gz.
File metadata
- Download URL: repofix-0.1.2.tar.gz
- Upload date:
- Size: 151.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c4038645ffb45e9468078ff693031dde1e9a3ef3aa6ba219cad198789e8efc7
|
|
| MD5 |
f9b760d25122939d1acda71a2d427cbe
|
|
| BLAKE2b-256 |
f80808a118a8ee8d7e300d0bde065abad15224dfecb2a500425f8a7713564d39
|
Provenance
The following attestation bundles were made for repofix-0.1.2.tar.gz:
Publisher:
publish-pypi.yml on sriramnarendran/RepoFix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
repofix-0.1.2.tar.gz -
Subject digest:
1c4038645ffb45e9468078ff693031dde1e9a3ef3aa6ba219cad198789e8efc7 - Sigstore transparency entry: 1155003672
- Sigstore integration time:
-
Permalink:
sriramnarendran/RepoFix@5e5a8db6f8fb2b4f3cc2522bc6abc9016b4415b2 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/sriramnarendran
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5e5a8db6f8fb2b4f3cc2522bc6abc9016b4415b2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file repofix-0.1.2-py3-none-any.whl.
File metadata
- Download URL: repofix-0.1.2-py3-none-any.whl
- Upload date:
- Size: 152.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcc4393bd238efa2bbc56d731afe1b4e0cd771ed57c9950902024a499ea70e0a
|
|
| MD5 |
3b00e6b092b1d43c5082c14fb1e44da2
|
|
| BLAKE2b-256 |
4392507451471d66e6f0361ebd9573ed1a10a291444137639ce411e833d0ea30
|
Provenance
The following attestation bundles were made for repofix-0.1.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on sriramnarendran/RepoFix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
repofix-0.1.2-py3-none-any.whl -
Subject digest:
bcc4393bd238efa2bbc56d731afe1b4e0cd771ed57c9950902024a499ea70e0a - Sigstore transparency entry: 1155003674
- Sigstore integration time:
-
Permalink:
sriramnarendran/RepoFix@5e5a8db6f8fb2b4f3cc2522bc6abc9016b4415b2 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/sriramnarendran
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5e5a8db6f8fb2b4f3cc2522bc6abc9016b4415b2 -
Trigger Event:
push
-
Statement type: