# ed shelf qr

> Create a QR code locally from exact short text or one selected Shelf text item. No content is sent to a service.

- Canonical URL: https://getedith.pro/docs/cli/shelf/qr
- Updated: 2026-12-02

Create a QR code locally from exact short text or one selected Shelf text item.
No content is sent to a service. The code contains the supplied UTF-8 bytes,
including leading spaces, line breaks, URL query strings, and Unicode.
URLs are encoded as supplied, without shortening, fetching, or rewriting them.

```sh
ed shelf qr --text 'https://example.test/phone' --json
ed shelf qr --text 'Hello 世界' --copy
ed shelf qr --item 1 --size 2048 --output ./handoff.png --json
```

Provide exactly one of `--text` or `--item`. Item numbers follow
[`ed shelf ls`](https://getedith.pro/docs/cli/shelf/ls). An item must be a regular UTF-8 text file. Empty text,
invalid UTF-8 files, and content above 1,024 UTF-8 bytes are rejected before
copying or exporting. The limit counts bytes rather than displayed characters.

Without `--copy` or `--output`, the command previews the content and dimensions.
`--copy` copies the PNG image. `--output` creates a new PNG and refuses to
replace an existing file. Relative output paths use the caller's working directory.
If both actions are requested, saving happens before copying.

`--size` accepts 512, 1024 (default), or 2048. Width and height are exactly that
many pixels, including the opaque white border. Black square modules use whole
pixels without interpolation, with a quiet zone of at least four modules on
every side. Error correction is M. Shorter content makes a less dense code.

`--json` returns `text`, `utf8Bytes`, `width`, `height`, `format` (`png`),
`copied`, and `output` (the saved absolute path or null). `text` is the exact
payload. Human output escapes line breaks, tabs, and invisible direction controls.
Input and dimension errors exit 2; missing Shelf items follow the normal Shelf
exit codes; output errors exit 1. The Shelf index and source remain unchanged.

In the notch tray, right-click a text file and choose **Make QR Code** to load
that copy. The window previews the exact content, escaped invisible characters
and byte count, renders a small preview off the main thread, and builds the
full-size PNG only when you choose **Copy image** or **Add PNG to Shelf**, which
parks it as `QR code.png`. Closing it clears its in-memory content. No history
is stored by this tool. Scan the code with a phone and compare its result with
the content preview before using it.

- [`ed shelf`](https://getedith.pro/docs/cli/shelf)
- [All `ed` commands](https://getedith.pro/docs/cli)

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
