qrtool

CI Version License

qrtool is a command-line utility for encoding or decoding QR code.

Demonstration video

Installation

From source

sh cargo install qrtool

From binaries

The release page contains pre-built binaries for Linux, macOS and Windows.

How to build

Please see BUILD.adoc.

Usage

Basic usage

Encode a string in a QR code:

sh qrtool encode "QR code" > output.png

Generate this image:

Output

Decode a QR code from this image:

sh qrtool decode output.png

Output:

text QR code

SVG generation

sh qrtool encode -o output.svg -t svg "QR code"

Generate this image:

Output

Micro QR code generation

sh qrtool encode -v 3 --variant micro "QR code" > output.png

Generate this image:

Output

Colored output

sh qrtool encode --foreground brown "QR code" > output.png

Generate this image:

Output

Generate shell completion

--generate-completion option generates shell completions to stdout.

The following shells are supported:

Example:

sh qrtool --generate-completion bash > qrtool.bash

Integration with other programs

Both encode and decode can read from stdin and output to stdout.

The following example, the encoded result is saved as a JPEG XL image:

sh cat Cargo.toml | qrtool encode | magick png:- output.jxl

The following example, the decoded result is displayed by bat:

sh magick output.jxl png:- | qrtool decode | bat -l toml

Command-line options

Please see the following:

Changelog

Please see CHANGELOG.adoc.

Contributing

Please see CONTRIBUTING.adoc.

Acknowledgment

This program is inspired by qrencode and zbarimg.

License

Copyright © 2022–2023 Shun Sakai (see AUTHORS.adoc)

  1. This program is distributed under the terms of either the Apache License 2.0 or the MIT License.
  2. Some files are distributed under the terms of the Creative Commons Attribution 4.0 International Public License.

See COPYING for more details.