Skip to content

asharahmed/qr-cli

Repository files navigation

QR CLI

Release Node GitHub Packages Build Release Binaries Dependencies License

qr-cli logo

CLI demo

A fast, minimal CLI for generating terminal and PNG QR codes.

Try it online | Website

Features

  • 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

Quick Start

No install needed — run directly with npx:

npx github:asharahmed/qr-cli "https://example.com"

Install

For frequent use, install globally:

npm install -g github:asharahmed/qr-cli

Prefer a binary? Download from Releases.

Release Binaries

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

Windows (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 -AddToPath

Defaults:

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

Options

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

Examples

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

Troubleshooting

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

Development

npm install
npm run build
node dist/index.js "hello"

License

MIT

About

A fast and minimal command-line interface for generating terminal and PNG QR codes.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •