@kriston-ai/kst-im-cli 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +101 -101
- package/package.json +1 -1
- package/skills/kst-im-cli/SKILL.md +30 -22
package/package.json
CHANGED
|
@@ -3,9 +3,13 @@ name: kst-im-cli
|
|
|
3
3
|
description: 快商通 IM CLI — 渠道账号/网页站点列表、渠道与网页基础看板、历史会话查询、鉴权与配置;
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# kst-im-cli
|
|
7
|
-
|
|
8
|
-
##
|
|
6
|
+
# kst-im-cli
|
|
7
|
+
|
|
8
|
+
## 版本要求
|
|
9
|
+
|
|
10
|
+
使用 `kst-im-cli` 前必须确认版本不低于 `0.0.10`;低于该版本时,先升级 CLI 后再执行任何业务命令。
|
|
11
|
+
|
|
12
|
+
## Quick Reference
|
|
9
13
|
|
|
10
14
|
| 命令 | 说明 |
|
|
11
15
|
| --------------------------------------------------------------------------- | ---------------------------- |
|
|
@@ -33,9 +37,9 @@ description: 快商通 IM CLI — 渠道账号/网页站点列表、渠道与网
|
|
|
33
37
|
|
|
34
38
|
## Overview
|
|
35
39
|
|
|
36
|
-
`kst-im-cli` 是快商通 IM 数据查询 CLI。agent
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
`kst-im-cli` 是快商通 IM 数据查询 CLI。agent 可直接调用业务命令:CLI 优先使用已注入的环境变量,未注入时使用已有本地登录配置。所有命令默认输出 JSON 信封,stdout/stderr 分工严格。
|
|
41
|
+
|
|
42
|
+
**环境变量名**:仅支持 `KST_ONLINE_CLI_API_KEY`。agent 只能使用执行环境中已存在的该变量,不得自行赋值、覆盖、复制其他产品线的 Key 或输出 Key。环境变量优先级高于本地 `config.json`;未设置时无需补设,直接调用业务命令即可使用已有本地配置。
|
|
39
43
|
|
|
40
44
|
agent 查询历史记录前必须先调用 `history schema` 理解字段含义;不要依赖 schema 未声明的旧接口字段。
|
|
41
45
|
|
|
@@ -59,20 +63,24 @@ agent 查询历史记录前必须先调用 `history schema` 理解字段含义
|
|
|
59
63
|
|
|
60
64
|
## 认证(前置必须)
|
|
61
65
|
|
|
62
|
-
**方式一:环境变量(Agent 推荐)**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- 环境变量 trim 后非空即生效,优先级高于本地 `config.json`
|
|
72
|
-
- 空值或纯空格视为未设置,回退本地配置
|
|
73
|
-
- 401
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
**方式一:环境变量(Agent 推荐)**
|
|
67
|
+
|
|
68
|
+
执行宿主已注入非空的 `KST_ONLINE_CLI_API_KEY` 时,直接执行业务命令,无需 `auth login`:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
kst-im-cli channel type list
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- agent 只使用已存在的 `KST_ONLINE_CLI_API_KEY`,不得自行设置、修改或从其他产品线复制 Key,也不得输出 Key
|
|
75
|
+
- 环境变量 trim 后非空即生效,优先级高于本地 `config.json`
|
|
76
|
+
- 空值或纯空格视为未设置,回退本地配置
|
|
77
|
+
- 401 时提示调用方检查已注入的 `KST_ONLINE_CLI_API_KEY`,不要由 agent 自行替换 Key
|
|
78
|
+
|
|
79
|
+
**方式二:已有本地配置(无环境变量)**
|
|
80
|
+
|
|
81
|
+
未设置 `KST_ONLINE_CLI_API_KEY` 时,直接执行业务命令;CLI 会使用已有的本地登录配置。无需为此补设环境变量。
|
|
82
|
+
|
|
83
|
+
**本地配置初始化(终端用户)**
|
|
76
84
|
|
|
77
85
|
```bash
|
|
78
86
|
kst-im-cli auth login -k <API_KEY>
|
|
@@ -312,8 +320,8 @@ stats init → channel / web 看板(中文字段映射,共用 stats.json)
|
|
|
312
320
|
|
|
313
321
|
| type / 症状 | 原因 | 处理 |
|
|
314
322
|
| -------------------------- | ------------------------------ | ----------------------------------------- |
|
|
315
|
-
| `auth` | 未登录或 token 失效 |
|
|
316
|
-
| `auth` + 含 `KST_ONLINE_CLI_API_KEY` | 环境变量 key 无效或过期 |
|
|
323
|
+
| `auth` | 未登录或 token 失效 | 环境变量模式:由调用方检查已注入的 `KST_ONLINE_CLI_API_KEY`;本地模式:由终端用户完成 `auth login` 后重试 |
|
|
324
|
+
| `auth` + 含 `KST_ONLINE_CLI_API_KEY` | 环境变量 key 无效或过期 | 由调用方更新注入的 Key;agent 不替换 Key,且不回退本地配置 |
|
|
317
325
|
| `validation` | 参数错误 | 修正参数后重试 |
|
|
318
326
|
| `network` | 网络不通 | 检查网络连通性 |
|
|
319
327
|
| `api` | 服务端业务错误 | 读 `.data.content` 查看服务端响应 |
|