QR Code Scanner CLI

Decode QR code images from shell scripts and automated checks, returning the encoded URL or text cleanly as 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 upload

    Single binary

  • Supported platforms

    macOS, Linux, Windows

  • Scan report format

    JSON

  • Open-source licence

    MIT

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/qrscan

The 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.

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 shell such as bash or zsh.

Expected output

The terminal summary printed 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 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 fast

Use 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.

Where to install qrscan from

The three commands above cover Homebrew, Scoop and Cargo. Below are all published distribution channels by platform, each installing the same qrscan executable.

Homebrew

Install qrscan on macOS or Linux via the QR Code AI Homebrew tap. Note the installed release alongside your scripts so version upgrades remain deliberate.

Scoop (Windows)

Install qrscan on Windows x64 from the QR Code AI Scoop bucket. Check path quoting 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 binaries and checksum-verified release archives directly from GitHub Releases.

Arch Linux AUR

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

AppImage and Termux

Run the 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 with Cargo. Choose a language SDK guide when your app needs an in-process library instead of a subprocess.

How to decode a QR code image with qrscan

Install qrscan, supply an image path and verify both the JSON report and exit code before taking any follow-up action.

  1. Step 1

    Install qrscan and pick your input

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

  2. Step 2

    Check the report and exit code

    Run qrscan on the image and check stdout JSON together with the exit code: 0 decoded, 1 no code found, 2 invalid input or usage.

  3. Step 3

    Pass decoded data to your script

    Write JSON to a file, extract content.text (for example with jq) and treat every returned URL or string strictly as untrusted data.

What a decoded QR code returns

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

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

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

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

Profiles, output modes and exit codes

Profiles and output. qrscan accepts full (default, deepest QR scoring), fast (lighter scoring) and frame (decode only). Use --pretty for terminal summaries or --score-only for CI gates; exit codes 0, 1 and 2 (plus 3 for a --score-only timeout) form the reliable contract, and a null score never means zero.

Time budgets and automation. Default budgets 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 invoke qrscan inside scoped folders; see the agent integration guides.

Documentation and licence. Check the CLI command reference for every flag and the open-source scanner repository for source code, release notes and the MIT licence.

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

The CLI is built for shell scripts and CI pipelines. For another workflow, pick the matching guide below.

QR Code Scanner

Decode a single code right away in your browser with nothing to install.

Open QR code reader

QR Code Scanner Docker

Run an identical containerised scanner environment across workstations and CI runners.

Explore QR Code Scanner Docker

QR Code Scanner MCP Server

Let an AI assistant decode an image locally through a structured tool call.

Explore QR Code Scanner MCP Server

QR Code Scanner Skills

Give an AI agent a repeatable local procedure for reading QR code images.

Explore QR Code Scanner Skills

QR Code Scanner SDK

Embed local QR code scanning directly inside your own application.

Explore scanner SDK

QR Code Scanner CLI questions

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

A QR code scanner CLI is a command-line utility that decodes an image file containing a QR code and outputs the stored content. QR Code AI’s CLI is the open-source qrscan binary: your script passes an image path, parses the JSON report and checks the shell exit code. It is separate from a browser reader, a mobile camera app or an in-process SDK linked into your code.

Install and run qrscan. 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. With Rust, run cargo install --locked qrcode-barcode-scanner-cli. Then pass the path to your QR image file directly to qrscan.

Yes. qrscan reads only the saved image file you pass and never opens a webcam or mobile camera. It accepts PNG, JPEG, WebP and GIF images. PDF pages, live camera feeds and USB hardware readers sit outside the binary, so export or capture the image first.

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

No. qrscan outputs decoded content purely as data and never visits links or runs commands. Keep URL navigation and shell actions as explicit, separate steps in your script, and never interpolate returned text or a user-supplied filename directly into a shell command.

They share the same decoding engine and JSON report structure, but fit different runtimes: the CLI runs as a standalone shell process, an SDK runs inside your own application code and the Docker image bundles qrscan with its container runtime for identical builds across machines.

It returns whatever text was encoded: a URL, plain text or structured data. qrscan prints it in a JSON report, or as a concise summary when you pass --pretty. For instance, a plain-text QR holding Meeting point: North entrance returns those exact words, while a code pointing to a document or app download returns its URL rather than the file.

No. A clean decode only confirms that data was read from the image; it never verifies the target website, confirms who created the code or authorises a visit. The QR quality score estimates how reliably a design scans as a software diagnostic, not a guarantee across every mobile camera or printed surface.

No. Decoding a saved image is completely separate from QR Code AI’s creation platform and generation API. That service has free creation limits, a seven-day Premium trial triggered by the first dynamic QR code or Smart Link, and Premium requirements for continued use of affected features. CLI scanning does not trigger a trial or alter what a code holds, and the scanner itself is open source under the MIT licence.