qrtool is a command-line utility for encoding or decoding QR code.
sh
cargo install qrtool
The release page contains pre-built binaries for Linux, macOS and Windows.
Please see BUILD.adoc.
Encode a string in a QR code:
sh
qrtool encode "QR code" > output.png
Generate this image:
Decode a QR code from this image:
sh
qrtool decode output.png
Output:
text
QR code
sh
qrtool encode -o output.svg -t svg "QR code"
Generate this image:
sh
qrtool encode -v 3 --variant micro "QR code" > output.png
Generate this image:
sh
qrtool encode --foreground brown "QR code" > output.png
Generate this image:
--generate-completion
option generates shell completions to stdout.
The following shells are supported:
bash
elvish
fish
powershell
zsh
Example:
sh
qrtool --generate-completion bash > qrtool.bash
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
Please see the following:
Please see CHANGELOG.adoc.
Please see CONTRIBUTING.adoc.
This program is inspired by qrencode
and zbarimg
.
Copyright © 2022–2023 Shun Sakai (see AUTHORS.adoc)
See COPYRIGHT, LICENSE-APACHE, LICENSE-MIT and LICENSE-CC-BY for more details.