qr - generate a QR code (printed right in your terminal), or read one from an image Usage: curl https://ttykit.com/qr/ curl --data "" https://ttykit.com/qr Query params: ec=L|M|Q|H error correction level (default M; H survives the most damage) invert=1 for light-background terminals (default assumes a dark one) format=svg return the QR code as an SVG image instead of terminal output format=text plain terminal output, even from a browser Examples: curl https://ttykit.com/qr/hello curl --data "https://example.com/some/long/url?a=1&b=2" https://ttykit.com/qr curl "https://ttykit.com/qr/WIFI:T:WPA;S:MyNet;P:secret;;?ec=Q" curl "https://ttykit.com/qr/hello?format=svg" > hello.svg Styling (SVG output and the browser view; terminal output is always the plain blocks): fg=0b6b3a foreground color (hex; with a # it must be %23-encoded) bg=f4f1de background color, or bg=transparent fg2=4338ca second color: diagonal gradient from fg to fg2 shape=square|round|dot size=512 SVG width/height in pixels (64-4096; it stays scalable) download=1 send the SVG as a file download curl "https://ttykit.com/qr/hello?format=svg&fg=0b6b3a&bg=f4f1de&shape=dot" > hello.svg curl "https://ttykit.com/qr/hello?format=svg&shape=round&fg=0f766e&fg2=4338ca" > hello.svg Colors must have at least 3:1 contrast against bg so the code still scans. Light-on-dark codes work in many readers but not all. Center logo (PNG or JPEG up to 256 KB; uses ec=H and a larger code to leave room): curl -F text="https://example.com" -F logo=@icon.png "https://ttykit.com/qr?format=svg" > qr.svg curl -F text="https://example.com" -F logo=@icon.png \ "https://ttykit.com/qr?format=svg&shape=dot&fg=14532d&bg=f4f1de" > qr.svg Styling options and logos only change SVG/browser output, so with plain curl you get the terminal code plus a one-line reminder of that. In the URL path, percent-encode anything that isn't plain text ("?", "#", spaces); POSTing the text as the body avoids that. Max about 2,900 bytes. (To encode the literal word "read", "check" or "scan", use: curl "https://ttykit.com/qr?text=read") Got a QR code image to decode? See ttykit.com/qr/read Already have the decoded text? See ttykit.com/qr/check Scanning with a phone? Open ttykit.com/qr/scan