@manturhub/cli 0.5.1 → 0.5.2
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/lib/skill-install.js +6 -2
- package/package.json +1 -1
package/lib/skill-install.js
CHANGED
|
@@ -4,11 +4,15 @@ import { mkdirSync, writeFileSync, rmSync } from "node:fs";
|
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
|
5
5
|
import { getKey, getBaseUrl } from "./config.js";
|
|
6
6
|
|
|
7
|
-
// `manturhub skill ls` — 列出平台上线 Skill(公开元数据,无需 key
|
|
7
|
+
// `manturhub skill ls` — 列出平台上线 Skill(公开元数据,无需 key;
|
|
8
|
+
// 配了 key 则带上——管理员租户的 key 能看到 admin 专属 Skill)。
|
|
8
9
|
export async function skillLs() {
|
|
9
10
|
let res;
|
|
10
11
|
try {
|
|
11
|
-
|
|
12
|
+
const key = getKey();
|
|
13
|
+
res = await fetch(getBaseUrl() + "/api/v1/skills", {
|
|
14
|
+
headers: key ? { "x-api-key": key } : {},
|
|
15
|
+
});
|
|
12
16
|
} catch (e) {
|
|
13
17
|
console.error(`Skill 列表获取失败: ${e.message}`);
|
|
14
18
|
process.exit(1);
|