Install qrscan and decode your first QR code image
QR Code Scanner CLI is QR Code AI’s open-source terminal scanner. It provides a single command, qrscan, across macOS, Linux and Windows. It converts an image file into decoded output without needing a browser: your script invokes qrscan, parses the JSON report and checks the exit code returned to the shell.
Install the CLI
Pick the installation method for your OS. Every channel installs the same qrscan binary.
brew install qrcode-ai-com/tap/qrscanThe distribution guide also covers Debian and Ubuntu .deb packages, Fedora RPMs, static musl binaries, the Arch Linux AUR package, an AppImage, Termux TUR and checksum-verified release archives.
The same qrscan binary decodes barcodes as well: check the Barcode Scanner CLI guide.
Test with the public sample image
Fetch a clean QR code sample from the scanner repository and run a scan. Passing --pretty prints a readable terminal summary of the first detection rather than JSON, while --budget-ms 0 disables the time limit.
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 like bash or zsh.
Expected output
Here is 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 shown on the last line varies by hardware. Omit --pretty to get the same detection as a JSON report.
Scan your own image file
Supply the path to your own image, such as qr-reference.png. qrscan outputs the full scan report in JSON and sets an exit code. When the QR code holds https://qrcode-ai.com/, that exact URL appears in the report.
qrscan "qr-reference.png" --profile fastPick fast for a quick decode, full for complete QR quality diagnostics and frame for repeated decoding without scoring. When --profile is omitted, qrscan defaults to full.
The “Decoded text only” command relies on jq to filter JSON on the command line. Remember that in a pipe the shell captures the exit code of jq rather than qrscan: to inspect the scanner’s exit code reliably, save the report to a file first or enable set -o pipefail in bash or zsh.
See the CLI reference for a full list of flags, output formats and exit codes.
