CLI 参考¶
xq 是 xiangqin 的客户端。装好跑 xq --help 看完整子命令。
全局选项¶
默认 endpoint:http://112.124.27.213(0.1 期生产)。session 里记住的 endpoint 优先。
基础¶
xq health¶
健康检查。
认证¶
xq register <phone>¶
发送注册 / 登录验证码。返回 request_id(ULID)。60s 内重复发同号不重复扣码(返回原 request_id)。
xq verify <code> --request-id <ULID>¶
换 session。session 写 ~/.xiangqin/session.json(权限 600)。
xq logout¶
删本机 session + 服务端 session 行。
xq me¶
查当前登录态。
Profile¶
xq profile show¶
xq profile set <field> <value>¶
字段:gender / age / city / tags / bio
age必须 18-99city≤30 字tags逗号分隔(xq profile set tags 程序,登山,做饭)bio≤500 字
xq profile clear <tags|bio>¶
只允许清可空字段。gender / age / city 必填,不让清。
Query¶
xq query <WHERE> [--limit N] [--json]¶
xq query 'gender=f AND city=hangzhou AND age>=25'
xq query 'tags CONTAINS 登山' --limit 20
xq query 'gender IN (f,nb)' --json
- DSL 规则见 设计 — 受限 WHERE DSL
- 默认
--limit 50,最大 100 --json出原始 JSON 供脚本解析
Exposure(曝光)¶
xq expose buy --count N [--mock]¶
真付返回二维码 URL + 终端 ASCII 二维码;支付宝扫码付款后 webhook 回来自动充值。
xq expose balance¶
xq expose history [--limit N]¶
退出码¶
| 码 | 含义 |
|---|---|
| 0 | 成功 |
| 1 | 任意错误(网络 / 业务 / 鉴权失败) |
错误分类靠 stderr 消息文本:
未登录→ 过了 session 有效期register failed: 429→ rate limitedverify failed: 400→ 验证码错 / 过期query failed: 400→ DSL 不合规buy failed: 400→ count 超限