repofix 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. repofix-0.1.0/.gitignore +60 -0
  2. repofix-0.1.0/LICENSE +21 -0
  3. repofix-0.1.0/PKG-INFO +408 -0
  4. repofix-0.1.0/README.md +372 -0
  5. repofix-0.1.0/pyproject.toml +64 -0
  6. repofix-0.1.0/scripts/install.sh +101 -0
  7. repofix-0.1.0/src/repofix/__init__.py +3 -0
  8. repofix-0.1.0/src/repofix/branch/__init__.py +1 -0
  9. repofix-0.1.0/src/repofix/branch/cache.py +152 -0
  10. repofix-0.1.0/src/repofix/cli.py +931 -0
  11. repofix-0.1.0/src/repofix/config.py +156 -0
  12. repofix-0.1.0/src/repofix/core/__init__.py +0 -0
  13. repofix-0.1.0/src/repofix/core/artifact_installer.py +561 -0
  14. repofix-0.1.0/src/repofix/core/docker_compose_bind_fix.py +314 -0
  15. repofix-0.1.0/src/repofix/core/executor.py +262 -0
  16. repofix-0.1.0/src/repofix/core/git.py +117 -0
  17. repofix-0.1.0/src/repofix/core/process_registry.py +176 -0
  18. repofix-0.1.0/src/repofix/core/runner.py +2397 -0
  19. repofix-0.1.0/src/repofix/detection/__init__.py +0 -0
  20. repofix-0.1.0/src/repofix/detection/artifacts.py +291 -0
  21. repofix-0.1.0/src/repofix/detection/commands.py +1174 -0
  22. repofix-0.1.0/src/repofix/detection/deploy_mode.py +424 -0
  23. repofix-0.1.0/src/repofix/detection/environment.py +69 -0
  24. repofix-0.1.0/src/repofix/detection/multi.py +196 -0
  25. repofix-0.1.0/src/repofix/detection/stack.py +390 -0
  26. repofix-0.1.0/src/repofix/fixing/__init__.py +0 -0
  27. repofix-0.1.0/src/repofix/fixing/ai_fixer.py +291 -0
  28. repofix-0.1.0/src/repofix/fixing/classifier.py +659 -0
  29. repofix-0.1.0/src/repofix/fixing/detector.py +525 -0
  30. repofix-0.1.0/src/repofix/fixing/llm_cloud.py +183 -0
  31. repofix-0.1.0/src/repofix/fixing/llm_json.py +140 -0
  32. repofix-0.1.0/src/repofix/fixing/local_llm.py +337 -0
  33. repofix-0.1.0/src/repofix/fixing/retry.py +457 -0
  34. repofix-0.1.0/src/repofix/fixing/rules.py +1140 -0
  35. repofix-0.1.0/src/repofix/fixing/safety.py +158 -0
  36. repofix-0.1.0/src/repofix/memory/__init__.py +0 -0
  37. repofix-0.1.0/src/repofix/memory/store.py +297 -0
  38. repofix-0.1.0/src/repofix/output/__init__.py +0 -0
  39. repofix-0.1.0/src/repofix/output/display.py +821 -0
  40. repofix-0.1.0/tests/__init__.py +0 -0
  41. repofix-0.1.0/tests/conftest.py +68 -0
  42. repofix-0.1.0/tests/test_core/test_docker_compose_bind_fix.py +74 -0
  43. repofix-0.1.0/tests/test_detection/__init__.py +0 -0
  44. repofix-0.1.0/tests/test_detection/test_commands.py +223 -0
  45. repofix-0.1.0/tests/test_detection/test_multi.py +169 -0
  46. repofix-0.1.0/tests/test_detection/test_stack.py +100 -0
  47. repofix-0.1.0/tests/test_detection/test_venv.py +80 -0
  48. repofix-0.1.0/tests/test_env/test_npm_prefix_writable.py +23 -0
  49. repofix-0.1.0/tests/test_fixing/__init__.py +0 -0
  50. repofix-0.1.0/tests/test_fixing/test_classifier.py +106 -0
  51. repofix-0.1.0/tests/test_fixing/test_detector.py +155 -0
  52. repofix-0.1.0/tests/test_fixing/test_go_mod_fix.py +35 -0
  53. repofix-0.1.0/tests/test_fixing/test_llm_json.py +40 -0
  54. repofix-0.1.0/tests/test_fixing/test_rules.py +192 -0
  55. repofix-0.1.0/tests/test_fixing/test_safety.py +82 -0
  56. repofix-0.1.0/tests/test_output/test_npm_global_prompt.py +9 -0
  57. repofix-0.1.0/tests/test_output/test_npm_hint.py +23 -0
  58. repofix-0.1.0/tests/test_output/test_npm_unwritable_prompt.py +9 -0
@@ -0,0 +1,60 @@
1
+ # Virtual environments
2
+ .venv/
3
+ venv/
4
+ env/
5
+ .env/
6
+ .python-version
7
+
8
+ # Bytecode & caches
9
+ __pycache__/
10
+ *.py[cod]
11
+ *$py.class
12
+ *.so
13
+ .mypy_cache/
14
+ .ruff_cache/
15
+ .pytype/
16
+ dmypy.json
17
+ pypi*
18
+
19
+ # Testing & coverage
20
+ .pytest_cache/
21
+ .coverage
22
+ .coverage.*
23
+ htmlcov/
24
+ .tox/
25
+ .nox/
26
+ coverage.xml
27
+ *.cover
28
+ .hypothesis/
29
+
30
+ # Packaging / build (hatch, setuptools, legacy)
31
+ dist/
32
+ build/
33
+ *.egg-info/
34
+ *.egg
35
+ pip-wheel-metadata/
36
+ wheels/
37
+
38
+ # Jupyter
39
+ .ipynb_checkpoints/
40
+
41
+ # Environment & secrets (keep .env.example if you add one)
42
+ .env
43
+ .env.local
44
+ *.pem
45
+
46
+ # OS
47
+ .DS_Store
48
+ Thumbs.db
49
+
50
+ # Editors & IDEs
51
+ .idea/
52
+ *.swp
53
+ *.swo
54
+ *~
55
+
56
+ # VS Code — uncomment to ignore local settings
57
+ # .vscode/
58
+
59
+ # OS-generated
60
+ *.log
repofix-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RepoFix contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
repofix-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,408 @@
1
+ Metadata-Version: 2.4
2
+ Name: repofix
3
+ Version: 0.1.0
4
+ Summary: RepoFix — run any GitHub repo locally with one command; auto-detects stack, installs deps, self-heals errors
5
+ Project-URL: Homepage, https://github.com/sriramnarendran/RepoFix
6
+ Project-URL: Repository, https://github.com/sriramnarendran/RepoFix
7
+ Project-URL: Issues, https://github.com/sriramnarendran/RepoFix/issues
8
+ Author: RepoFix
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: automation,cli,devtools,github,repofix
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Build Tools
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: gitpython>=3.1
22
+ Requires-Dist: google-genai>=1.0
23
+ Requires-Dist: httpx>=0.24
24
+ Requires-Dist: psutil>=5
25
+ Requires-Dist: pydantic>=2
26
+ Requires-Dist: pyyaml>=6
27
+ Requires-Dist: rich>=13
28
+ Requires-Dist: toml>=0.10
29
+ Requires-Dist: typer>=0.12
30
+ Provides-Extra: dev
31
+ Requires-Dist: build>=1; extra == 'dev'
32
+ Requires-Dist: pytest-cov>=4; extra == 'dev'
33
+ Requires-Dist: pytest>=7; extra == 'dev'
34
+ Requires-Dist: twine>=5; extra == 'dev'
35
+ Description-Content-Type: text/markdown
36
+
37
+ <div align="center">
38
+
39
+ # RepoFix
40
+
41
+ **Clone any GitHub repo, detect the stack, install dependencies, run it, and recover from failures — without a three-hour README scavenger hunt.**
42
+
43
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
44
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
45
+ [![Status](https://img.shields.io/badge/status-alpha-orange.svg)]()
46
+
47
+ [Installation](#installation) · [Quick start](#quick-start) · [Examples](#examples) · [Bring your own LLM](#bring-your-own-llm) · [CLI reference](#cli-reference) · [Contributing](#contributing)
48
+
49
+ </div>
50
+
51
+ ---
52
+
53
+ ## Why RepoFix exists
54
+
55
+ 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.**
56
+
57
+ 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.
58
+
59
+ ### Pain points we optimize for
60
+
61
+ | You’ve been here before | What RepoFix does |
62
+ |------------------------|-------------------|
63
+ | “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) |
64
+ | Cryptic errors after install | Classifies failures, applies safe fixes (deps, ports, env), retries |
65
+ | Novel or project-specific failures | Escalates to local LLM and/or cloud APIs, with provider fallback |
66
+ | Re-cloning the same repo for every branch | **Branch cache** — reuses installed environments per branch |
67
+ | Long-running dev servers you lose track of | **`repofix ps` / `logs` / `stop` / `start` / `restart`** — process registry with log files |
68
+ | Global `npm install -g` in a README | Prompts for **isolated** vs system install; documents where binaries land |
69
+
70
+ ---
71
+
72
+ ## Features
73
+
74
+ - **One command to run a repo** — GitHub URL or local directory.
75
+ - **Multi-stack stack detection** — Node, Python, Go, Rust, Java/Kotlin, PHP, Ruby, Docker / Compose, and more.
76
+ - **Command discovery** — `package.json`, `Makefile`, `Procfile`, `docker-compose.yml`, README-driven deploy hints.
77
+ - **Self-healing pipeline** — Retries with fixes for common classes of failures (missing dependencies, ports, environment).
78
+ - **AI layer (optional)** — On-device **Qwen2.5-Coder-3B** via `llama-cpp-python`, plus **Gemini / OpenAI / Anthropic** with automatic fallback when configured.
79
+ - **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](#bring-your-own-llm).
80
+ - **Fix memory** — Persists successful fixes and run history for faster repeat runs.
81
+ - **Safety controls** — Command allow/block lists and **assist mode** for approval before applying fixes.
82
+ - **Deploy mode hints** — When a README describes both self-hosted and local dev paths, RepoFix can prompt (or use **`--prod`** / **`--dev`** to skip).
83
+ - **Release binaries** — Optional install from GitHub Releases when available (**`--binary`** / **`--source`**).
84
+ - **Branch environment cache** — `repofix branches`, `repofix branch-clean`.
85
+ - **Process lifecycle** — `ps`, `logs`, `stop`, `start`, `restart` with persisted metadata and log paths.
86
+
87
+ Default clone and config locations: **`~/.repofix/repos/`**, **`~/.repofix/config.toml`**, local model under **`~/.repofix/models/`**.
88
+
89
+ ---
90
+
91
+ ## Installation
92
+
93
+ **Requirements:** Python **3.10+**, **`git`** on your `PATH`. For Docker-based projects, Docker must be available when the stack needs it.
94
+
95
+ ### PyPI
96
+
97
+ ```bash
98
+ pip install repofix
99
+ ```
100
+
101
+ ### One-liner (curl)
102
+
103
+ The script installs from PyPI (same as `pip install --user`, with a Python 3.10+ check):
104
+
105
+ ```bash
106
+ curl -sSf --proto '=https' --tlsv1.2 \
107
+ https://raw.githubusercontent.com/sriramnarendran/RepoFix/main/scripts/install.sh | bash
108
+ ```
109
+
110
+ Isolated environment with [pipx](https://pipx.pypa.io/) (pass flags after `bash -s --` when piping):
111
+
112
+ ```bash
113
+ curl -sSf --proto '=https' --tlsv1.2 \
114
+ https://raw.githubusercontent.com/sriramnarendran/RepoFix/main/scripts/install.sh | bash -s -- --pipx
115
+ ```
116
+
117
+ Pin a release:
118
+
119
+ ```bash
120
+ curl -sSf --proto '=https' --tlsv1.2 \
121
+ https://raw.githubusercontent.com/sriramnarendran/RepoFix/main/scripts/install.sh | env REPOFIX_VERSION=0.1.0 bash
122
+ ```
123
+
124
+ **Install from source** (contributors):
125
+
126
+ ```bash
127
+ git clone https://github.com/sriramnarendran/RepoFix.git
128
+ cd RepoFix
129
+ pip install -e ".[dev]"
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Quick start
135
+
136
+ ```bash
137
+ # Run from a GitHub URL (first run may prompt for local LLM + optional cloud API key)
138
+ repofix run https://github.com/user/repo
139
+
140
+ # Specific branch
141
+ repofix run https://github.com/user/repo --branch develop
142
+
143
+ # Local checkout
144
+ repofix run ./my-project
145
+
146
+ # Safer: confirm each fix before applying
147
+ repofix run https://github.com/user/repo --mode assist
148
+
149
+ # Inject env vars from a file
150
+ repofix run https://github.com/user/repo --env-file ./secrets.env
151
+ ```
152
+
153
+ ### First-run setup
154
+
155
+ On the first `repofix run`, you may be offered:
156
+
157
+ 1. **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 via `repofix config`.
158
+ 2. **Cloud API key (optional)** — Gemini, OpenAI, or Anthropic for harder errors.
159
+
160
+ Manage these anytime:
161
+
162
+ ```bash
163
+ repofix config show
164
+ repofix config set-key --provider gemini
165
+ repofix config set-default --local-llm # or --no-local-llm
166
+ repofix model download # pre-fetch model before going offline
167
+ repofix model status
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Examples
173
+
174
+ ```bash
175
+ # Prefer production/self-hosting path from README (skip prompt)
176
+ repofix run https://github.com/org/app --prod
177
+
178
+ # Force local development path
179
+ repofix run https://github.com/org/app --dev
180
+
181
+ # Use a GitHub Release binary when detected (skip source build)
182
+ repofix run https://github.com/org/cli-tool --binary
183
+
184
+ # Always build from source
185
+ repofix run https://github.com/org/cli-tool --source
186
+
187
+ # Override port and cap retry cycles
188
+ repofix run https://github.com/org/api --port 8080 --retries 8
189
+
190
+ # No automated fixes (observe raw errors)
191
+ repofix run ./local-service --no-fix
192
+
193
+ # CI / non-interactive: skip confirmation prompts
194
+ repofix run https://github.com/org/app --auto-approve
195
+
196
+ # Override install or run commands explicitly
197
+ repofix run ./legacy-app --install "pip install -r requirements.txt" --command "uvicorn main:app --reload"
198
+ ```
199
+
200
+ ### After the app is running
201
+
202
+ ```bash
203
+ repofix ps # List processes started by RepoFix
204
+ repofix logs my-app --lines 100 # Tail log file
205
+ repofix logs my-app --follow # Stream logs
206
+ repofix stop my-app # Graceful stop (SIGTERM)
207
+ repofix stop my-app --force # SIGKILL
208
+ repofix start # Resume last stopped process
209
+ repofix start my-app
210
+ repofix restart my-app # Stop + relaunch same command (no reinstall)
211
+ ```
212
+
213
+ ### Branch cache
214
+
215
+ ```bash
216
+ repofix branches # List cached branch environments
217
+ repofix branches https://github.com/user/app
218
+ repofix branch-clean https://github.com/user/app --branch feature-x
219
+ repofix branch-clean --yes # Clear all branch caches (destructive)
220
+ ```
221
+
222
+ ---
223
+
224
+ ## Execution modes
225
+
226
+ | Mode | Behaviour |
227
+ |------|-----------|
228
+ | `auto` (default) | Applies fixes automatically within safety rules |
229
+ | `assist` | Prompts before applying each fix |
230
+ | `debug` | Verbose output for detection and fix decisions |
231
+
232
+ ---
233
+
234
+ ## CLI reference
235
+
236
+ ### `repofix run`
237
+
238
+ ```
239
+ repofix run <REPO> [OPTIONS]
240
+
241
+ Arguments:
242
+ REPO GitHub URL or local path
243
+
244
+ Options:
245
+ -b, --branch TEXT Git branch
246
+ -m, --mode TEXT auto | assist | debug (default: auto)
247
+ -p, --port INT Override listening port
248
+ -r, --retries INT Max fix/retry cycles (default: from config, else 5)
249
+ -e, --env-file PATH .env file to load
250
+ --no-fix Disable automated fixes
251
+ --auto-approve Skip confirmation prompts (e.g. npm global install choice)
252
+ -c, --command TEXT Override run command
253
+ -i, --install TEXT Override install command
254
+ --binary Prefer prebuilt release binary when available
255
+ --source Always run from source (skip binary)
256
+ --prod Use production/self-hosting path when README offers both
257
+ --dev Use local development path when README offers both
258
+ ```
259
+
260
+ ### Other commands
261
+
262
+ | Command | Purpose |
263
+ |---------|---------|
264
+ | `repofix config show` | Current settings (keys shown as set/not set) |
265
+ | `repofix config set-key [--provider gemini\|openai\|anthropic]` | Store API key |
266
+ | `repofix config set-default ...` | Defaults: AI provider, models, `OPENAI_BASE_URL`, retries, local LLM, etc. |
267
+ | `repofix history [--limit N]` | Recent runs and fixes |
268
+ | `repofix clear-memory [--yes]` | Wipe fix memory + run history |
269
+ | `repofix ps` | Processes + PIDs + log paths |
270
+ | `repofix logs <name> [--lines N] [--follow]` | Show or follow logs |
271
+ | `repofix stop <name> [--force]` | Stop a process |
272
+ | `repofix start [name]` | Start stopped/crashed process (last one if name omitted) |
273
+ | `repofix restart <name>` | Stop + start same command |
274
+ | `repofix branches [repo]` | List cached branch environments |
275
+ | `repofix branch-clean [repo] [--branch B] [--yes]` | Clear branch cache |
276
+ | `repofix model download` | Install local LLM deps + download weights |
277
+ | `repofix model status` | Local model status |
278
+ | `repofix model remove [--yes]` | Delete local weights (~2 GB) |
279
+
280
+ Run `repofix --help` and `repofix <command> --help` for the full Typer-generated help.
281
+
282
+ ---
283
+
284
+ ## Configuration
285
+
286
+ - **File:** `~/.repofix/config.toml`
287
+ - **Environment variables:** `GEMINI_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, optional `OPENAI_BASE_URL` for OpenAI-compatible endpoints.
288
+
289
+ 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`).
290
+
291
+ ### Bring your own LLM
292
+
293
+ RepoFix does not lock you to one cloud model or one vendor.
294
+
295
+ **Per-provider model ids** — Set whichever checkpoint your org uses (as long as the provider’s API accepts that id):
296
+
297
+ ```bash
298
+ repofix config set-default \
299
+ --gemini-model gemini-2.0-flash-lite \
300
+ --openai-model gpt-4o-mini \
301
+ --anthropic-model claude-3-5-haiku-20241022
302
+ ```
303
+
304
+ **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:
305
+
306
+ ```bash
307
+ export OPENAI_BASE_URL="http://127.0.0.1:11434/v1" # example: Ollama
308
+ export OPENAI_API_KEY="ollama" # required field; use dummy if the server ignores it
309
+ repofix config set-default --openai-model llama3.2 --ai-provider openai
310
+ ```
311
+
312
+ Or persist in config:
313
+
314
+ ```bash
315
+ repofix config set-default --openai-base-url http://127.0.0.1:11434/v1 --openai-model your-model-name
316
+ ```
317
+
318
+ 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).
319
+
320
+ **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.
321
+
322
+
323
+ ---
324
+
325
+ ## Supported stacks (high level)
326
+
327
+ | Ecosystem | Notes |
328
+ |-----------|--------|
329
+ | **Node.js** | Next.js, React, Express, Vue, Angular, NestJS, etc. |
330
+ | **Python** | FastAPI, Flask, Django, Streamlit, etc. |
331
+ | **Go** | `go run` / module workflows |
332
+ | **Rust** | Cargo |
333
+ | **Java / Kotlin** | Maven, Gradle |
334
+ | **PHP** | Composer, Laravel |
335
+ | **Ruby** | Rails, Sinatra |
336
+ | **Docker** | Dockerfile, docker-compose |
337
+
338
+ Exact behaviour depends on project layout and detection heuristics. If something mis-detects, **`--install`** / **`--command`** overrides are the escape hatch.
339
+
340
+ ---
341
+
342
+ ## How it works (short)
343
+
344
+ 1. Resolve Git URL or local path → clone or validate.
345
+ 2. Detect language, framework, and entry commands.
346
+ 3. Resolve environment (e.g. `.env.example` hints, missing vars).
347
+ 4. Run install → build → run with live log streaming.
348
+ 5. On failure: classify → rule-based fix → retry up to limit.
349
+ 6. If still stuck: local and/or cloud AI suggests next steps (JSON-structured, safety-filtered).
350
+ 7. Record outcome in fix memory; register long-lived processes for `ps` / `logs` / lifecycle commands.
351
+
352
+ ---
353
+
354
+ ## Security & privacy
355
+
356
+ - RepoFix **executes shell commands** in your checked-out repos. Use **`assist` mode** or **`--no-fix`** when you don’t want automatic remediation.
357
+ - **Cloud AI** sends error context and project snippets to the provider you configure — use **local-only** mode if that’s unacceptable for your org.
358
+ - Review **`repofix fixing/safety.py`** and the allow/block behaviour before running on untrusted codebases.
359
+ - **`sudo` global npm installs** are never silent; they require explicit user choice.
360
+
361
+ ---
362
+
363
+ ## Development
364
+
365
+ ```bash
366
+ pip install -e ".[dev]"
367
+ pytest
368
+ ruff check src tests
369
+ ```
370
+
371
+ ---
372
+
373
+ ## Contributing
374
+
375
+ We welcome issues and PRs. A few norms:
376
+
377
+ 1. **Open an issue first** for large features (detection rules, new stack support, AI behaviour) so we align on design.
378
+ 2. **Small, focused PRs** — one logical change per branch; match existing style (`ruff`, type hints where used).
379
+ 3. **Tests** — Add or extend tests under `tests/` for detection, fixing, safety, or CLI behaviour you change.
380
+ 4. **No drive-by refactors** — Keep diffs tight; unrelated formatting churn makes review harder.
381
+ 5. **Document user-visible flags** — If you add CLI options, update this README and Typer help strings.
382
+
383
+ **License:** MIT — see [LICENSE](LICENSE).
384
+
385
+ ---
386
+
387
+ ## Support
388
+
389
+ - **Bug reports & feature requests:** [GitHub Issues](https://github.com/sriramnarendran/RepoFix/issues)
390
+ - **Questions & show-and-tell:** [GitHub Discussions](https://github.com/sriramnarendran/RepoFix/discussions)
391
+
392
+ 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.
393
+
394
+ ---
395
+
396
+ ## Roadmap & status
397
+
398
+ 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.
399
+
400
+ ---
401
+
402
+ <div align="center">
403
+
404
+ **RepoFix — paste the URL. Run the code.**
405
+
406
+ MIT License · Built for developers who’d rather ship than configure.
407
+
408
+ </div>