Skip to main content

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.0 on PyPI (CLI: repolens) — Phases 0–9 complete
Local CLI · remotes · optional scanners · explain + diagrams · GitHub Action · opt-in local learning · enterprise CI recipes
Install: pip install "repolens-audit[scanners]==0.1.0" · from a clone: pip install -e ".[dev]"
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.


Modes

Command What it does
repolens review Full dual review: P1 security + P2 reliability + P3 architecture
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: Bring your own cloud key (Anthropic, OpenAI, DeepSeek), run a local model (e.g. Ollama), or rely on automatic local fallback (--fallback)
  • 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.0"

# 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@v4
- 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.

PDF

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


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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repolens-audit 0.1.0
File Size Uploaded
repolens_audit-0.1.0.tar.gz 383.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for repolens-audit 0.1.0
File Interpreter ABI Platform
repolens_audit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 722.5 kB

Release files / repolens_audit-0.1.0.tar.gz

Download URL repolens_audit-0.1.0.tar.gz
Size 383.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0666b779e929a3550e5b7f04d251723538292280148dc44d6ad39a9bb8a9de27
BLAKE2b-256 checksum
How to use checksums
caacc46150371568ac678a9a1a3f33eabd09171601f721054c44a77e590097b6
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 6, 2026.

Transparency log

Release files / repolens_audit-0.1.0-py3-none-any.whl

Download URL repolens_audit-0.1.0-py3-none-any.whl
Size 339.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac1cdf29b8d8f2a2e16c917942bff42753ab78bbb112dbbe220117c2d63f0db7
BLAKE2b-256 checksum
How to use checksums
be2d73a11d231bda2c9674859234de1afd0869c2436bdc3a45bc83158daaf072
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 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page