A minimal command-line QR code generator written in Rust. Encodes arbitrary text or URLs into standalone SVG files.
- Lightweight — single binary with minimal dependencies
- SVG output — resolution-independent, opens in any browser or vector editor
- Medium error correction — QR codes remain scannable even if partially damaged
- Customizable — configurable border size, foreground color, and background color
- Simple interface — two arguments and you're done
git clone https://github.com/Amekn/flexq.git
cd flexq
cargo build --releaseThe binary will be at target/release/flexq.
cargo install flexqflexq <text> <output.svg> [OPTIONS]
| Argument | Description |
|---|---|
<text> |
The text or URL to encode into a QR code. |
<output.svg> |
The file path where the SVG will be saved. |
| Option | Short | Default | Description |
|---|---|---|---|
--border <N> |
-b |
4 |
Border size in QR modules around the code. |
--fg-color <C> |
-F |
#000000 |
Foreground (module) color of the QR code. |
--bg-color <C> |
-B |
#FFFFFF |
Background color of the QR code. |
Generate a QR code for a URL:
flexq "https://example.com" qrcode.svgGenerate a QR code for plain text:
flexq "Hello, world!" hello.svgGenerate with a larger border:
flexq "https://example.com" qrcode.svg --border 8Generate with custom colors:
flexq "https://example.com" qrcode.svg --fg-color "#FF0000" --bg-color "#FFFFCC"flexq -h
# or
flexq --helpThe generated SVG is self-contained with:
- A background rectangle (default: white, customizable via
--bg-color) - QR modules rendered as a single
<path>element (default: black, customizable via--fg-color) - A configurable border (quiet zone) around the code (default: 4 modules, set via
--border) shape-rendering="crispEdges"for sharp pixel-perfect rendering
Licensed under either the MIT license or the Apache License, Version 2.0, at your option.
Issues and pull requests are welcome. Feel free to open an issue for feature requests or bug reports.