Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qrcgen

A small CLI for generating QR codes as PNG files, with optional console preview.

Install

curl (recommended)

Install the latest release:

curl -fsSL https://raw.githubusercontent.com/orashus/qrcgen/main/install.sh | bash

Install a specific version:

curl -fsSL https://raw.githubusercontent.com/orashus/qrcgen/main/install.sh | bash -s -- v1.0.0

Install to a custom directory:

INSTALL_DIR="$HOME/.local/bin" curl -fsSL https://raw.githubusercontent.com/orashus/qrcgen/main/install.sh | bash

Supported platforms: Linux and macOS on amd64 and arm64.

Go install

go install github.com/orashus/qrcgen@latest

Requires Go, and $GOPATH/bin (or $HOME/go/bin) on your PATH.

Build from source

git clone https://github.com/orashus/qrcgen.git
cd qrcgen
go build -o qrcgen .

Build with an explicit version:

go build -ldflags "-s -w -X main.version=v1.0.0" -o qrcgen .

Usage

qrcgen <text> [output file] [flags]

Examples:

# Generate qrcode.png from a URL
qrcgen https://example.com

# Write to a custom filename
qrcgen https://example.com my-qr

# Print the QR code to the terminal as well
qrcgen -p https://example.com my-qr
qrcgen https://example.com my-qr -p

# Check the installed version
qrcgen --version

Flags:

  • -p, --print — print the QR code to the console
  • -v, --version — print the installed version

If no output file is provided, the PNG is written to qrcode.png. Output names without a .png suffix get one added automatically.

Releases

Releases are published automatically when a version tag is pushed:

git tag v1.0.0
git push origin v1.0.0

Each release includes binaries for:

  • qrcgen-linux-amd64
  • qrcgen-linux-arm64
  • qrcgen-darwin-amd64
  • qrcgen-darwin-arm64
  • qrcgen-windows-amd64.exe

Release builds inject the git tag into the binary, so qrcgen --version reports the tag that was built (for example, v1.0.0). Local builds from source report dev unless a version is passed via -ldflags.

About

Generate QR codes from the command line Lightweight Go CLI to create QR code PNGs with optional terminal preview Turn text or URLs into QR code PNGs from your terminal

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages