Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🩹 PatchLens

GitHub License GitHub Release Status

AI-driven AppSec engine for automated vulnerability detection on Git commits.

Image

📦 Installation

Clone the repository and create a virtual environment:

git clone [https://github.com/foiovituh/patchlens.git](https://github.com/foiovituh/patchlens.git)
cd patchlens

python3 -m venv .venv
source .venv/bin/activate

Install the dependencies:

python -m pip install --upgrade pip
python -m pip install -e .

python -m pip ensures that pip is executed using the currently active Python interpreter. You can also use pip directly if your environment is correctly configured.

To use PatchLens in a new terminal session, activate the virtual environment again:

source .venv/bin/activate

Development environment

Install development dependencies:

python -m pip install -e ".[dev]"

🚀 Usage

PatchLens uses OpenRouter to interact with AI models. You must set your API key as an environment variable before starting the application.

export OPENROUTER_API_KEY="sk-or-v1-..."

Run the application:

python -m patchlens

Open your browser and navigate to http://127.0.0.1:5000. Paste a public GitHub commit URL to generate the security review.

Note: Response time in this initial MVP may be slow depending on the patch size and LLM latency.

🧪 Development

Run the test suite:

pytest

Generate a coverage report:

pytest --cov=patchlens --cov-report=term-missing

Run Ruff:

ruff check . --fix
ruff format .

🗺️ Roadmap

Note: PatchLens is currently in its early stages (v0.0.1) as a lean MVP. The immediate focus is core stability, code reliability, and developer experience before expanding to broader features.

  • Web interface for Git patch submission
  • Automatic GitHub patch extraction
  • AI-powered vulnerability detection (OpenRouter)
  • Internal bug hunting
  • Expand test suite
  • Extract hardcoded parameters (model selection, timeouts, max tokens)
  • Security review prompt optimization
  • Local database storage for review history
  • Private repository support via personal access tokens
  • Support for GitLab and Bitbucket
  • Claude Code extension / MCP integration
  • Export reports (JSON/PDF)
  • Dedicated CLI interface

⭐ Support the Project

If you like this project or find it useful, please give it a star! It helps increase its visibility and supports future development.

📄 License

Distributed under the MIT License. See LICENSE for more information.