QR Code Scanner CLI

Scan saved QR code images from shell scripts and automated pipelines. Retrieve the encoded URL or text straight as structured data.

  • Homebrew

    CLI distribution

    View install command
  • Scoop

    CLI distribution

    View install command
  • Cargo

    CLI distribution

    View install command

QR Code Scanner CLI at a glance

  • Runs locally, no cloud

    Single binary

  • Supported platforms

    macOS, Linux, Windows

  • Scan report format

    JSON

  • Open-source licence

    MIT

Install qrscan and scan your first QR code image

The QR Code Scanner CLI is QR Code AI’s open-source command-line reader for QR code images. It provides a single executable, qrscan, for macOS, Linux and Windows, with no account needed. Run it on your local machine to turn an image file into decoded data without opening a browser: your script invokes qrscan, parses the JSON report and checks the shell exit code.

Install the CLI

Pick the distribution channel that suits your operating system. Every channel provides the same qrscan binary.

brew install qrcode-ai-com/tap/qrscan

The distribution 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 decodes linear and 2D barcodes too: see the Barcode Scanner CLI guide.

Test with the public sample image

Fetch a clean QR code sample from the scanner repository and decode it locally. Passing --pretty prints a human-readable terminal summary of the first detection instead of JSON, while --budget-ms 0 disables the time budget.

Shell
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 0

This example targets a POSIX-compliant shell such as bash or zsh.

What the command outputs

The terminal summary returned for that sample image:

Text
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      10ms

The elapsed time on the final line varies according to your hardware. Without --pretty, qrscan prints the same result as a structured JSON report.

Scan your own image file

Point qrscan at a local image file, shown here as qr-reference.png. The binary writes a JSON scan report to stdout and sets its exit code accordingly. When the symbol encodes https://qrcode-ai.com/, that exact address appears in the report.

qrscan "qr-reference.png" --profile fast

Choose fast for a quick decode, full for detailed QR quality diagnostics and frame for rapid repeated decoding without scoring. If you omit --profile, qrscan defaults to full.

The “Decoded text only” example requires jq, a command-line JSON processor. Because a shell pipeline returns the exit code of jq rather than qrscan, write the JSON report to a file first to inspect qrscan’s exit code, or enable set -o pipefail in bash or zsh.

Consult the CLI reference for every flag, output mode and exit code.

Where to get qrscan

The quick-start commands above cover Homebrew, Scoop and Cargo. Below are all published distribution channels by platform, each delivering the same qrscan executable.

Homebrew

Install qrscan on macOS or Linux via the QR Code AI Homebrew tap. Pin or record the installed version alongside your scripts so upgrades happen deliberately.

Scoop (Windows)

Install qrscan on Windows x64 from the QR Code AI Scoop bucket. Check quoting rules in PowerShell or Command Prompt whenever image paths include spaces.

Linux packages and musl binaries

Download Debian and Ubuntu .deb packages, Fedora .rpm packages, static Linux musl executables and checksum-verified release archives straight from GitHub Releases.

Arch Linux AUR

Install the pre-built binary on Arch Linux and derivatives using the qrcode-barcode-scanner-bin AUR package, with versions tracked on Repology.

AppImage and Termux

Run the portable single-file AppImage on GNU/Linux without a system-wide install, or install qrscan inside Termux on Android via the Termux User Repository.

Cargo (crates.io)

Compile and install qrscan directly from crates.io using Cargo. Opt for a language SDK guide instead if your software needs an in-process library rather than a subprocess.

How to scan a QR code image with qrscan

Install qrscan, supply a saved image file and inspect both the JSON report and the exit code before acting on the result.

  1. Step 1

    Install qrscan and supply an image

    Install qrscan through Homebrew, Scoop, Cargo or a release archive. It processes only the image file you pass, never a live camera or USB scanner.

  2. Step 2

    Inspect the report and exit code

    Run qrscan against the image and check stdout JSON alongside the exit code: 0 means decoded, 1 means no code found and 2 means invalid input or usage.

  3. Step 3

    Pass the result into your script

    Save the JSON output, extract content.text (using jq for example) and treat the decoded URL or plain text strictly as data.

What a decoded QR code returns

qrscan outputs JSON detections containing content.text and payload.kind (such as url). It returns encoded text or web links without ever opening them.

A saved QR code image passes through a terminal CLI workflow and yields the decoded web link https://qrcode-ai.com/.

Extract https://qrcode-ai.com/ from qr-reference.png

When scanning qr-reference.png, qrscan reports https://qrcode-ai.com/ in content.text. Always inspect the domain before deciding whether to open a decoded URL.

Profiles, output modes and exit codes

Profiles and output. qrscan supports full (the default, with the deepest QR quality scoring), fast (lighter scoring) and frame (decoding only). Pass --pretty for a readable terminal summary or --score-only for automated shell gates; rely on exit codes 0, 1 and 2 (plus 3 when --score-only times out), and note that a null score is never equivalent to zero.

Time budgets and automation. Default time limits are 4,000 ms (full), 800 ms (fast) and 80 ms (frame). Pass --budget-ms 0 for reproducible CI runs and verify trace.budget_exhausted. AI agents can also run qrscan within scoped directories: browse the agent integration guides.

Documentation and licence. Check the CLI reference for every supported flag and visit the scanner repository for source code, changelog and the MIT licence.

CLI, Docker, MCP server, skill or SDK: which QR code scanner surface fits your workflow?

The CLI works best in shell scripts and CI pipelines. For a different environment, pick the dedicated guide below.

QR Code Scanner

Decode a single QR code straight away, directly in your browser. Nothing to install and no account needed.

Open the QR code reader

QR Code Scanner Docker

Package the same scanner runtime cleanly across every workstation and CI runner.

Explore QR Code Scanner Docker

QR Code Scanner MCP Server

Give an AI assistant local QR image decoding via a standard tool call.

Explore QR Code Scanner MCP Server

QR Code Scanner Skills

Equip a coding agent with a repeatable procedure for scanning image files.

Explore QR Code Scanner Skills

QR Code Scanner SDK

Embed local QR scanning directly into your application in your preferred language.

Explore QR Code Scanner SDK

QR Code Scanner CLI questions

Installation, supported files, empty results, safety and licensing.

A QR code scanner CLI is a command-line program that decodes a QR code from an image file and outputs its content in the terminal. QR Code AI provides the open-source qrscan command: your script passes an image path, parses the resulting JSON report and checks the exit code. It stays separate from an in-browser reader, a live camera app and an SDK compiled into your application.

Install the qrscan binary. On macOS or Linux, run brew install qrcode-ai-com/tap/qrscan. On Windows, add the QR Code AI Scoop bucket and install qrcode-barcode-scanner. If you use Rust, run cargo install --locked qrcode-barcode-scanner-cli. Once installed, run qrscan followed by the path to your image file.

Yes. qrscan reads only the saved image file you supply and never accesses a camera. It supports PNG, JPEG, WebP and GIF files. PDF documents, live webcams and USB hardware scanners are outside the tool’s scope, so render or capture an image file first.

Check both the exit code and the JSON report. Exit code 1 signals a valid scan with zero detections, whereas exit code 2 signals invalid input or command usage. Treat an empty scan result as final only when trace.budget_exhausted is false; if a time budget stopped the scan early, rerun the command with --budget-ms 0.

No. qrscan treats every decoded payload strictly as data and never opens links or runs shell commands automatically. Keep URL navigation and command execution as separate, deliberate steps in your script, and never interpolate decoded text or an untrusted filename straight into a shell command.

No. All three run the same underlying scanner engine and output the same JSON report schema, but each suits a different setup: the CLI runs as a standalone terminal process, an SDK embeds directly in your own code and the Docker image bundles qrscan in a containerised runtime.

Scanning returns the exact data encoded in the symbol, whether a web address, plain text or structured payload. qrscan outputs it as a JSON report by default, or as a compact terminal summary with --pretty. For example, a plain-text QR code holding “Meeting point: North entrance” returns those words, while a code linking to a document or app download returns its URL rather than the file itself.

No. Decoding confirms only that data could be extracted from the image file. It does not verify the linked site, identify who created or placed the code or authorise a visit. Likewise, the QR quality score measures how reliably a design reads as a software diagnostic, not a guarantee across every mobile phone camera or printed copy.

No. Decoding an existing image on your local machine is completely separate from the QR Code AI creation service and its generation API. That creation service has free creation limits, a seven-day Premium trial triggered by creating the first dynamic QR code or Smart Link, and Premium requirements to continue affected features afterwards. CLI scanning never starts that free trial, consumes no generation credits and never alters what is encoded in a code. The scanner itself is open source under the MIT licence.