A simple command-line QR code generator written in Swift. Prints QR codes directly to your terminal as ASCII/Unicode blocks, or saves them as images (PNG).
- Generate QR codes from text or URLs
- Print directly in the terminal
- Save as PNG
- Adjustable output size (
--size) - Invert colors (
--invert) - Minimal and cross-platform
Clone the repo and build with SwiftPM:
git clone https://github.com/yourusername/qrtty.git
cd qrtty
swift build -c releaseMove the binary somewhere on your $PATH:
cp .build/release/qrtty /usr/local/bin/qrtty "Hello, world!"qrtty "https://example.com" --invertqrtty "https://openai.com" -o qr.pngqrtty "custom size QR" --size 512 -o big.png| Flag / Option | Description | Default |
|---|---|---|
content (argument) |
Text/URL to encode | – |
-o, --output PATH |
File path to save QR code | none |
-f, --format FORMAT |
Output format: png |
png |
-s, --size SIZE |
Output image size in pixels | 256 |
-i, --invert |
Invert dark/light blocks (ASCII + images) | false |
- Add SVG output format
- Add colored QR codes in terminal
- Batch mode (generate multiple QRs from a file)
MIT License. See LICENSE for details.