← 返回 Skills 市场
Gprinter
作者
yardfarmer
· GitHub ↗
· v1.0.0
· MIT-0
102
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gprinter
功能描述
Control and print text, barcodes, and QR codes on the Gprinter GP-C200V ESC/POS thermal printer via Node.js or command line.
使用说明 (SKILL.md)
GP-C200V Printer Skill
佳博 (Gainscha) GP-C200V ESC/POS 热敏打印机开发技能包。
文件结构
skill/
├── CLAUDE.md # 技能主文档 — 架构、规则、命令速查
├── esc-pos-protocol.md # ESC/POS 协议完整参考
├── print-helper.js # Node.js 可复用打印库
├── print-standalone.js # 命令行打印工具
└── README.md # 本文件
快速使用
1. 使用 Node.js 库打印
const GPPrinter = require('./print-helper');
const printer = new GPPrinter({
host: '192.168.50.189',
port: 9100,
});
await printer.connect();
// 打印文本
const cmd = printer.buildTextCommand('Hello 世界', {
align: 'center',
size: 'double',
cut: true,
});
await printer.sendRaw(cmd);
await printer.disconnect();
2. 命令行打印
# 打印文本
node print-standalone.js --text "Hello World 中文测试"
# 打印文件
node print-standalone.js --file receipt.txt
# 打印二维码
node print-standalone.js --qr "https://example.com"
# 打印条形码
node print-standalone.js --barcode CODE128 "TEST-001"
# 打印后切纸
node print-standalone.js --text "Hello" --cut
# 指定打印机
node print-standalone.js --host 192.168.1.100 --text "Test"
3. 浏览器测试页
可选,仅在需要浏览器打印时使用。需要启动
h5-usb-serial/项目中的server.js作为 TCP 桥接。打开http://localhost:3000/gp-c200v.html。
核心规则
- 中文必须用 GBK 编码 —
encodeToGb2312映射表不完整 - 切纸前必须走纸 —
ESC J 0xFF+ESC i - 使用原始字节数组 — 不要用
gpESC.createNew().setText()
关键参数
| 参数 | 值 | 说明 |
|---|---|---|
| 打印机 IP | 192.168.50.189 | WiFi 地址 |
| 端口 | 9100 | RAW 打印端口 |
| 打印宽度 | 384px | 80mm 纸满宽 |
| 每行字符 | 42(标准) / 21(双倍) | 字符容量 |
安全使用建议
This skill appears to be what it says: a Node.js/CLI helper for sending ESC/POS byte commands to a GP‑C200V printer. Before installing/running:
- Be aware it will open TCP connections to the configured printer IP/port (default 192.168.50.189:9100). Only run it in networks where that traffic is expected.
- The library has an optional HTTP bridge mode that POSTs command arrays to http://localhost:3000/send. That only matters if you run a local bridge; do not enable/start unknown services unless you understand them.
- No environment variables or secrets are required. The CLI can read any local file path you supply via --file (expected behavior) — avoid passing sensitive file paths to it.
- Operational notes: package.json lists iconv-lite but there is no install script; ensure your environment has Node and dependencies installed. There are minor code bugs (inconsistent socket.connect argument order and reliance on global fetch in sendViaBridge) that may prevent the scripts from working without small fixes.
If you trust the source and only intend to print to a known printer IP or use the local bridge intentionally, this skill is reasonably proportionate. If you do not trust the package source, review and run the contained JS files in a controlled environment first.
功能分析
Type: OpenClaw Skill
Name: gprinter
Version: 1.0.0
The skill bundle is a legitimate implementation for controlling a Gainscha GP-C200V thermal printer via the ESC/POS protocol. It includes a Node.js library (print-helper.js) and a CLI tool (print-standalone.js) that handle TCP communication, GBK encoding for Chinese text, and command generation for barcodes and QR codes. While the CLI tool can read local files for printing, this is a standard feature for its stated purpose, and no evidence of malicious intent, data exfiltration, or prompt injection was found.
能力标签
能力评估
Purpose & Capability
Name/description (GP‑C200V printer helper) matches what the files do: building ESC/POS byte arrays and sending them over raw TCP or via an optional local HTTP bridge. Declared dependencies (iconv-lite) and the use of net/fetch are appropriate for encoding GBK and sending bytes to a network printer. No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md and the scripts only instruct building ESC/POS commands, connecting to a printer IP:port, and (optionally) using a local HTTP bridge. The CLI can read a user-specified file (expected functionality). The helper contains an optional sendViaBridge() that POSTs to http://localhost:3000/send (used only if caller chooses it). Nothing in the instructions attempts to read other system secrets or external endpoints beyond the printer or local bridge. There are small implementation bugs/inconsistencies (e.g., inconsistent socket.connect argument order in different files) which may break runtime behavior but are not evidence of malicious intent.
Install Mechanism
This is instruction-only (no install spec). The package.json/package-lock declare a single dependency (iconv-lite) and package-lock points to an npm mirror — normal for Node projects. Because there is no install spec, the environment running these scripts must already provide Node and the dependency; the omission is an operational inconsistency (not a security issue) worth noting.
Credentials
The skill requests no environment variables or credentials. Network targets are limited to the configured printer IP/port (defaults to 192.168.50.189:9100) and an optional local bridge (localhost:3000). These are proportional to the printer use case. No secret-exfiltration vectors are declared or present.
Persistence & Privilege
The skill does not request permanent presence (always:false) and does not attempt to modify other skills or system-wide config. It performs network I/O only when its functions are called.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install gprinter - 安装完成后,直接呼叫该 Skill 的名称或使用
/gprinter触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: GP-C200V ESC/POS thermal printer skill with GBK Chinese text support
元数据
常见问题
Gprinter 是什么?
Control and print text, barcodes, and QR codes on the Gprinter GP-C200V ESC/POS thermal printer via Node.js or command line. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 102 次。
如何安装 Gprinter?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install gprinter」即可一键安装,无需额外配置。
Gprinter 是免费的吗?
是的,Gprinter 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Gprinter 支持哪些平台?
Gprinter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Gprinter?
由 yardfarmer(@yardfarmer)开发并维护,当前版本 v1.0.0。
推荐 Skills