CommunityCoding & Developmentgithub.com

print

Print requested text, Markdown, or Excalidraw scenes on a nearby PT210 Bluetooth thermal printer from macOS.

What is print?

print is a Claude Code agent skill that print requested text, Markdown, or Excalidraw scenes on a nearby PT210 Bluetooth thermal printer from macOS.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/guzus/pt-210/tree/HEAD/skills/print

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Print on a PT210

Use the bundled helper through the complete, cloned repository. Resolve PRINT_SKILL_DIR to this skill's directory and invoke:

bash "$PRINT_SKILL_DIR/scripts/print.sh" --help

Requires macOS, uv, an awake PT210 with paper, and Bluetooth permission for the invoking app. Markdown/Excalidraw also require locally installed Google Chrome. The first dependency installation uses the network; rendering itself stays local. Do not assume this skill folder works when copied without the repo.

Connect once

bash "$PRINT_SKILL_DIR/scripts/print.sh" scan
bash "$PRINT_SKILL_DIR/scripts/print.sh" setup --address UUID_FROM_SCAN

macOS identifies BLE devices by a machine-specific UUID, not a classic Bluetooth MAC. Setup verifies a supported writable characteristic and saves the selection in ~/.config/pt210/printer.json. One uniquely discovered PT210 can be selected without --address; resolve the intended device if several match. An absent saved device never falls back to another printer. --address overrides PT210_ADDRESS, then the saved selection. inspect connects without printing.

Prepare, preview, print

Use exactly the requested content. A print request authorizes its paper output; do not add a redundant confirmation gate. Preview unfamiliar layouts first.

bash "$PRINT_SKILL_DIR/scripts/print.sh" preview --file /tmp/note.md --output /tmp/note-preview.png
bash "$PRINT_SKILL_DIR/scripts/print.sh" print --file /tmp/note.md
  • Plain text: stdin or --file. ASCII prints quickly with the built-in font; Unicode, including Korean, uses bitmap text. --mode raster forces bitmap.
  • Markdown: .md/.markdown auto-detect; use --format markdown for stdin. Preserve requested formatting. Headings, emphasis, lists, task checkboxes, quotes, code, tables and links render. Wide tables become labeled rows. Links include destinations; images become alt-text placeholders. Raw HTML stays literal, and external resources are blocked.
  • Excalidraw: .excalidraw/.excalidraw.json auto-detect; use --format excalidraw for stdin or generic JSON. Build once with build-excalidraw (requires npm). Use the saved scene, not a share URL, library, Obsidian wrapper, or PNG. Do not regenerate an edited scene from Mermaid. The official local renderer preserves geometry and scales proportionally to paper width. Small-text warnings require preview inspection; do not silently crop or rearrange. Embedded PNG/JPEG/WebP/GIF are supported; remote embeds and SVG images fail explicitly. Excalidraw and Markdown always use raster mode.

Previews never access Bluetooth and refuse to overwrite an existing file. Markdown/Excalidraw previews match printing with identical options. For plain text, use print --mode raster to match the preview; native fonts differ. Every job ends with a dashed guide and 20 mm blank tear margin. Adjust with --tear-margin-mm 0..50 or omit the guide with --no-tear-line. The default height limit is 2,400 dots (300 mm including the margin); shorten large output or explicitly raise --max-height for a requested long receipt.

Delivery and failures

Wait for the process to finish. transmitted means Bluetooth writes completed, not independent proof of paper output. Obtain paper confirmation for initial setup or new transport behavior. Local locking prevents overlapping jobs; do not bypass it. A failed/interrupted send may have partially printed: inspect the paper before retrying and never automatically resend.

If no printer is found, ask the user to turn it on nearby and disconnect phone printer apps. Use the runtime's approved permission path when Bluetooth is sandboxed. A Bluetooth denial requires user action in macOS Privacy & Security; do not edit TCC settings. Classic-Bluetooth-only variants need another verified transport; do not guess serial ports or use the office/default printer.

--transport conservative uses smaller packets for the next authorized job if output is corrupted. Printer configuration, lock files and rendered caches are local runtime state; never commit them. Full capabilities, setup, and limitations are in the repository's README.

Related Skills