QRdx
HelpGuidesDevelopersReact librarySelf-hosting

CLI

Generate styled QR codes as SVG, PNG, WebP or vector EPS from your terminal or CI with the @qrdx/cli command-line tool, one at a time or a whole CSV with qrdx batch.

@qrdx/cli renders the same QR codes as the playground and the qrdx library from the command line. It never prompts in scripts and CI, and when you run qrdx generate with no arguments in a terminal it asks for the content and options step by step.

npx @qrdx/cli generate "https://example.com" -o qr.svg

Install it globally to get the qrdx command:

npm install -g @qrdx/cli
qrdx generate "https://example.com" -o qr.png --size 1024

It needs Node.js 22 or later. PNG and WebP output use sharp, an optional dependency npm installs where your platform supports it; SVG and EPS work without it. The qrdx npm package is the React library: the CLI is only in @qrdx/cli.

Output formats

The file extension picks the format, or use --format when the file name has none.

FormatUse it for--size means
.svgWeb pages, design tools, scaling without lossWidth in pixels (default 512)
.pngDocuments, slides, anywhere that needs an imageWidth in pixels
.webpWebsites: the PNG's pixels, lossless, in a smaller fileWidth in pixels
.epsPrint shops, Illustrator, InDesignWidth in points (72 per inch, so 144 is 2 inches)

EPS files are vector PostScript. PNG and JPEG logos are embedded as they are; other logo formats are converted with sharp when it's installed, and otherwise left out with a warning.

Options

FlagDefaultDescription
-o, --outputqr.svgOutput file
--formatfrom the extensionsvg, png, webp or eps
--size512Output size (see above)
-l, --levelQError correction: L, M, Q or H
--bodysquareData module pattern
--eyesquareCorner eye pattern
--dotsquareCorner eye dot pattern
--fg, --bg#000000, #ffffffForeground and background: a hex color or a JSON gradient
--eye-color, --dot-color--fgCorner eye and eye dot colors
--logoCenter logo image URL (use with --level H)
--margin0Quiet zone, in modules
--templateArrow, StandardBox, SquareBorder, StrikedBox or Halloween
--frameCall-to-action frame: any of the 19 frame styles, such as banner-bottom, rounded-border, circle, sticker or phone (see all of them)
--frame-textScan meFrame label, up to 24 characters
--frame-color, --frame-text-colorFrame and label colors (hex)

qrdx --help lists every pattern name. Invalid values exit with code 1 and a message listing the accepted values.

Many codes from a CSV

qrdx batch writes a static QR code for every row of a CSV file into a folder:

qrdx batch products.csv -o codes --format png --size 1024 --body circle

It reads the same columns as the bulk generator: the content from a column named value, url, link, data, content, text or qr (else the first column), and file names from one named file name, name, label, id, title or sku (else qr-00001, qr-00002 and so on). Choose others by header name or column number:

FlagDefaultDescription
-o, --outqr-codesFolder for the codes
--formatsvgsvg, png or eps
--value-columnguessedColumn with each code's content
--name-columnguessedColumn with file names
--no-headerThe first row is a code, not column names
--jobs4 for SVG, 8 otherwiseCodes rendered at a time

Every style option above applies to all the codes. The CSV is read as a stream and each code is saved as soon as it's made, so the command has no row limit: on a laptop, 10,000 SVG codes took about 40 seconds and under 200 MB of memory. Nothing is uploaded and no account is needed. Rows that can't be encoded are skipped and listed with the reason in errors.csv in the output folder.

To print dynamic codes in bulk, create them first (the dashboard's CSV import or the API) and run qrdx batch on the results CSV the import gives you, with --value-column short_link.

Examples

# High-resolution PNG for print
qrdx generate "https://example.com" -o qr.png --size 2048 --level H

# Vector EPS, 2 inches wide, for a print shop
qrdx generate "https://example.com" -o qr.eps --size 144

# Branded colors and patterns
qrdx generate "https://example.com" --body circle --eye rounded --fg "#1a1a2e" -o brand.svg

# Gradient foreground
qrdx generate "https://example.com" -o gradient.svg \
  --fg '{"type":"linear","stops":[{"color":"#6366f1","offset":0},{"color":"#ec4899","offset":100}],"angle":135}'

# "Scan for the menu" frame
qrdx generate "https://example.com/menu" --frame banner-bottom --frame-text "Scan for the menu" -o menu.png

# Wi-Fi network
qrdx generate "WIFI:T:WPA;S:MyNetwork;P:MyPassword;;" -o wifi.svg

To print a dynamic QR code, pass its short link (https://qrdx.dev/q/<slug>) as the data.

Use it from an AI coding agent

The repository's generate-qr skill teaches agents such as Claude Code to call the CLI. For agents that support MCP, the MCP server needs no install at all.

Last updated on

On this page