360 Secure SkillHub
360 安全技能中心

Ticketmax

通过 ticketmax 命令行工具,把 Markdown 文件或标准输入渲染成 ESC/POS 打印指令,输出到热敏打印机(TCP、USB 或串口);支持标题、粗体、下划线、分隔线、表格、图片、二维码以及切纸和蜂鸣标记。

yatesdr
yatesdr
热度 43.56
最近更新 2026-05-11 17:39:43
分类:自动化依赖:代码执行 / 读写文件应用场景:报告撰写 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add ticketmax
Metadata
name
ticketmax
description
Print markdown files to an ESC/POS thermal receipt printer over TCP, USB, or serial. Supports headings, bold, underline, tables, images, QR codes, paper cuts, and buzzer.
version
0.1.3
metadata
{"openclaw":{"emoji":"🖨️","homepage":"https://github.com/yatesdr/ticketmax","requires":{"env":["PRINTER_ADDR"],"bins":["ticketmax"]},"primaryEnv":"PRINTER_ADDR","install":[{"kind":"go","package":"github.com/yatesdr/ticketmax@latest","bins":["ticketmax"]}]}}

ticketmax

Print markdown files to a thermal receipt printer. Write a .md file with standard markdown and ticketmax renders it on any ESC/POS printer over TCP, USB, or serial.

Setup

Set PRINTER_ADDR to your printer's address:

# TCP:
export PRINTER_ADDR=192.168.1.100:9100
# USB:
export PRINTER_ADDR=/dev/usb/lp0
# Serial:
export PRINTER_ADDR=/dev/ttyUSB0

Usage

# Print a markdown file
ticketmax report.md

# Pipe from stdin
echo "# Hello World" | ticketmax -

# Check printer connectivity
ticketmax -status

# Print a test receipt
ticketmax -test

Flags

Flag Default Description
-addr 127.0.0.1:9100 Printer host:port or device path (env: PRINTER_ADDR)
-baud 9600 Baud rate for serial connections
-timeout 5s Network connection timeout
-width 46 Paper width in characters (1–120)
-spacing 20 Line spacing in printer units (0–255)
-test Print test receipt and exit
-status Check connectivity and exit

Markdown Syntax

Markdown Printer Output
# Heading Bold, double-size, centered
## Heading Bold, double-width, centered
### Heading Bold
**bold text** Bold line
<u>text</u> Underlined line
--- Separator line
| A | B | Two columns (right-aligned values)
| A | B | C | Three columns
![alt](path) Print image (PNG, JPEG, GIF)
```qr QR code block
<!-- cut --> Cut paper
<!-- beep --> Buzzer (1 beep)
<!-- beep N --> Buzzer (N beeps)

Example

To print a report, write markdown to a temp file and pipe it to ticketmax:

cat <<'EOF' > /tmp/report.md
# Morning Report

## Sales

| Item | Revenue |
| --- | --- |
| Widget A | $1,234 |
| Gadget B | $567 |

---

**Low stock: Widget A (3 units)**

```qr
https://dashboard.example.com

EOF

ticketmax /tmp/report.md


Or pipe directly from stdin:

```bash
echo "# Alert\n\n**Server down at $(date)**\n\n<!-- beep 3 -->" | ticketmax -