GitHub Copilot 条形码扫描器插件

为 GitHub Copilot 配备真正的本地条形码解码器,支持识别 16 种一维与二维条形码格式,原样返回准确编号与前导零。

安装 GitHub Copilot CLI 插件

需要 Node.js 22.19+ 或 24+。

  1. 1

    在 GitHub Copilot CLI 中依次运行这两条命令(如需锁定版本,可在第一条命令末尾追加来自 GitHub Releases 的 #<release-tag>)。

    Shell
    copilot plugin marketplace add qrcode-ai-com/qrcode-barcode-scanner-plugin
    copilot plugin install qrcode-barcode-scanner@qrcode-ai-com
  2. 2

    启动新会话并确认 qrscan 已列出 scan_image 工具。如需开启 scan_file,请在服务器环境变量中配置 QRSCAN_MCP_ALLOWED_DIRECTORIES。

  3. 3

    测试一下,向 GitHub Copilot 提问:

    请读取 barcode-reference.png 中的 Code 128 条形码,并返回完整编码值,务必保留前导零。

同时安装 qrcode-barcode-scanner Skill 与本地 stdio MCP 服务器。随时可运行 copilot plugin uninstall qrcode-barcode-scanner 卸载。

在 GitHub 查看插件

在 GitHub Copilot 任务中使用解码后的条形码

条形码扫描器返回准确的编码值与条码格式,让 GitHub Copilot 精准核对标签而不再猜测数字。

在 Copilot CLI 中校验条码标签

本地解码 Code 128、EAN-13、UPC-A 及二维条码测试样本,完整保留每一位数字与前导零。

stdio MCP 与按需开启的 scan_file

默认仅开放 scan_image(字节输入),配置 QRSCAN_MCP_ALLOWED_DIRECTORIES 后才会对白名单目录开启 scan_file。

内置 Skill 规范,零外部查询

将 MCP 与 SKILL.md 搭配使用,确保编号以原样字符串返回,不调用任何外部零售或库存接口。

在 GitHub Copilot 中实测条形码图片

准备好图片,复制示例请求,再核对返回的解码内容。

barcode-reference.png

生成 Code 128 条形码,填入 STOCK-4827 并保存为 barcode-reference.png。

让 GitHub Copilot 读取图片

Text
Read barcode-reference.png with Barcode Scanner.
Return the complete identifier as text and its format.
Preserve leading zeros. Do not run external lookups.
If the tool is unavailable or detects nothing, report that
instead of guessing.
预期结果 · Code 128
STOCK-4827

接入扫描器后,GitHub Copilot 会返回准确的条形码编号及其格式,而不再依赖猜测。

barcode-reference.png 的示例输出结果。

GitHub Copilot 条形码扫描器插件常见问题

安装路径、条形码格式、前导零保留、本地隐私保护及 MIT 许可说明。

依次运行 copilot plugin marketplace add qrcode-ai-com/qrcode-barcode-scanner-plugin 和 copilot plugin install qrcode-barcode-scanner@qrcode-ai-com 即可完成安装。

支持识别 16 种条形码格式:Code 128、Code 39、Code 93、EAN-13(含图书 ISBN)、EAN-8、UPC-A、UPC-E、ITF、Codabar、Telepen、GS1 DataBar、GS1 DataBar Expanded、Data Matrix、PDF417、Aztec 和 MaxiCode,同时也支持二维码。

是的。content.text 始终以原样字符串形式返回并完整保留前导零,EAN-13 报告还会同步解析 14 位 GS1 GTIN。解码过程不会查询任何外部零售、价格或 ISBN 数据库。

qrscan 默认仅开放 scan_image(base64 图片字节)。请在服务器环境变量中设置 QRSCAN_MCP_ALLOWED_DIRECTORIES 并重启 Copilot CLI,即可针对允许目录启用 scan_file。

所有识别结果都会在同一份 JSON 报告中一并返回,每条记录都清晰标注各自的条码格式(symbology)与准确的 content.text。建议逐条检查 symbology 字段,不要默认索引 0 一定是条形码。

依次执行 copilot plugin uninstall qrcode-barcode-scanner 和 copilot plugin marketplace remove qrcode-ai-com 即可移除。

解码全程在本地 Node.js 22.19+ 或 24+ 环境中完成(Copilot 会将对话文本发送至您配置的模型)。GitHub 上的 qrcode-barcode-scanner-plugin 与其扫描引擎当前版本均免费且采用 MIT 许可。

继续阅读其他条形码扫描器指南

阅读协议指南、切换到 GitHub Copilot 二维码指南,或浏览所有条形码集成方案。

条形码扫描器 Skill

查阅 SKILL.md、Node 辅助脚本、退出码说明以及独立的原生引擎配置方式。

阅读 Skill 指南