QR Code Scanner CLI

Decode QR code images inside your shell scripts and CI checks. Receive the encoded URL or text cleanly as data.

  • Homebrew

    CLI distribution

    Check install command
  • Scoop

    CLI distribution

    Check install command
  • Cargo

    CLI distribution

    Check 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

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

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

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 like bash or zsh.

Expected output

Here is 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 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 fast

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

Installation channels for qrscan

The snippets above show Homebrew, Scoop and Cargo. Below are all official distribution channels grouped by platform; each installs the exact same qrscan binary.

Homebrew

Install qrscan on macOS or Linux via the QR Code AI Homebrew tap. Note the version you pin alongside your scripts so updates remain deliberate.

Scoop (Windows)

Install qrscan on Windows x64 through the QR Code AI Scoop bucket. Be mindful of path quoting in PowerShell or Command Prompt whenever filenames contain spaces.

Linux packages and musl binaries

Fetch Debian and Ubuntu .deb packages, Fedora .rpm builds, static Linux musl binaries and checksum-verified archives straight from GitHub Releases.

Arch Linux AUR

Install the prebuilt executable on Arch Linux and related distros using the qrcode-barcode-scanner-bin AUR package, listed on Repology.

AppImage and Termux

Execute the standalone AppImage on GNU/Linux without a system install, or install qrscan inside Termux on Android via the Termux User Repository.

Cargo (crates.io)

Compile and install qrscan straight from crates.io using Cargo. Opt for a language SDK guide if you prefer an in-process library over spawning a CLI subprocess.

How to decode a QR code image using qrscan

Install qrscan, supply an image path and verify both the JSON report and exit code before acting on the result.

  1. Step 1

    Install qrscan and select your input

    Set up qrscan via Homebrew, Scoop, Cargo or a release download. It processes only the image file you pass and never accesses a camera or USB reader.

  2. Step 2

    Inspect the JSON report and exit code

    Invoke qrscan on the file and check stdout JSON along with the exit code: 0 for decoded, 1 when no code is present, 2 for invalid input or usage.

  3. Step 3

    Pass decoded data to your script

    Redirect the JSON output to a file, read content.text (using jq, for instance), and handle the returned URL or text strictly as data.

What a decoded QR code returns

qrscan outputs JSON detections carrying content.text and payload.kind (for example url). It extracts encoded text or links without ever opening them.

A saved QR code image file passes through a terminal workflow to output the decoded value https://qrcode-ai.com/.

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

On qr-reference.png, qrscan outputs https://qrcode-ai.com/ inside content.text. Always inspect the domain before deciding whether to visit a decoded link.

Scan profiles, output modes and exit codes

Profiles and output modes. qrscan supports full (the default, deepest QR quality scoring), fast (lighter scoring) and frame (decoding only). Pass --pretty for concise terminal output or --score-only for shell checks; exit codes 0, 1 and 2 (plus 3 when --score-only times out) form the stable contract, and a null score never equates to zero.

Time budgets and CI automation. Default time limits are 4,000 ms (full), 800 ms (fast) and 80 ms (frame); add --budget-ms 0 for consistent CI runs and inspect trace.budget_exhausted. AI agents can also call qrscan inside restricted folders; see the agent integration guides.

Documentation and open-source licence. Consult the CLI reference for every flag and visit the scanner repository for the codebase, changelog and MIT licence.

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

Use the CLI for shell scripts and CI pipelines. For other setups, pick the relevant guide below.

QR Code Scanner

Scan a single code immediately in your browser with zero installation.

Open the QR code reader

QR Code Scanner Docker

Keep an identical scanner environment across developer laptops and CI runners.

Explore QR Code Scanner Docker

QR Code Scanner Skills

Supply an AI agent with a consistent step-by-step image scanning workflow.

Explore QR Code Scanner Skills

QR Code Scanner SDK

Embed local scanning directly inside your app in your chosen language.

Explore the scanner SDK

QR Code Scanner CLI questions

Setup, supported image files, empty scans, safety and licensing.

A QR code scanner CLI is a command-line utility that decodes a QR code image file and outputs its content. QR Code AI offers the open-source qrscan command: your script provides an image path, parses the resulting JSON report and checks the exit code. It is distinct from a web browser reader, a live camera app and an in-process SDK.

Install qrscan for your platform. On macOS or Linux, execute 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, call qrscan followed by your image file path.

Yes. qrscan works solely on the image file you specify and never accesses a webcam or camera. Supported formats include PNG, JPEG, WebP and GIF. PDF documents, live camera feeds and USB hardware scanners are outside its scope, so capture or export an image file first.

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

No. qrscan treats decoded values strictly as plain data and never launches URLs or executes decoded strings. Keep opening links or running commands as separate explicit logic in your script, and never interpolate decoded text or user-supplied filenames straight into a shell command.

They all rely on the same scanning engine and JSON report format, but fit different integration patterns: the CLI executes as a standalone process, an SDK runs directly inside your application code and the Docker image bundles qrscan together with its runtime.

It returns whatever text is encoded inside the QR symbol: a URL, plain text or structured data. qrscan prints this in JSON, or as a compact terminal summary when --pretty is set. For instance, a plain-text QR code holding Meeting point: North entrance outputs that exact string, while a code linking to a file or app download returns the URL rather than downloading the file.

No. Decoding a QR code only shows that data could be extracted from the image. It never certifies that the target site is trustworthy, establishes who placed the code or authorises visiting the URL. Likewise, the QR quality score is a software diagnostic of scannability, not a guarantee across every camera or printed surface.

No. Reading an existing QR image is completely independent of the QR Code AI creation service and its generation API. The creation service has free creation limits, a seven-day Premium trial triggered when you create your first dynamic QR code or Smart Link, and Premium requirements for ongoing use of those features. Decoding an image does not activate that trial and never alters the encoded content. The scanner itself is open source under the MIT licence.