PHPackages                             keyvan/screenshot-guard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. keyvan/screenshot-guard

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

keyvan/screenshot-guard
=======================

Secret scanner with OCR superpowers - finds secrets in code AND screenshots

10PythonCI failing

Since Jan 5Pushed 4mo agoCompare

[ Source](https://github.com/Keyvanhardani/screenshot-guard)[ Packagist](https://packagist.org/packages/keyvan/screenshot-guard)[ RSS](/packages/keyvan-screenshot-guard/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

 [![Screenshot Guard](docs/logo.png)](docs/logo.png)

Screenshot Guard
================

[](#screenshot-guard)

 **🔐 Secret Scanner with OCR Superpowers**

 *The first secret scanner that finds secrets in code AND screenshots.*

 [![german-ocr](docs/german-ocr-icon.png)](https://github.com/Keyvanhardani/german-ocr)
 Powered by [german-ocr](https://github.com/Keyvanhardani/german-ocr)

 [![PyPI version](https://camo.githubusercontent.com/716099ceb2fd2085e2fa92ff3b417cf742999bb9a260815f1b02d18451ae13f0/68747470733a2f2f62616467652e667572792e696f2f70792f73637265656e73686f742d67756172642e737667)](https://pypi.org/project/screenshot-guard/) [![npm version](https://camo.githubusercontent.com/842a155b0236edd2d8fc2af133f86f2cedfd0ef5d4cda9754366b2d88f4a5b07/68747470733a2f2f62616467652e667572792e696f2f6a732f73637265656e73686f742d67756172642e737667)](https://www.npmjs.com/package/screenshot-guard) [![Packagist](https://camo.githubusercontent.com/a039b4b8e33e8a3b5cbed4b6bf1dc1ab6c554f6c03c2f574968f5ecf7a7c0aeb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b657976616e2f73637265656e73686f742d6775617264)](https://packagist.org/packages/keyvan/screenshot-guard) [![License](https://camo.githubusercontent.com/a549a7a30bacba7bfceebdc207a8e86c3f2c02995a2527640dca30048fd2b64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d417061636865253230322e302d626c75652e737667)](https://opensource.org/licenses/Apache-2.0)

 [![Powered by german-ocr](https://camo.githubusercontent.com/650067e458d98fe99dc01a9c2218f0ff5847b2a58260221cbdc537a9aab8ad06/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f776572656425323062792d6765726d616e2d2d6f63722d6f72616e6765)](https://github.com/Keyvanhardani/german-ocr) [![50+ Patterns](https://camo.githubusercontent.com/39cfd0bc621b0c8d19d77e48731088fb95793999816af28b87ae87021d0f75b5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f35302b2d5365637265742532305061747465726e732d726564)](https://camo.githubusercontent.com/39cfd0bc621b0c8d19d77e48731088fb95793999816af28b87ae87021d0f75b5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f35302b2d5365637265742532305061747465726e732d726564) [![OCR Screenshots](https://camo.githubusercontent.com/a31133eb381c445766acf299fd70bd833397da97d43247729336a49cc7e7bc8e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f43522d53637265656e73686f74732d677265656e)](https://camo.githubusercontent.com/a31133eb381c445766acf299fd70bd833397da97d43247729336a49cc7e7bc8e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f43522d53637265656e73686f74732d677265656e)

---

🚨 The Problem
-------------

[](#-the-problem)

Developers take screenshots. Screenshots of terminals, dashboards, documentation.

And sometimes those screenshots contain secrets:

😱 Scenario💸 ImpactAWS keys in terminal output$47,000 cloud billAPI tokens in dashboard screenshotsData breach"Example" credentials that are actually realAccount compromise**Regular secret scanners miss all of this.**

---

💡 The Solution
--------------

[](#-the-solution)

Screenshot Guard scans your code **AND** your images using OCR.

```
# Install
pip install screenshot-guard[ocr]

# Scan
screenshot-guard scan ./your-project
```

 [![Text Files](https://camo.githubusercontent.com/43611acf3abc4b7a182bf7556ea533288335599922d8fba6f7c99b12c68d804a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5465787425323046696c65732de29c932d627269676874677265656e)](https://camo.githubusercontent.com/43611acf3abc4b7a182bf7556ea533288335599922d8fba6f7c99b12c68d804a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5465787425323046696c65732de29c932d627269676874677265656e) [![PNG](https://camo.githubusercontent.com/9decdd794fc289ee099e5d7b6e9240bdb9b658dcfb5fdfb70281883c97157f9d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504e472de29c932d627269676874677265656e)](https://camo.githubusercontent.com/9decdd794fc289ee099e5d7b6e9240bdb9b658dcfb5fdfb70281883c97157f9d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504e472de29c932d627269676874677265656e) [![JPG](https://camo.githubusercontent.com/b20dcb97a886c48856432da5dc5f24cfd3d8cde4597c93a2f0054fcad732134c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4a50472de29c932d627269676874677265656e)](https://camo.githubusercontent.com/b20dcb97a886c48856432da5dc5f24cfd3d8cde4597c93a2f0054fcad732134c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4a50472de29c932d627269676874677265656e) [![GIF](https://camo.githubusercontent.com/3133e05cc1952440cb95d65c1a2b692ade10feddbbb70ec46b2d7a8540595a07/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4749462de29c932d627269676874677265656e)](https://camo.githubusercontent.com/3133e05cc1952440cb95d65c1a2b692ade10feddbbb70ec46b2d7a8540595a07/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4749462de29c932d627269676874677265656e) [![WebP](https://camo.githubusercontent.com/59c500f3726de38088219fad2d270aae2cb4a5de0ce9940180878abab022382d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576562502de29c932d627269676874677265656e)](https://camo.githubusercontent.com/59c500f3726de38088219fad2d270aae2cb4a5de0ce9940180878abab022382d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576562502de29c932d627269676874677265656e) [![BMP](https://camo.githubusercontent.com/74e8fe2c1cee61f4e1c15f878a6ee5c49737d0e44a86fa6690031935d9426e69/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f424d502de29c932d627269676874677265656e)](https://camo.githubusercontent.com/74e8fe2c1cee61f4e1c15f878a6ee5c49737d0e44a86fa6690031935d9426e69/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f424d502de29c932d627269676874677265656e)

---

✨ Features
----------

[](#-features)

FeatureDescription🔍 **OCR-powered**Finds secrets in PNG, JPG, GIF, BMP, WebP images🎯 **50+ patterns**AWS, Azure, GCP, GitHub, Stripe, Slack, and more🏠 **Local processing**No cloud, no data leaves your machine🤖 **GitHub Action**Easy CI/CD integration with SARIF support🪝 **Pre-commit hook**Catch secrets before they're committed---

📦 Installation
--------------

[](#-installation)

### 🐍 Python

[](#-python)

```
pip install screenshot-guard[ocr]
```

### 📦 Node.js

[](#-nodejs)

```
npm install screenshot-guard
```

### 🐘 PHP

[](#-php)

```
composer require keyvan/screenshot-guard
```

### Python Installation Options

[](#python-installation-options)

CommandWhat's installed`pip install screenshot-guard`Text scanning only (no OCR)`pip install screenshot-guard[ocr]`+ [german-ocr](https://github.com/Keyvanhardani/german-ocr) with llama.cpp`pip install screenshot-guard[ollama]`+ german-ocr with Ollama backend> 💡 **Note:** You don't need to install german-ocr separately - it comes automatically with `[ocr]`!

---

⚡ Quick Start
-------------

[](#-quick-start)

### 💻 CLI Usage

[](#-cli-usage)

```
# Scan current directory
screenshot-guard scan .

# Scan with JSON output
screenshot-guard scan ./src --format json --output report.json

# Only critical and high severity
screenshot-guard scan . --severity high

# Disable OCR (faster, but misses images)
screenshot-guard scan . --no-ocr

# Use Ollama backend for OCR
screenshot-guard scan . --backend ollama
```

### 🤖 GitHub Action

[](#-github-action)

```
name: Security Scan

on: [push, pull_request]

jobs:
  secrets:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Scan for secrets
        uses: Keyvanhardani/screenshot-guard@v1
        with:
          path: '.'
          severity: 'medium'
          ocr: 'true'
          fail-on-findings: 'true'
```

### 🪝 Pre-commit Hook

[](#-pre-commit-hook)

```
# .pre-commit-config.yaml
repos:
  - repo: https://github.com/Keyvanhardani/screenshot-guard
    rev: v0.1.0
    hooks:
      - id: screenshot-guard
        args: ['--severity', 'high', '--no-ocr']
```

---

🎯 Supported Patterns
--------------------

[](#-supported-patterns)

ProviderPatternsExamples[![AWS](https://camo.githubusercontent.com/e0af866fdab56cc3fbd0f22c92cdf3c46c194c3fa6c42f483d188ead32f33182/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4157532d4646393930303f6c6f676f3d616d617a6f6e617773266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/e0af866fdab56cc3fbd0f22c92cdf3c46c194c3fa6c42f483d188ead32f33182/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4157532d4646393930303f6c6f676f3d616d617a6f6e617773266c6f676f436f6c6f723d7768697465)5Access Keys, Secret Keys, Session Tokens[![Azure](https://camo.githubusercontent.com/4375be1c49cda9bc6a19922f74c2cff04f55d9281ffcbc874f20b525b30141e3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f417a7572652d3030373844343f6c6f676f3d6d6963726f736f6674617a757265266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/4375be1c49cda9bc6a19922f74c2cff04f55d9281ffcbc874f20b525b30141e3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f417a7572652d3030373844343f6c6f676f3d6d6963726f736f6674617a757265266c6f676f436f6c6f723d7768697465)5Storage Keys, Connection Strings, SAS Tokens[![GCP](https://camo.githubusercontent.com/cbca3a264dd5849d16fbfeeade161af8c0783c4fc9c6611cb97cd3357aeb687c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4743502d3432383546343f6c6f676f3d676f6f676c65636c6f7564266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/cbca3a264dd5849d16fbfeeade161af8c0783c4fc9c6611cb97cd3357aeb687c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4743502d3432383546343f6c6f676f3d676f6f676c65636c6f7564266c6f676f436f6c6f723d7768697465)5API Keys, Service Accounts, OAuth Secrets[![GitHub](https://camo.githubusercontent.com/cee0d43a17af97546c96092b67aab45e92c11a3f36c9ad3c5486280d2fffb9d5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d3138313731373f6c6f676f3d676974687562266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/cee0d43a17af97546c96092b67aab45e92c11a3f36c9ad3c5486280d2fffb9d5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d3138313731373f6c6f676f3d676974687562266c6f676f436f6c6f723d7768697465)6PATs, OAuth Tokens, App Private Keys[![Slack](https://camo.githubusercontent.com/9fafb373f206975969feab8d540005698cfbecb963f9cf23851a686ba7869c76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f536c61636b2d3441313534423f6c6f676f3d736c61636b266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/9fafb373f206975969feab8d540005698cfbecb963f9cf23851a686ba7869c76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f536c61636b2d3441313534423f6c6f676f3d736c61636b266c6f676f436f6c6f723d7768697465)2Bot Tokens, Webhooks[![Stripe](https://camo.githubusercontent.com/04a376e7ed9676d32bdc28b18a0ffb1de205cf3170b18e258d61aa8317a61f36/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374726970652d3030384344443f6c6f676f3d737472697065266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/04a376e7ed9676d32bdc28b18a0ffb1de205cf3170b18e258d61aa8317a61f36/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374726970652d3030384344443f6c6f676f3d737472697065266c6f676f436f6c6f723d7768697465)2Secret Keys, Restricted Keys🔐 Generic15+Passwords, Private Keys, JWTs, Database URLs```
# List all patterns
screenshot-guard patterns
```

---

📊 Output Formats
----------------

[](#-output-formats)

### Table (default)

[](#table-default)

```
┌──────────────────┬──────┬────────────────────┬──────────┬────────┐
│ File             │ Line │ Type               │ Severity │ Source │
├──────────────────┼──────┼────────────────────┼──────────┼────────┤
│ screenshot.png   │ 3    │ AWS Access Key ID  │ CRITICAL │ OCR    │
│ config.yaml      │ 12   │ Database URL       │ CRITICAL │ Text   │
└──────────────────┴──────┴────────────────────┴──────────┴────────┘

```

### Export Options

[](#export-options)

FormatCommandUse Case📋 JSON`--format json`CI/CD pipelines🔒 SARIF`--format sarif`GitHub Security📝 Markdown`--format markdown`Documentation---

🔧 OCR Backends
--------------

[](#-ocr-backends)

 [ ![llama.cpp](https://camo.githubusercontent.com/1e8e4cf54c886bd6c558fcf5be16f13cb893b2e92164dd1b581b89885823cf39/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6c616d612e6370702d474755462d6f72616e6765) ](https://github.com/ggerganov/llama.cpp) [ ![Ollama](https://camo.githubusercontent.com/3d1806fd38165e5dba30bf0a86f4330d030f7a4aca327d08e747b408091db7c0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652ff09fa6992532304f6c6c616d612d4c6f63616c2d626c7565) ](https://ollama.com) [ ![Cloud](https://camo.githubusercontent.com/aebfb4824cf4f8dabe81ff8702f7d574bd73fc16ae56d7c0442af2cdcb40eaf5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652fe29881efb88f253230436c6f75642d4150492d677265656e) ](https://german-ocr.de)

BackendSpeedSetupGPU`llamacpp`⚡ Fast`pip install screenshot-guard[ocr]`Optional`ollama`⚡ FastRequires OllamaOptional`cloud`⚡⚡ FastestAPI key requiredN/A```
# Use specific backend
screenshot-guard scan . --backend llamacpp
screenshot-guard scan . --backend ollama
```

---

🔌 API Usage
-----------

[](#-api-usage)

**🐍 Python**```
from screenshot_guard import Scanner, SecretDetector, OCREngine

# Initialize
detector = SecretDetector(min_severity="high")
ocr = OCREngine(backend="llamacpp")
scanner = Scanner(detector=detector, ocr_engine=ocr)

# Scan
findings = scanner.scan("./your-project")

for finding in findings:
    print(f"{finding.file_path}:{finding.line_number} - {finding.pattern_name}")
    print(f"  Severity: {finding.severity}")
    print(f"  From OCR: {finding.from_ocr}")
```

**📦 Node.js**```
const { scan } = require('screenshot-guard');

// Scan a directory
const findings = await scan({
  path: './your-project',
  severity: 'high',
  ocr: true
});

findings.forEach(finding => {
  console.log(`${finding.file}:${finding.line} - ${finding.type}`);
  console.log(`  Severity: ${finding.severity}`);
});
```

**🐘 PHP**```
use ScreenshotGuard\Client;

$guard = new Client();
$findings = $guard->scan('./your-project', [
    'severity' => 'high'
]);

foreach ($findings as $finding) {
    echo "{$finding['file_path']}:{$finding['line_number']} - {$finding['pattern_name']}\n";
}
```

---

🙈 Ignoring Files
----------------

[](#-ignoring-files)

Create `.screenshotguardignore` in your project root:

```
# Ignore test fixtures
tests/fixtures/*

# Ignore vendor
vendor/

# Ignore specific files
docs/example-config.yaml
```

---

😱 Why OCR?
----------

[](#-why-ocr)

Real examples where OCR would have helped:

IncidentSecret ExposedCost📸 Terminal screenshot in docsAWS Access Key**$47,000** cloud bill📊 Dashboard screenshot in README"Example" API key (was real)2 months exposed💬 Slack screenshot in GitHub issueGitHub tokenRepository compromised---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md).

---

📄 License
---------

[](#-license)

Apache 2.0 - see [LICENSE](LICENSE)

---

👤 Author
--------

[](#-author)

**Keyvan Hardani**

 [![Website](https://camo.githubusercontent.com/000e9ad8321e0822914cd5a3c4e388260dcd8fa7e28e70c4b230d5645c87d7e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576562736974652d6b657976616e2e61692d626c7565)](https://keyvan.ai) [![GitHub](https://camo.githubusercontent.com/481a931c97604e5e43f75ca2eaae309eda387657feaf07f15b5eae8b529aebd4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d404b657976616e68617264616e692d3138313731373f6c6f676f3d676974687562)](https://github.com/Keyvanhardani) [![HuggingFace](https://camo.githubusercontent.com/0dbf30436b5d5dfee9a328201551b7e99cac0530e249bd1d68af55ee5dbcfaab/68747470733a2f2f696d672e736869656c64732e696f2f62616467652ff09fa49725323048756767696e67466163652d4b657976656e2d79656c6c6f77)](https://huggingface.co/Keyven)

---

 Made with ❤️ for security

 [⭐ Star us on GitHub!](https://github.com/Keyvanhardani/screenshot-guard)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance52

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e43a74516da5ca2ee14db2ec1bd13cb8e1086f09ea782d04e37d42d7cbde66a?d=identicon)[Keyvanhardani](/maintainers/Keyvanhardani)

---

Top Contributors

[![Keyvanhardani](https://avatars.githubusercontent.com/u/3466247?v=4)](https://github.com/Keyvanhardani "Keyvanhardani (18 commits)")

### Embed Badge

![Health badge](/badges/keyvan-screenshot-guard/health.svg)

```
[![Health](https://phpackages.com/badges/keyvan-screenshot-guard/health.svg)](https://phpackages.com/packages/keyvan-screenshot-guard)
```

###  Alternatives

[fullcalendar/fullcalendar-scheduler

A premium add-on to FullCalendar for displaying events and resources

78514.7k](/packages/fullcalendar-fullcalendar-scheduler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
