A fast, minimal CLI for generating terminal and PNG QR codes.
- Render QR codes in the terminal
- Read input from arguments or stdin
- Save QR codes as PNG files
- Invert colors or use large rendering
- Cross-platform binaries available via GitHub Releases
No install needed — run directly with npx:
npx github:asharahmed/qr-cli "https://example.com"For frequent use, install globally:
npm install -g github:asharahmed/qr-cliPrefer a binary? Download from Releases.
Pick your OS, then grab the asset from GitHub Releases.
Supported targets:
- Linux: x64, arm64
- macOS: x64, arm64, universal
- Windows: x64, arm64
Universal installers (auto-pick the right binary):
- Linux:
qr-linux-universal.sh - Windows:
qr-windows-universal.ps1
Linux (latest release):
curl -fsSL -o qr-linux-universal.sh https://github.com/asharahmed/qr-cli/releases/latest/download/qr-linux-universal.sh
bash qr-linux-universal.shWindows (latest release):
Invoke-WebRequest -Uri https://github.com/asharahmed/qr-cli/releases/latest/download/qr-windows-universal.ps1 -OutFile qr-windows-universal.ps1
powershell -ExecutionPolicy Bypass -File qr-windows-universal.ps1 -AddToPathDefaults:
- Linux installs to
$HOME/.local/bin(override with--dir /path) - Windows installs to
%LOCALAPPDATA%\\qr-cli\\bin(override with-InstallDir "C:\\path")
Latest version: see the GitHub Releases page.
| Flag | Description |
|---|---|
-i, --invert |
Invert colors (for light terminals) |
-l, --large |
Use large mode (2 chars per module) |
-f, --file <path> |
Read input from a file |
-e, --error <level> |
Error correction level: L, M, Q, H |
--format <format> |
Output format: text, png, svg |
--size <px> |
PNG size in pixels |
--margin <px> |
Quiet zone margin in modules |
--border <modules> |
Text output quiet zone size in modules |
--raw |
Do not trim input |
--quiet |
Suppress non-essential output |
-o, --output <file> |
Save output to file, or use - for stdout |
qr -l "Hello from the terminal"
qr -o code.png "https://example.com"
qr --format svg -o code.svg "https://example.com"
echo "secret message" | qr --format png -o -
echo "secret message" | qr -i- No input provided: pass text as an argument (
qr "text") or pipe stdin (echo "text" | qr). - PNG stdout error: if you see “Refusing to write PNG to terminal”, use
-o <file>or pipe output to a file. - Command not found: run with
npx github:asharahmed/qr-cli "text"or install globally via npm.
npm install
npm run build
node dist/index.js "hello"MIT
