qingm-cli
v0.1.4
Published
Qingm CLI for API key auth and token refresh
Readme
Qingm CLI
Qingm CLI 是一个面向 AI agent 和终端脚本的 Node.js 命令行工具。
Install
npm install -g qingm-cli安装后可以直接使用 qingm:
qingm --help也可以通过 npx 临时执行:
npx qingm-cli --helpRequires Node.js 18.17 or newer.
Quick Start
第一次使用时,保存 API key 和后端地址:
qingm auth --api-key <api-key> --base-url <base-url>qingm auth
qingm sale-order page --customer-keyword 张三
qingm sale-order page --json --page-size 100
qingm sale-order summary --order-start-time 2026-05-01 --order-end-time 2026-05-31
qingm customer search --keyword 张三
qingm warehouse manage --product-code P001
qingm product search --product-name 离焦镜片base-url 请填写站点根地址,不要包含 /prod-api。CLI 会在请求后端接口时自动拼接 /prod-api。
Commands
qingm auth
保存认证信息,并确保本地存在可用的访问令牌。
qingm auth --api-key <api-key> --base-url <base-url>
qingm auth
qingm auth --json认证接口:
POST /prod-api/api/v1/auth/apikey/loginOptions:
| Option | Description |
| --- | --- |
| --api-key <key> | 保存或临时覆盖本次登录使用的 API key |
| --base-url <url> | 保存或临时覆盖后端根地址 |
| --config-dir <dir> | 覆盖配置目录 |
| --config-file <file> | 覆盖完整配置文件路径 |
| --json | 输出机器可读 JSON |
qingm sale-order page
查询销售订单分页列表。
qingm sale-order page
qingm sale-order page --customer-keyword 张三
qingm sale-order page --code XS202605200001 --json
qingm sale-order page --order-start-time 2026-05-01 --order-end-time 2026-05-31 --page-size 100接口:
GET /prod-api/api/sale-order/page常用参数:
| Option | Description |
| --- | --- |
| --customer-keyword <text> | 客户关键字,对应后端 customerKeyword |
| --code <text> | 订单编号 |
| --order-start-time <date> | 订单开始日期,格式 YYYY-MM-DD |
| --order-end-time <date> | 订单结束日期,格式 YYYY-MM-DD |
| --audit-status <value> | 审核状态 |
| --refund-status <value> | 退款状态 |
| --page-num <n> | 页码,默认 1 |
| --page-size <n> | 每页条数,默认 100 |
| --json | 输出 JSON |
qingm sale-order summary
查询销售订单摘要列表。
qingm sale-order summary
qingm sale-order summary --order-start-time 2026-05-01 --order-end-time 2026-05-31
qingm sale-order summary --organization-id 9 --department-id 2 --json接口:
GET /prod-api/api/sale-order/query/home-page常用参数:
| Option | Description |
| --- | --- |
| --order-start-time <date> | 订单开始日期,格式 YYYY-MM-DD |
| --order-end-time <date> | 订单结束日期,格式 YYYY-MM-DD |
| --organization-id <id> | 机构 ID |
| --department-id <id> | 部门 ID |
| --json | 输出 JSON |
qingm sale-order detail <id>
查询单个销售订单详情。
qingm sale-order detail 7
qingm sale-order detail 7 --json接口:
GET /prod-api/api/sale-order/{id}qingm sale-order products <id>
查询销售订单下的产品列表。
qingm sale-order products 7
qingm sale-order products 7 --page-num 2 --page-size 20
qingm sale-order products 7 --json接口:
GET /prod-api/api/sale-order/{id}/products常用参数:
| Option | Description |
| --- | --- |
| --page-num <n> | 页码,默认 1 |
| --page-size <n> | 每页条数,默认 100 |
| --json | 输出 JSON |
qingm sale-order settlements <id>
查询销售订单结算记录。
qingm sale-order settlements 7
qingm sale-order settlements 7 --json接口:
GET /prod-api/api/sale-order/{id}/settlement/listqingm sale-order enums
查询销售订单相关枚举。
qingm sale-order enums
qingm sale-order enums --json接口:
GET /prod-api/api/sale-order/type/list
GET /prod-api/api/sale-order/audit-status/list
GET /prod-api/api/sale-order/payment-method/listqingm customer search
查询客户列表。
qingm customer search --keyword 张三
qingm customer search --phone-keyword 1380
qingm customer search --visit-time-start 2026-05-01 --visit-time-end 2026-05-31 --json接口:
GET /prod-api/api/customer/page常用参数:
| Option | Description |
| --- | --- |
| --keyword <text> | 客户关键字,对应后端 keywords |
| --phone-keyword <text> | 手机号关键字,对应后端 phoneKeyWords |
| --visit-time-start <date> | 就诊开始日期,格式 YYYY-MM-DD |
| --visit-time-end <date> | 就诊结束日期,格式 YYYY-MM-DD |
| --page-num <n> | 页码,默认 1 |
| --page-size <n> | 每页条数,默认 100 |
| --json | 输出 JSON |
qingm customer history <id>
查询客户历次检查记录。
qingm customer history 8
qingm customer history 8 --json接口:
GET /prod-api/api/customer/history/{id}qingm warehouse manage
查询库存管理列表。
qingm warehouse manage
qingm warehouse manage --product-code P001
qingm warehouse manage --organization-id 9 --json接口:
GET /prod-api/api/warehouse/manage/page常用参数:
| Option | Description |
| --- | --- |
| --product-code <text> | 产品编码 |
| --product-name <text> | 产品名称 |
| --organization-id <id> | 机构 ID |
| --brand <text> | 品牌 |
| --specifications <text> | 规格型号 |
| --page-num <n> | 页码,默认 1 |
| --page-size <n> | 每页条数,默认 100 |
| --json | 输出 JSON |
qingm warehouse sale
查询销售库存列表。
qingm warehouse sale
qingm warehouse sale --product-name 离焦镜片
qingm warehouse sale --brand 蔡司 --json接口:
GET /prod-api/api/warehouse/sale/page常用参数:
| Option | Description |
| --- | --- |
| --product-code <text> | 产品编码 |
| --product-name <text> | 产品名称 |
| --organization-id <id> | 机构 ID |
| --brand <text> | 品牌 |
| --specifications <text> | 规格型号 |
| --page-num <n> | 页码,默认 1 |
| --page-size <n> | 每页条数,默认 100 |
| --json | 输出 JSON |
qingm product search
查询产品列表。
qingm product search
qingm product search --product-name 离焦镜片
qingm product search --product-code P001 --brand 蔡司 --json接口:
GET /prod-api/api/product/page常用参数:
| Option | Description |
| --- | --- |
| --product-code <text> | 产品编码 |
| --product-name <text> | 产品名称 |
| --brand <text> | 品牌 |
| --specifications <text> | 规格型号 |
| --page-num <n> | 页码,默认 1 |
| --page-size <n> | 每页条数,默认 100 |
| --json | 输出 JSON |
License
MIT
