#qr #validation #qr-scanner #cli-validation #scanner

app qrcode-ai-scanner-cli

CLI for QR code validation and scannability scoring - supports artistic, image-embedded, custom styled, and photo-captured QR codes

4 releases

0.2.2 Jan 26, 2026
0.2.1 Jan 26, 2026
0.2.0 Jan 26, 2026
0.1.0 Jan 26, 2026

#184 in Images

AGPL-3.0

90KB
1.5K SLoC

qrcode-ai-scanner-cli

Command-line QR code validator and scannability scorer

Crates.io License

🎨 Artistic Β· πŸ–ΌοΈ Image-embedded Β· 🎯 Custom styled Β· πŸ“Έ Photo-captured

Validate QR codes that break standard scanners, from the command line.


Installation

cargo install qrcode-ai-scanner-cli

From GitHub

cargo install --git https://github.com/supernovae-st/qrcode-ai-scanner qrcode-ai-scanner-cli

Build from source

git clone https://github.com/supernovae-st/qrcode-ai-scanner.git
cd qrcode-ai-scanner
cargo build --release -p qrcode-ai-scanner-cli
# Binary at: target/release/qrcode-ai

Add to PATH (after building)

# macOS/Linux
sudo cp target/release/qrcode-ai /usr/local/bin/

# Or add to your shell profile
echo 'export PATH="$PATH:/path/to/qrcode-ai-scanner/target/release"' >> ~/.zshrc

Usage

Basic Validation

# Full validation with visual output
qrcode-ai image.png

# JSON output
qrcode-ai -j image.png

# Score only (for scripts)
qrcode-ai -s image.png
# Output: 85

Fast Mode

# Reduced stress tests (~2x faster)
qrcode-ai -f image.png

Decode Only

# Skip stress tests, just decode
qrcode-ai -d image.png

Timing Information

# Show processing time
qrcode-ai -t image.png

Quiet Mode

# Minimal output
qrcode-ai -q image.png

Options

Flag Long Description
-s --score-only Output only the score (0-100)
-d --decode-only Decode without stress tests
-f --fast Fast validation (~2x faster)
-j --json JSON output
-t --timing Show timing info
-q --quiet Minimal output
-h --help Show help
-V --version Show version

Examples

Scripting

# Check if QR is production-ready (score >= 70)
if [ $(qrcode-ai -s image.png) -ge 70 ]; then
    echo "Production ready!"
fi

# Batch process directory
for f in *.png; do
    score=$(qrcode-ai -s "$f")
    echo "$f: $score"
done

CI/CD Integration

# GitHub Actions / GitLab CI
- name: Validate QR codes
  run: |
    for qr in assets/qr/*.png; do
      score=$(qrcode-ai -s "$qr")
      if [ $score -lt 70 ]; then
        echo "❌ $qr failed with score $score"
        exit 1
      fi
      echo "βœ… $qr passed with score $score"
    done

JSON Processing

# Extract content with jq
qrcode-ai -j image.png | jq -r '.content'

# Get all stress test results
qrcode-ai -j image.png | jq '.stress_results'

Output Format

Visual (default)

  ╔══════════════════════════════════════════════════════════════════╗
  β•‘  🌟  SCANNABILITY SCORE: 100                                   β•‘
  β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

  πŸ“„ File:    image.png
  ⏱  Time:    54ms

  πŸ“ DECODED CONTENT
  https://example.com

  πŸ§ͺ STRESS TEST RESULTS
   βœ“ Original             [PASS]
   βœ“ Downscale 50%        [PASS]
   βœ“ Downscale 25%        [PASS]
   βœ“ Blur (light)         [PASS]
   βœ“ Blur (medium)        [PASS]
   βœ“ Low Contrast         [PASS]

  πŸ“Š QR METADATA
   Version:          v2   (size complexity)
   Error Correction: M    (~15% recovery)
   Modules:          25x25  (grid size)
   Decoders:         rxing, rqrr

JSON (-j)

{
  "score": 100,
  "decodable": true,
  "content": "https://example.com",
  "metadata": {
    "version": 2,
    "error_correction": "M",
    "modules": 25,
    "decoders_success": ["rxing", "rqrr"]
  },
  "stress_results": {
    "original": true,
    "downscale_50": true,
    "downscale_25": true,
    "blur_light": true,
    "blur_medium": true,
    "low_contrast": true
  }
}

Exit Codes

Code Meaning
0 Success
1 Error (file not found, decode failed, etc.)

License

AGPL-3.0


Part of QR Code AI by Thibaut MÉLEN & SuperNovae Studio


Thibaut MΓ‰LEN    SuperNovae Studio

Dependencies

~32MB
~594K SLoC