Docs / Integrate
CLI — pre-commit scanner
The Perryscope CLI scans staged git changes with the same detection engine as the server, and blocks (or warns on) commits that contain secrets.
Quick start
python -m radar_scanner.cli install git commit -m "your changes" # hook scans automatically
Commands
| scan-staged [-v] [-c CONFIG] | Scan staged changes. Exit 0 = clean (or warn mode) · 1 = blocked · 2 = error |
| install [-f] [-v] | Install the pre-commit hook (-f overwrites an existing hook) |
| uninstall | Remove the hook |
| status | Show hook installation and configuration status |
Configuration — .periscope.yaml
mode: block # block | warn
threshold: 80 # confidence score (0-100)
max_scan_time_ms: 300 # timeout in milliseconds
allowlist:
patterns:
- "test_data/*.txt"
- "*.example"
secrets:
- "fake_test_token"In block mode a detection above the threshold fails the commit; in warn mode it prints findings and lets the commit through. Allowlists suppress known-safe paths and values.
Source: radar_scanner/cli/README.md · .periscope.yaml.example