Lens CLI

Catch issues before they are committed.

Run the Lens audit as a git pre-commit hook. It checks your staged Frappe and ERPNext code on every commit and blocks the ones with critical problems, right in your terminal.

terminal
$ git commit -m "add api endpoint"
Lens code audit.......................................Failed

BLOCK  sql-injection-percent (critical)         my_app/api.py:42
BLOCK  whitelist-no-permission-check (critical) my_app/api.py:12

Lens blocked this commit: 2 critical findings.
Fix them, or commit with --no-verify to bypass.

Set it up in three steps

Works in any Frappe or ERPNext app that uses the standardpre-commitframework. No audit engine installs on your machine.

1

Get an API key

Sign in at lens.aerele.in, open Profile → API keys, and create one. Then make it available to the hook:

export LENS_API_KEY=lens_pat_xxxxxxxx   # add to ~/.zshrc
2

Add the hook

Drop this into .pre-commit-config.yaml at your app root. pre-commit builds the CLI for you.

.pre-commit-config.yaml
repos:
  - repo: https://github.com/aerele/lens-cli
    rev: v0.1.0
    hooks:
      - id: lens-scan
3

Install and commit

Wire up the git hook. Lens now checks staged files on every commit.

pre-commit install

Fast, static, and yours to tune

The Lens engine runs Pass 1 on your staged .py, .js, and .json files server-side and returns findings in seconds. No LLM, no waiting. You decide what blocks a commit in .lens.yml.

thresholdblocks a commit on
offnothing, advisory output only
trusted-criticalhigh-confidence critical findings (default)
criticalevery critical finding
warningcriticals and warnings

Anything below the threshold still prints as advice, so you see it without being blocked. On a flaky connection the hook fails open and lets the commit through.

Private by design

Only staged files leave

Just the files in your commit are sent for scanning, never your whole repository.

No symlink surprises

Symlinks are never followed, so a staged link cannot ship a file from outside the repo.

Engine stays server-side

The rules run on Lens servers. They stay current, and nothing heavy installs on your machine.

Self-host friendly

Point LENS_API_URL at a self-hosted Lens to keep everything on your own infrastructure.

Want the full audit?

The CLI is a fast pre-commit check. For the full LLM-validated, scored report across security, ERPNext, framework, and performance, share your Frappe app repo on the Lens platform.

Run a full audit