Skip to content

Cli

The @qrgrid/cli is a command-line tool for generating QR codes directly in the terminal.

Installation and Usage

You can run the CLI tool without installing it globally, using one of the following package managers:

sh
npx @qrgrid/cli -i "Hello world"
sh
bunx @qrgrid/cli -i "Hello world"
sh
pnpm dlx @qrgrid/cli -i "Hello world"
sh
yarn dlx @qrgrid/cli -i "Hello world"
OptionAliasDescription
--input-iInput data for generating the QR code.
--errorCorrection-ecSet the error correction level (L, M, Q, H). Default M
--file-fSave the QR code to a specified file path. (SVG format only)
--version-vOutput the version number of the CLI.
--silent-sSkip printing the QR code to the terminal (use with -f).
--help-hDisplay help information for the CLI.

Examples

Generate and display a QR code for "Hello World" in the terminal:

sh
npx @qrgrid/cli -i "Hello World"

Generate a QR code and save it as a SVG file:

sh
npx @qrgrid/cli -i "Hello World" -f qr.svg

Run the CLI silently and save the output without displaying it:

sh
npx @qrgrid/cli -i "Hello World" -f qr.svg -s

Released under the MIT License.