RepoLens
See into any repository—security, reliability, and architecture—before you ship.
RepoLens is an open-source CLI that runs structured code reviews against projects you care about: on your machine, or cloned from GitHub, Bitbucket, Hugging Face, or any Git URL. It follows a clear P1 → P2 → P3 pass (security → bugs/reliability/performance → architecture/quality) and writes audit-friendly reports with impact, remediation steps, and code-example fixes for Critical/High findings.
Status:
repolens-audit==0.1.2(CLI:repolens) — Phases 0–9 complete; M1–M4 shipped
Local CLI · remotes · optional scanners · explain + diagrams · GitHub Action · opt-in local learning · enterprise CI recipes
Install:pip install "repolens-audit[scanners]==0.1.2"· from a clone:pip install -e ".[dev]"
View a sample due-diligence report (PDF) — gate ≠ “% secure”; remediation + architecture signals included
Docs: phases · FAQ · rules · install extras · CI / Action · remotes · scanners · local learning · publishing
Why RepoLens?
| Need | How RepoLens helps |
|---|---|
| Review any project, not one vendor’s stack | Local paths + Git remotes |
| Security without ignoring architecture | Full review + sentinel security-only mode |
| Actionable findings | Impact, fix plan, code examples on Critical/High |
| Shareable audits | Markdown reports (PDF via pandoc / Print) |
| Production honesty | Complements—does not replace—CI, tests, and scanners |
| Python cyclicity ratchet | Baseline + repolens check --diff for fast CI (Rule 1 — debt must not rise); see FAQ |
| Complexity + test inventory | Fast Brain McCabe/cognitive (Python) + Top-10 table; test file/case counts; AI refactor capped at top-5 — design · FAQ |
RepoLens is zero-infrastructure — pipx or ephemeral CI runners; no SonarQube server and no PR-review SaaS. Built for M&A auditors, fractional CTOs, and pre-release platform gates who need portable dual-review evidence. See competitive landscape 2026.
RepoLens is not a replacement for Semgrep, CodeQL, Dependabot, Snyk, or your test suite. Those stay in CI. RepoLens adds a consistent, human-readable due-diligence layer you can run anywhere.
First week (audit → evidence → fix): docs/recipes/first-week.md.
Unify existing SARIF (CodeQL / Sonar / ESLint → one executive gate): docs/recipes/sarif-unification.md.
Modes
| Command | What it does |
|---|---|
repolens review |
Full dual review: P1 security + P2 reliability + P3 architecture (--preset pr|changed|release) |
repolens audit |
One-command due-diligence (= --preset release + ratchet + verify) |
repolens sentinel |
Security-only scan (P1 playbook) |
repolens architecture |
Architecture / production-readiness audit |
repolens plugins |
Optional scanners: status / list / install |
repolens learn |
Opt-in local index: build / status / clear |
repolens init |
Write user config (cloud key, Ollama, or none) |
repolens explain |
Deep-dive one finding by ID (solutions + diagram) |
repolens export |
Export / convert a report (e.g. Markdown → PDF via pandoc) |
repolens version |
Print package version |
repolens baseline |
Snapshot import-graph cyclicity (.repolens/baseline.json) |
repolens check --diff |
Rule 1 ratchet gate for CI / pre-commit |
What gets checked? See docs/rules.md — plain guide to rules, why they exist, and how to turn them on/off.
Languages & tools
- CLI: Python 3.11+
- Reviews: language-agnostic, with first-class focus on JS/TS, Python, Go, JVM, C#, Ruby, PHP, Rust, Swift (+ IaC/config)
- AI: BYOK primary (Bedrock / Vertex / Gemini / Anthropic / OpenAI…) for minutes-scale deep audits; Ollama for air-gap (14B–32B+ — often hours on thin laptops); automatic local fallback (
--fallback) when configured - CVE / SAST / secrets: optional plugins (OSV, Semgrep, gitleaks)—not in the slim default install
- Local learning: opt-in on-disk FTS index (
repolens learn), informed consent first - CI: official GitHub Action (
action.yml) — see docs/ci.md
Full answers: docs/faq.md · docs/design/ai-keys-scanners-and-local-learning.md.
Setup (cloud / Ollama / scanners): docs/setup-ai-and-scanners.md.
Try it (local + GitHub / Bitbucket / HF / git URL): docs/try-on-your-repo.md.
Interactive helper: ./scripts/repolens-guided.sh (see try-on-your-repo).
Quick start
# Preferred: PyPI (CLI entry point is still `repolens`)
pip install "repolens-audit[scanners]==0.1.2"
# From a clone (contributors / dogfood)
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Install extras ([dev], [scanners], …)
These are optional parts of the RepoLens package (defined in this repo’s pyproject.toml). They are not settings inside the apps you review.
| Extra | Command | What you get |
|---|---|---|
| (none) | pip install -e . |
CLI only |
| dev | pip install -e ".[dev]" |
+ pytest, pytest-cov, ruff, mypy |
| scanners | pip install -e ".[scanners]" |
+ Semgrep (gitleaks/osv still via repolens plugins install) |
| local-ml | pip install -e ".[local-ml]" |
+ sentence-transformers |
Full detail: docs/install-extras.md.
# From a clone
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# First-run: cloud key, local Ollama, or none
# Ollama: uses a model from `ollama list` (or pass --model NAME)
repolens init --provider ollama # or openai | anthropic | deepseek | none
# Inventory + report skeleton (no model call)
repolens review --path ./my-app --dry-run
# Optional scanners (secrets / SAST / CVE)
repolens plugins install all
repolens review --path ./my-app --scanners-only
# Opt-in local learning (stays on disk)
repolens learn build --path ./my-app --accept-local-learning
# Full local review (requires configured provider + key/Ollama)
# Progress lines + LLM heartbeats by default; add -v for more detail
# Deep coverage (multi-pass + heuristics) is on by default; use --no-deep for single-shot
repolens review --path ./my-app --verbose
# After first run: warm packs + recommended timeout
repolens adaptive status --path ./my-app
repolens sentinel --path ./my-app
Sources (local + remotes)
# Local folder
repolens review --path ./my-app --dry-run
# GitHub / Bitbucket / Hugging Face / any git URL
repolens review --github owner/repo --ref main --dry-run
repolens review --bitbucket workspace/repo --ref main --dry-run
repolens review --hf org/model --dry-run
repolens review --hf datasets/org/dataset-name --dry-run
repolens review --git-url https://github.com/owner/repo.git --ref main --dry-run
Private remotes: GITHUB_TOKEN / BITBUCKET_TOKEN / HF_TOKEN (or gh auth login).
Full examples: docs/try-on-your-repo.md · docs/remote-sources.md · docs/scanners.md.
GitHub Actions
- uses: actions/checkout@v7
- uses: vksvicky/RepoLens@main
with:
path: .
run: auto # scanners always; LLM if API key secret is set
# or: run: dry-run
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} # optional
Details: docs/ci.md.
Playbooks also work with any LLM chat: docs/using-playbooks.md.
Reports
In the terminal
Summaries show confidence %, severity counts, and top findings.
Saved Markdown (default artifact)
reports/gate_review_report_{mode}_YYYY-MM-DD_HHMM.md
mode is review, sentinel, or architecture. Each Critical/High finding includes explanation, impact, recommended fix, and a code example. Reports include an Automated scanners section when scanners run.
pandoc reports/gate_review_report_review_YYYY-MM-DD_HHMM.md -o reports/gate_review_report_review_YYYY-MM-DD_HHMM.pdf
# or: Print → Save as PDF from a Markdown preview
Playbooks & rules
| Playbook | File |
|---|---|
Security (P1 / sentinel) |
playbooks/security.md |
| Architecture (release / full audit) | playbooks/architecture.md |
Rules (what is checked, why, enable/disable): docs/rules.md.
Playbook files: playbooks/README.md. Contributions: docs/CONTRIBUTING.md.
Repository layout
RepoLens/
├── README.md # This page
├── LICENSE # MIT
├── action.yml # GitHub Action (composite)
├── pyproject.toml # Python package
├── src/repolens/ # CLI, pipeline, scanners, learning
├── tests/ # pytest suite
├── playbooks/ # Review instruction sources
├── examples/monorepo/ # Sample project config
├── docs/ # Guides, FAQ, ADR, design, phases
└── .github/workflows/ # CI, publish, Action example
Naming conventions: docs/README.md.
Roadmap
| Phase | Scope | Status |
|---|---|---|
| 0 | Docs, playbooks, design | Done |
| 1 | Core CLI (local path, reports, BYOK / Ollama) | Done (alpha) |
| 2 | Remotes (--git-url, --github, --bitbucket, --hf) |
Done |
| 3 | Optional scanners (gitleaks, Semgrep, OSV) | Done |
| 4 | GitHub Action, PyPI publish path, local learning | Done |
| Next | Harden publish / marketplace polish / richer embeddings | Open |
Tracker: docs/phases.md · Design: docs/design/ · ADR: docs/adr/01_analysis_runtime_architecture.md.
Contributing
- docs/CONTRIBUTING.md
- docs/CODE_OF_CONDUCT.md
- docs/SECURITY.md for vulnerability reports
- docs/SUPPORT.md
- Feedback (teaching / shipping): Discussions · Bugs & features: issue templates
Disclaimer (AI / LLM output)
RepoLens findings and suggestions may be produced or assisted by AI/LLMs, heuristics, and optional scanners. They can be wrong or incomplete. You are responsible for verifying results before you act. Authors accept no liability for harm from reliance on AI/LLM or tool-assisted output. Reports are not a certification or professional audit engagement. Full text appears in every Markdown report under Disclaimer, and in the FAQ.
License
MIT — use it, fork it, adapt the playbooks for your org. Software is provided as is (see the licence).
Metadata
Release files for repolens-audit 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| repolens_audit-0.1.2.tar.gz | 452.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| repolens_audit-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 854.0 kB
Release files / repolens_audit-0.1.2.tar.gz
| Download URL | repolens_audit-0.1.2.tar.gz |
|---|---|
| Size | 452.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
add1955744f7781957019567c22a3c54f191cd861c50d395240939c4c02ff1c5
|
|
BLAKE2b-256 checksum How to use checksums |
77952c048614943b952fd7135cfd6281af64ad532c076e381849236447081697
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.
Transparency logRelease files / repolens_audit-0.1.2-py3-none-any.whl
| Download URL | repolens_audit-0.1.2-py3-none-any.whl |
|---|---|
| Size | 401.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e10966fb68d23d976116f5c8ff903615ced6520ee8dc8703052aef4b180a5f66
|
|
BLAKE2b-256 checksum How to use checksums |
ad80036b83155325b7336bf14178a659c80f2a05db2e6973b5292a0814a8697f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.
Transparency log