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
90KB
1.5K
SLoC
qrcode-ai-scanner-cli
Command-line QR code validator and scannability scorer
π¨ Artistic Β· πΌοΈ Image-embedded Β· π― Custom styled Β· πΈ Photo-captured
Validate QR codes that break standard scanners, from the command line.
Installation
From crates.io (recommended)
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
Dependencies
~32MB
~594K SLoC