qrtty

main

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).
gabriele-rizzo/qrtty
grape-icon

qrtty

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

🚀 Features

  • 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

📦 Installation

Clone the repo and build with SwiftPM:

git clone https://github.com/yourusername/qrtty.git
cd qrtty
swift build -c release

Move the binary somewhere on your $PATH:

cp .build/release/qrtty /usr/local/bin/

💻 Usage

qrtty "Hello, world!"

Print inverted QR

qrtty "https://example.com" --invert

Save as PNG

qrtty "https://openai.com" -o qr.png

Set custom size

qrtty "custom size QR" --size 512 -o big.png

⚙️ Options

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

🛠 Roadmap

  • Add SVG output format
  • Add colored QR codes in terminal
  • Batch mode (generate multiple QRs from a file)

📄 License

MIT License. See LICENSE for details.

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

Last updated: Wed Apr 08 2026 19:59:38 GMT-0900 (Hawaii-Aleutian Daylight Time)