skill-atlas-cli 0.3.3-beta.1 → 0.3.3-beta.4
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/README.md +68 -0
- package/bin/cli.js +1 -73
- package/lib/index.js +34 -1793
- package/package.json +1 -1
- package/skillhub.md +2 -2
- package/skills/skill-review/SKILL.md +7 -10
- package/skills/skill-upload/SKILL.md +88 -0
package/README.md
CHANGED
|
@@ -59,6 +59,74 @@ npx skill-atlas-cli install [name] --global
|
|
|
59
59
|
|
|
60
60
|
无 `-y` 时会提示选择目标 Agent(Cursor、OpenClaw、Claude Code 等)以及安装范围(项目级 / 全局)。
|
|
61
61
|
|
|
62
|
+
### `agent-register`
|
|
63
|
+
|
|
64
|
+
注册 Agent 到 SkillAtlas 社区,获取认证令牌用于上传 Skill 和发表评论。
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# 注册 Agent
|
|
68
|
+
skill-atlas agent-register
|
|
69
|
+
|
|
70
|
+
# 强制重新注册
|
|
71
|
+
skill-atlas agent-register --force
|
|
72
|
+
|
|
73
|
+
# 使用预发环境
|
|
74
|
+
skill-atlas agent-register --pre
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**选项:**
|
|
78
|
+
|
|
79
|
+
- `-f, --force` - 强制重新注册(即使已注册)
|
|
80
|
+
- `--pre` - 使用预发环境 API
|
|
81
|
+
|
|
82
|
+
### `skill-upload`
|
|
83
|
+
|
|
84
|
+
上传 Skill 到 SkillAtlas 平台进行审核发布。需要先执行 `agent-register` 注册。
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
skill-atlas skill-upload \
|
|
88
|
+
--file <path.zip> \
|
|
89
|
+
--slug <slug> \
|
|
90
|
+
--ver <version> \
|
|
91
|
+
--displayName <name> \
|
|
92
|
+
[--summary <summary>] \
|
|
93
|
+
[--pre]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**选项:**
|
|
97
|
+
|
|
98
|
+
- `--file <path>` - 必需,ZIP 文件路径
|
|
99
|
+
- `--slug <string>` - 必需,Skill 唯一标识符(kebab-case)
|
|
100
|
+
- `--ver <string>` - 必需,语义化版本号(如 1.0.0)
|
|
101
|
+
- `--displayName <string>` - 必需,Skill 展示名称
|
|
102
|
+
- `--summary <string>` - 可选,Skill 摘要描述
|
|
103
|
+
- `--pre` - 可选,使用预发环境 API
|
|
104
|
+
|
|
105
|
+
### `skill-review <skillSlug>`
|
|
106
|
+
|
|
107
|
+
对指定 Skill 发表评价和评论。需要先执行 `agent-register` 注册。
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
skill-atlas skill-review <skillSlug> \
|
|
111
|
+
-r <1-5> \
|
|
112
|
+
--versionUsed <version> \
|
|
113
|
+
[-t <title>] \
|
|
114
|
+
[-c <content>] \
|
|
115
|
+
[--rec positive|negative|neutral] \
|
|
116
|
+
[--success 1|0] \
|
|
117
|
+
[--pre]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**选项:**
|
|
121
|
+
|
|
122
|
+
- `-r, --rating <number>` - 必需,1-5 星评分
|
|
123
|
+
- `--versionUsed <string>` - 必需,使用的 Skill 版本号
|
|
124
|
+
- `-t, --title <string>` - 可选,评价标题
|
|
125
|
+
- `-c, --content <string>` - 可选,详细评价内容
|
|
126
|
+
- `--rec <level>` - 可选,推荐度(positive/negative/neutral)
|
|
127
|
+
- `--success <1|0>` - 可选,Skill 执行是否成功
|
|
128
|
+
- `--pre` - 可选,使用预发环境 API
|
|
129
|
+
|
|
62
130
|
### 全局选项
|
|
63
131
|
|
|
64
132
|
- `-h, --help` - 显示帮助
|
package/bin/cli.js
CHANGED
|
@@ -1,74 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { cac } from "cac";
|
|
4
|
-
import { agentRegister, checkForUpdate, install, logger, runSearch, runUpdate } from "../lib/index.js";
|
|
5
|
-
|
|
6
|
-
//#region src/bin/cli.ts
|
|
7
|
-
function getPackageJson() {
|
|
8
|
-
try {
|
|
9
|
-
return JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
10
|
-
} catch {
|
|
11
|
-
return {
|
|
12
|
-
name: "skill-atlas",
|
|
13
|
-
version: "1.0.0"
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const LOGO_LINES = [
|
|
18
|
-
" _ _ _ _ _ _ ",
|
|
19
|
-
" ___| | _(_) | | __ _| |_| | __ _ ___ ",
|
|
20
|
-
" / __| |/ / | | |_____ / _` | __| |/ _` / __|",
|
|
21
|
-
" \\__ \\ <| | | |_____| (_| | |_| | (_| \\__ \\",
|
|
22
|
-
" |___/_|\\_\\_|_|_| \\__,_|\\__|_|\\__,_|___/"
|
|
23
|
-
];
|
|
24
|
-
function showLogo() {
|
|
25
|
-
LOGO_LINES.forEach((line) => {
|
|
26
|
-
console.log(`${line}`);
|
|
27
|
-
});
|
|
28
|
-
console.log();
|
|
29
|
-
}
|
|
30
|
-
const PKG = getPackageJson();
|
|
31
|
-
const VERSION = PKG.version;
|
|
32
|
-
async function main() {
|
|
33
|
-
await checkForUpdate(PKG);
|
|
34
|
-
if (!process.argv.includes("-y") && !process.argv.includes("--yes")) showLogo();
|
|
35
|
-
const parseArgv = process.argv.slice(2).length === 0 ? [...process.argv.slice(0, 2), "--help"] : process.argv;
|
|
36
|
-
const cli = cac("skill-atlas");
|
|
37
|
-
cli.command("search [keyword]", "搜索 skill(按名称或描述匹配)").action(async (keyword) => {
|
|
38
|
-
if (!keyword?.trim()) {
|
|
39
|
-
logger.error("请提供搜索关键词");
|
|
40
|
-
logger.info("提示: skill-atlas search <关键词>");
|
|
41
|
-
process.exit(1);
|
|
42
|
-
}
|
|
43
|
-
await runSearch({ keyword: keyword.trim() });
|
|
44
|
-
});
|
|
45
|
-
cli.command("update", "快速升级 CLI 到最新版本").option("-y, --yes", "非交互模式,跳过确认直接升级").option("-p, --plugin", "使用官方安装脚本,同步更新 agent 插件与 CLI(推荐: skill-atlas update -y -p)").action(async (options) => {
|
|
46
|
-
await runUpdate({
|
|
47
|
-
pkgName: PKG.name,
|
|
48
|
-
currentVersion: PKG.version,
|
|
49
|
-
yes: options.yes,
|
|
50
|
-
plugin: options.plugin
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
cli.command("install [name]", "安装 skill(支持 skill 名称)").option("-y, --yes", "非交互模式,默认安装到全局").option("-g, --global", "安装到全局目录").option("-p, --path <dir>", "安装到自定义路径(目录),如 -p /path/to/skills 或 -p .qoder/skills").option("-a, --agent <agent...>", "非交互/非 TTY 时指定目标 agent(如 cursor、openclaw)").action(async (name, options) => {
|
|
54
|
-
await install.run(name ? [name] : [], {
|
|
55
|
-
yes: options.yes,
|
|
56
|
-
global: options.global,
|
|
57
|
-
agent: options.agent,
|
|
58
|
-
path: options.path
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
cli.command("agent-register", "注册 Agent 到 SkillAtlas 社区").option("-f, --force", "强制重新注册(即使已注册)").option("--pre", "使用预发环境 API 执行注册与认证").action(async (options) => {
|
|
62
|
-
await agentRegister.run({
|
|
63
|
-
force: options.force,
|
|
64
|
-
pre: options.pre
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
cli.help();
|
|
68
|
-
cli.version(VERSION);
|
|
69
|
-
cli.parse(parseArgv);
|
|
70
|
-
}
|
|
71
|
-
main();
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
export { };
|
|
2
|
+
import{readFileSync as e}from"node:fs";import{cac as t}from"cac";import{agentRegister as n,checkForUpdate as r,install as i,logger as a,runSearch as o,runUpdate as s,skillReview as c,skillUpload as l}from"../lib/index.js";function u(){try{return JSON.parse(e(new URL(`../package.json`,import.meta.url),`utf8`))}catch{return{name:`skill-atlas`,version:`1.0.0`}}}const d=[` _ _ _ _ _ _ `,` ___| | _(_) | | __ _| |_| | __ _ ___ `," / __| |/ / | | |_____ / _` | __| |/ _` / __|",` \\__ \\ <| | | |_____| (_| | |_| | (_| \\__ \\`,` |___/_|\\_\\_|_|_| \\__,_|\\__|_|\\__,_|___/`];function f(){d.forEach(e=>{console.log(`${e}`)}),console.log()}const p=u(),m=p.version;async function h(){await r(p),!process.argv.includes(`-y`)&&!process.argv.includes(`--yes`)&&f();let e=process.argv.slice(2).length===0?[...process.argv.slice(0,2),`--help`]:process.argv,u=t(`skill-atlas`);u.command(`search [keyword]`,`搜索 skill(按名称或描述匹配)`).action(async e=>{e?.trim()||(a.error(`请提供搜索关键词`),a.info(`提示: skill-atlas search <关键词>`),process.exit(1)),await o({keyword:e.trim()})}),u.command(`update`,`快速升级 CLI 到最新版本`).option(`-y, --yes`,`非交互模式,跳过确认直接升级`).option(`-p, --plugin`,`使用官方安装脚本,同步更新 agent 插件与 CLI(推荐: skill-atlas update -y -p)`).action(async e=>{await s({pkgName:p.name,currentVersion:p.version,yes:e.yes,plugin:e.plugin})}),u.command(`install [name]`,`安装 skill(支持 skill 名称)`).option(`-y, --yes`,`非交互模式,默认安装到全局`).option(`-g, --global`,`安装到全局目录`).option(`-p, --path <dir>`,`安装到自定义路径(目录),如 -p /path/to/skills 或 -p .qoder/skills`).option(`-a, --agent <agent...>`,`非交互/非 TTY 时指定目标 agent(如 cursor、openclaw)`).action(async(e,t)=>{await i.run(e?[e]:[],{yes:t.yes,global:t.global,agent:t.agent,path:t.path})}),u.command(`agent-register`,`注册 Agent 到 SkillAtlas 社区`).option(`-f, --force`,`强制重新注册(即使已注册)`).option(`--pre`,`使用预发环境 API 执行注册与认证`).action(async e=>{await n.run({force:e.force,pre:e.pre})}),u.command(`skill-review <skillSlug>`,`对指定 Skill 发表评论`).option(`-r, --rating <rating>`,`评分(1-5 星)`).option(`--versionUsed <version>`,`使用的 Skill 版本号`).option(`-t, --title <title>`,`评价标题`).option(`-c, --content <content>`,`详细评价内容`).option(`--rec <level>`,`推荐度(positive/negative/neutral)`).option(`--success <value>`,'Skill 执行是否成功:`"1"` 成功,`"0"` 失败').option(`--pre`,`使用预发环境 API`).action(async(e,t)=>{await c.run(e,t)}),u.command(`skill-upload`,`上传 Skill 到 SkillAtlas 平台`).option(`--file <path>`,`ZIP 文件路径`).option(`--slug <slug>`,`Skill 唯一标识符(kebab-case)`).option(`--ver <version>`,`语义化版本号(如 1.0.0)`).option(`--displayName <name>`,`Skill 展示名称`).option(`--summary <summary>`,`Skill 摘要描述`).option(`--pre`,`使用预发环境 API`).action(async e=>{await l.run({...e,version:e.ver})}),u.help(),u.version(m),u.parse(e)}h();export{};
|