npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

otd-mes-ops-cli

v1.0.0

Published

MES OPS CLI tool for AI-MES backend maintenance/operations API

Downloads

14

Readme

MES OPS CLI 工具

用于查询 MES 系统运维接口的命令行工具。

功能特性

  • SMT PCBA 镭雕记录查询(根据子板SN或社外码查询同一大板下所有子板信息)
  • 产品SN过站日志查询(支持子板SN/社外码/PCBA大板码查询)
  • 支持多环境配置(开发/生产/测试)
  • 支持自定义服务器地址配置
  • 支持表格和 JSON 两种输出格式

环境要求

  • Node.js >= 14.x

打包

cd otd-mes-ops-cli
npm install
npm pack

安装

# 全局安装
npm install -g ./otd-mes-ops-cli-版本号.tgz

# 或开发模式
cd otd-mes-ops-cli
npm link

命令结构

mes-ops [options] <command> [command-options]

全局选项

| 选项 | 说明 | 默认值 | |------|------|--------| | --env <env> | 环境选择:dev 或 prod | prod | | --api-url <url> | 自定义 API URL(优先级最高) | - | | --api-key <key> | API Key | - | | -V, --version | 显示版本号 | - | | -h, --help | 显示帮助信息 | - |

命令列表

config - 配置管理

mes-ops config <subcommand>
  • mes-ops config set <url> - 设置服务器地址
  • mes-ops config get - 查看当前配置
  • mes-ops config reset - 重置配置

query - 查询操作

mes-ops query <subcommand>

laser-record - 查询SMT PCBA镭雕记录

根据子板SN或社外码查询同一大板下所有子板信息。

mes-ops query laser-record --snOrOutsiteSn <子板SN或社外码>
mes-ops query laser-record --snOrOutsiteSn SN001 --json

表格输出示例:

=== SMT PCBA 镭雕记录 ===
Result: OK (200)
Sn                           | EquipmentNo     | OutsiteSn
----------------------------------------------------------------------------
SN001                        | EQ-001          | OUTSIDE-001
SN002                        | EQ-002          | OUTSIDE-002

Total: 2 sub-board(s)

confirm-log - 查询产品SN过站日志

支持子板SN、社外码、PCBA大板码查询产品的过站日志。

mes-ops query confirm-log --barcode <产品条码>
mes-ops query confirm-log --barcode SN123456 --json

表格输出示例:

=== 产品SN过站日志 ===
Result: OK (200)
Sn                       | StationNo    | ProcessNo    | ConfirmType | State  | Result   | EquipmentNo   | UserNo         | Time
-------------------------------------------------------------------------------------------------------------------------------------
SN123456                 | ST01         | PROC-A       | IN          | OK     | OK       | EQ-001        | AutoRun        | 2026-06-30 14:00:00

Total: 1 record(s)

配置文件位置

  • Linux/Mac: ~/.mes-opsrc
  • Windows: %USERPROFILE%\.mes-opsrc

环境变量

  • MES_OPS_API_URL - API 服务器地址
  • MES_OPS_API_KEY - API 认证密钥

服务器地址优先级

  1. 命令行参数 --api-url
  2. 环境变量 MES_OPS_API_URL
  3. 配置文件(通过 mes-ops config set 设置)
  4. 命令行参数 --env(dev/prod)
  5. 默认生产环境地址

环境地址

| 环境 | API 地址 | |------|----------| | dev | http://localhost:5011 | | prod | http://flex.otdmes.com.cn:60064 |

技术栈

  • Node.js
  • Commander.js - CLI 框架
  • Axios - HTTP 客户端