qmai-shared
基础能力:开放平台认证、配置管理、安全规则、通用约定
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
基础能力:开放平台认证、配置管理、安全规则、通用约定
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
会员服务:资产查询与写入、手机号注册、会员更新、会员标签查询与打标
商品管理:列表、同步、上下架、估清、售罄、置满、做法启停、实时查询、批量导入导出、批量调价
聚合配送:创建、取消、查询配送订单与同步配送状态
财务服务:分账明细、支付账单、营业统计、商品销售汇总
进销存:订货、调拨、退货、入出库与库存查询
营销服务:券查询与发券、活动查询与撤销、礼品卡查询与写入、结算页算价
| name | qmai-shared |
| version | 3.0.0 |
| description | 基础能力:开放平台认证、配置管理、安全规则、通用约定 |
| metadata | {"bins":["qmai"],"help":"qmai --help"} |
qmai CLI 是门店经营命令行工具。通过企迈开放平台 (openapi.qmai.cn) 管理门店商品、门店与组织、会员、营销、订单、财务、聚合配送、进销存和排队。本 Skill 描述认证、配置和安全相关的基础能力。
qmai auth login [--profile <name>]
流程:
shop_code、base_url门店编码 shop_code:在 qmai config init(可选)或 qmai config profile add <名称> --shop-code <编码> 中配置。
| 命令 | 说明 |
|---|---|
qmai auth login | 配置开放平台凭证 |
qmai auth logout | 清除凭证(keychain + config) |
qmai-cli),Linux: libsecret~/.config/qmai/config.yaml profile 中(由 auth login 写入)config init / config profile add 等维护)每个 API 请求自动签名,无需手动操作:
grantCode=xx&nonce=xx&openId=xx×tamp=xx{openId, grantCode, nonce, timestamp, token, params}位置:~/.config/qmai/config.yaml
active_profile: default
default_format: table
debug: false
profiles:
default:
name: default
shop_code: "S001"
open_id: "d14c1559..."
grant_code: "ba67d4fa46"
store2:
name: store2
shop_code: "S002"
open_id: "..."
grant_code: "..."
flags → profile 配置 → 默认值
qmai config init # 交互式初始化
qmai config set <key> <val> # 设置配置项
qmai config get <key> # 读取配置项
qmai config list # 查看所有配置
qmai config profile add <name> --shop-code xxx # 添加 profile
qmai config profile remove <name> # 删除 profile
qmai config profile list # 列出 profiles
所有命令支持 --format flag:
| 格式 | 说明 |
|---|---|
table | 对齐的文本表格(默认,终端友好) |
json | JSON 输出(脚本友好) |
csv | CSV 输出(Excel/导入友好) |
qmai product list --debug
启用后在 Client.Call 层输出完整日志(一行包含全部信息):
[DEBUG] POST <url> | req=<完整请求JSON> | resp=<完整响应JSON> | <耗时>ms
用于排查 API 对接问题,查看实际请求参数和响应结构。
--dry-run 预览--force 确认export),建议先 --dry-runhttps://openapi.qmai.cn/{
"status": true,
"code": 0,
"message": "请求成功",
"data": { ... },
"traceId": "..."
}
qmai
├── auth 认证管理
├── config 配置管理
├── product 商品管理
├── store 门店与组织管理
├── member 会员服务
├── marketing 营销服务
├── order 订单服务
├── finance 财务服务
├── delivery 聚合配送
├── inventory 进销存
├── queue 排队服务
├── api Raw API 请求透传
├── doctor 诊断检查
├── completion Shell 自动补全
└── version 版本信息