Generate QR codes from the terminal. Fast, minimal, and easy to script.
- Single binary, no runtime dependencies
- PNG, SVG, or terminal output
- WiFi and vCard helpers
- Batch generation
- Logo overlays (PNG/SVG)
- Decode QR codes from images
- Clipboard copy + open in viewer
- Config file and
QR_*env support
brew install eliaseffects/tap/qr-cligo install github.com/eliaseffects/qr-cli@latestcurl -sSL https://raw.githubusercontent.com/eliaseffects/qr-cli/main/scripts/install.sh | bashDownload from GitHub Releases.
qr "https://example.com"
qr "Hello world" -o hello.png
qr "https://example.com" --terminal# Generate QR code
qr "https://example.com"
# Save to file
qr "Hello world" -o hello.png
# Read from stdin
echo "secret message" | qr -o secret.png
# Render in terminal
qr "https://example.com" --terminal
# Open in viewer
qr "https://example.com" --open
# Colored terminal output
qr "https://example.com" --terminal --terminal-color
# Invert terminal output
qr "https://example.com" --terminal --invertqr wifi --ssid "MyNetwork" --pass "secret123"qr vcard --name "John Doe" --phone "+1234567890" --email "john@example.com"# Custom size
qr "https://example.com" -s 512
# Custom colors
qr "https://example.com" --fg "#1a1a1a" --bg "#f0f0f0"
# High error correction
qr "https://example.com" --level H
# Add logo overlay
qr "https://example.com" --logo ./logo.pngqr batch -f urls.txt -d ./output/qr decode ./code.pngqr [data]Generate a QR code from a string or stdinqr wifiGenerate a WiFi QRqr vcardGenerate a vCard QRqr batchGenerate multiple QR codes from a fileqr decodeDecode QR codes from an imageqr versionPrint version info
-o, --outputOutput file path (default:qr.png/qr.svg)-s, --sizeImage size in pixels (default: 256)-f, --formatpng,svg, orterminal(default:png)-l, --levelError correctionL|M|Q|H(default:M)--fg,--bgHex colors (default:#000000,#ffffff)--borderBorder size in modules (default: 4)--logoLogo file path (PNG/JPEG/GIF)--logo-scaleLogo fraction of QR (default: 0.2)-t, --terminalRender in terminal--terminal-colorUse ANSI colors in terminal output--invertInvert terminal output--copyCopy output to clipboard (PNG/SVG only)--openOpen output in default viewer--configPath to config file
Config file is optional. By default qr-cli looks for qr-cli.{yaml|yml|json|toml} in:
- Current directory
~/.config/qr-cli/~(home directory)
You can also pass an explicit path with --config /path/to/config.yaml.
Example ~/.config/qr-cli/qr-cli.yaml:
size: 512
format: png
fg: "#111111"
bg: "#ffffff"
border: 4
logo: "/absolute/path/to/logo.png"
logo-scale: 0.22
wifi:
ssid: "MyNetwork"
security: "WPA"
vcard:
name: "John Doe"
email: "john@example.com"Environment variables use the QR_ prefix (dots and dashes become underscores):
export QR_SIZE=512
export QR_WIFI_SSID="MyNetwork"Completion scripts are in scripts/completions/.
- Requires Go 1.24+
- Run tests:
go test ./... - Format:
gofmt -w ./...
See docs/RELEASE.md for the Homebrew tap setup and release smoke checklist.
Contributions are welcome. See CONTRIBUTING.md.
MIT