Install qrscan and decode your first QR code image
The QR Code Scanner CLI is QR Code AI’s open-source terminal scanner. It installs one standalone executable, qrscan, across macOS, Linux and Windows. It converts a saved image file into decoded content without a browser: your script calls qrscan, reads the JSON report and checks the shell exit code.
Install the CLI
Pick the channel for your operating system. Every route installs the exact same qrscan binary.
brew install qrcode-ai-com/tap/qrscanThe distribution and install guide also covers Debian and Ubuntu packages, Fedora RPMs, static musl binaries, the Arch Linux AUR package, an AppImage, Termux TUR and checksum-verified release archives.
The same qrscan binary also decodes barcodes: check the Barcode Scanner CLI guide.
Test with the public sample image
Download a clean QR code sample from the scanner repository and decode it locally. Passing --pretty prints a concise terminal summary of the first detection instead of JSON, while --budget-ms 0 removes the time budget.
curl -fsSL -o clean-qr.png \
https://raw.githubusercontent.com/qrcode-ai-com/qrcode-barcode-scanner-rust/main/fixtures/clean/OK_68ms_100_4e875a2c.png
qrscan clean-qr.png --pretty --budget-ms 0This example targets a POSIX shell such as bash or zsh.
Expected output
The terminal summary printed for that sample image:
content https://qrc-ai.com/76xMa
symbology QrCode
payload Url { url: "https://qrc-ai.com/76xMa" }
symbol v2 · 25x25 modules
engines rxing+rqrr
score 100/100 (Excellent)
resolution 5/5
blur 5/5
contrast 5/5
perspective 5/5
rotation 5/5
lighting 5/5
uec margin 1.00 (grade A · worst block 0/16 ec)
iso15415 overall A (informed, not certified)
contrast 1.00/A · modulation 1.00/A · axial 0.001/A · fixed-pattern 1.00/A
took 10msThe duration on the final line depends on your machine. Without --pretty, qrscan outputs the same detection as a JSON report.
Decode your own image
Pass the path to your own file, shown here as qr-reference.png. qrscan prints the full scan report as JSON and sets its exit code. If the symbol encodes https://qrcode-ai.com/, that exact address appears in the report.
qrscan "qr-reference.png" --profile fastUse fast for a quick decode, full for deeper QR quality diagnostics and frame for repeated decoding without scoring. Without --profile, qrscan defaults to full.
The “Decoded text only” snippet requires jq, a command-line JSON filter. Because a pipeline reports the exit code of jq rather than qrscan, write the JSON report to a file first before checking the exit code, or enable set -o pipefail in bash or zsh.
See the CLI command reference for every flag, output mode and exit code.
