@wang121ye/skillmanager 0.0.1 → 0.0.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/LICENSE +21 -21
- package/README.md +252 -219
- package/manifests/sources.json +38 -38
- package/package.json +50 -50
- package/src/cli.js +178 -178
- package/src/commands/bootstrap.js +153 -153
- package/src/commands/config.js +152 -96
- package/src/commands/select.js +79 -79
- package/src/commands/source.js +103 -103
- package/src/commands/uninstall.js +63 -63
- package/src/commands/update.js +110 -110
- package/src/commands/webui.js +150 -150
- package/src/commands/where.js +23 -23
- package/src/index.js +2 -2
- package/src/lib/concurrency.js +22 -22
- package/src/lib/config.js +75 -75
- package/src/lib/fs.js +33 -33
- package/src/lib/git.js +57 -57
- package/src/lib/http.js +42 -42
- package/src/lib/installed.js +35 -35
- package/src/lib/local-install.js +35 -35
- package/src/lib/manifest.js +84 -84
- package/src/lib/openskills.js +50 -50
- package/src/lib/paths.js +44 -44
- package/src/lib/profiles.js +31 -31
- package/src/lib/scan.js +50 -50
- package/src/lib/source-utils.js +62 -62
- package/src/ui/server.js +321 -321
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@wang121ye/skillmanager",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Cross-platform agent skill manager (bootstrap + optional Web UI selection) built on top of openskills.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"skillmanager",
|
|
7
|
-
"openskills",
|
|
8
|
-
"claude",
|
|
9
|
-
"cursor",
|
|
10
|
-
"skills",
|
|
11
|
-
"agent"
|
|
12
|
-
],
|
|
13
|
-
"homepage": "https://github.com/wangyendt/skillmanager#readme",
|
|
14
|
-
"bugs": {
|
|
15
|
-
"url": "https://github.com/wangyendt/skillmanager/issues"
|
|
16
|
-
},
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/wangyendt/skillmanager.git"
|
|
20
|
-
},
|
|
21
|
-
"publishConfig": {
|
|
22
|
-
"access": "public"
|
|
23
|
-
},
|
|
24
|
-
"license": "MIT",
|
|
25
|
-
"author": "Wayne",
|
|
26
|
-
"type": "commonjs",
|
|
27
|
-
"bin": {
|
|
28
|
-
"skillmanager": "src/cli.js"
|
|
29
|
-
},
|
|
30
|
-
"main": "src/index.js",
|
|
31
|
-
"files": [
|
|
32
|
-
"src/",
|
|
33
|
-
"manifests/"
|
|
34
|
-
],
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">=20.6.0"
|
|
37
|
-
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"test": "node -e \"console.log('no tests yet')\""
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"commander": "^13.1.0",
|
|
43
|
-
"express": "^4.21.2",
|
|
44
|
-
"fast-glob": "^3.3.2",
|
|
45
|
-
"gray-matter": "^4.0.3",
|
|
46
|
-
"openskills": "^1.5.0",
|
|
47
|
-
"simple-git": "^3.27.0",
|
|
48
|
-
"undici": "^7.4.0"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@wang121ye/skillmanager",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Cross-platform agent skill manager (bootstrap + optional Web UI selection) built on top of openskills.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"skillmanager",
|
|
7
|
+
"openskills",
|
|
8
|
+
"claude",
|
|
9
|
+
"cursor",
|
|
10
|
+
"skills",
|
|
11
|
+
"agent"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/wangyendt/skillmanager#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/wangyendt/skillmanager/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/wangyendt/skillmanager.git"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"author": "Wayne",
|
|
26
|
+
"type": "commonjs",
|
|
27
|
+
"bin": {
|
|
28
|
+
"skillmanager": "src/cli.js"
|
|
29
|
+
},
|
|
30
|
+
"main": "src/index.js",
|
|
31
|
+
"files": [
|
|
32
|
+
"src/",
|
|
33
|
+
"manifests/"
|
|
34
|
+
],
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=20.6.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"test": "node -e \"console.log('no tests yet')\""
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"commander": "^13.1.0",
|
|
43
|
+
"express": "^4.21.2",
|
|
44
|
+
"fast-glob": "^3.3.2",
|
|
45
|
+
"gray-matter": "^4.0.3",
|
|
46
|
+
"openskills": "^1.5.0",
|
|
47
|
+
"simple-git": "^3.27.0",
|
|
48
|
+
"undici": "^7.4.0"
|
|
49
|
+
}
|
|
50
|
+
}
|
package/src/cli.js
CHANGED
|
@@ -1,179 +1,179 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/* eslint-disable no-console */
|
|
3
|
-
|
|
4
|
-
const { Command } = require('commander');
|
|
5
|
-
|
|
6
|
-
const { bootstrap } = require('./commands/bootstrap');
|
|
7
|
-
const { selectUi } = require('./commands/select');
|
|
8
|
-
const { where } = require('./commands/where');
|
|
9
|
-
const { update } = require('./commands/update');
|
|
10
|
-
const { uninstall } = require('./commands/uninstall');
|
|
11
|
-
const { webui } = require('./commands/webui');
|
|
12
|
-
const { listSources, addSource, removeSource, setEnabled } = require('./commands/source');
|
|
13
|
-
const { showConfig, setDefaultProfileCmd, setRemoteProfileUrlCmd, pushProfileCmd, pullProfileCmd } = require('./commands/config');
|
|
14
|
-
|
|
15
|
-
async function main() {
|
|
16
|
-
const program = new Command();
|
|
17
|
-
|
|
18
|
-
program
|
|
19
|
-
.name('skillmanager')
|
|
20
|
-
.description('跨平台 Agent Skills 管理器(基于 openskills)')
|
|
21
|
-
.version(require('../package.json').version);
|
|
22
|
-
|
|
23
|
-
program
|
|
24
|
-
.command('install')
|
|
25
|
-
.description('安装 skills:按 sources 配置安装全部,或用 Web UI 选择子集安装。')
|
|
26
|
-
.option('--global', '安装到全局(默认:当前项目)', false)
|
|
27
|
-
.option('--universal', '使用通用目录 .agent/skills(默认:.claude/skills)', false)
|
|
28
|
-
.option('--output <path>', 'sync 输出文件(默认:AGENTS.md)')
|
|
29
|
-
.option('--no-sync', '跳过 openskills sync', false)
|
|
30
|
-
.option('--dry-run', '仅打印将执行的内容,不实际安装', false)
|
|
31
|
-
.option('--concurrency <n>', '选择模式下的并发扫描数(默认:3)', '3')
|
|
32
|
-
.option('--profile <name>', '选择配置名(默认:来自 config 或 SKILLMANAGER_PROFILE 环境变量)')
|
|
33
|
-
.action(async (opts) => {
|
|
34
|
-
await bootstrap(opts);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
program
|
|
38
|
-
.command('webui')
|
|
39
|
-
.description('打开 Web UI:用于选择并安装(install)或选择并卸载(uninstall)。')
|
|
40
|
-
.option('--mode <install|uninstall>', '模式:install(选择并安装)或 uninstall(选择并卸载)', 'install')
|
|
41
|
-
.option('--profile <name>', '作用:install 模式下使用/保存到的 profile(默认:使用默认 profile)')
|
|
42
|
-
.option('--global', '作用:把目标切到全局目录(~/.claude/skills 或 ~/.agent/skills)', false)
|
|
43
|
-
.option('--universal', '作用:使用 .agent/skills(通用 AGENTS.md 场景;默认是 .claude/skills)', false)
|
|
44
|
-
.option('--output <path>', '作用:sync 输出文件路径(默认:AGENTS.md)')
|
|
45
|
-
.option('--no-sync', '作用:不执行 openskills sync(仅安装/卸载,不更新 AGENTS.md)', false)
|
|
46
|
-
.option('--concurrency <n>', '作用:install 模式下并发拉取/扫描来源仓库,提高速度(默认:3)', '3')
|
|
47
|
-
.action(async (opts) => {
|
|
48
|
-
await webui(opts);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
program
|
|
52
|
-
.command('paths')
|
|
53
|
-
.description('打印 skillmanager 的配置/缓存目录,以及 sources.json 位置。')
|
|
54
|
-
.action(async () => {
|
|
55
|
-
await where();
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
program
|
|
59
|
-
.command('update')
|
|
60
|
-
.description('更新 skills,并同步生成/更新 AGENTS.md。')
|
|
61
|
-
.option('--global', '安装到全局(默认:当前项目)', false)
|
|
62
|
-
.option('--universal', '使用通用目录 .agent/skills(默认:.claude/skills)', false)
|
|
63
|
-
.option('--output <path>', 'sync 输出文件(默认:AGENTS.md)')
|
|
64
|
-
.option('--no-sync', '跳过 openskills sync', false)
|
|
65
|
-
.option('--profile <name>', '按 profile 选择集更新(会重新安装选中的 skills)')
|
|
66
|
-
.option('--concurrency <n>', '选择模式下的并发扫描数(默认:3)', '3')
|
|
67
|
-
.action(async (opts) => {
|
|
68
|
-
await update(opts);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
program
|
|
72
|
-
.command('uninstall')
|
|
73
|
-
.description('卸载 skills(从 .claude/skills 或 .agent/skills 删除,并可 sync 更新 AGENTS.md)。')
|
|
74
|
-
.argument('[skillNames...]', '要卸载的 skill 名称(目录名),可多个')
|
|
75
|
-
.option('--global', '卸载全局目录(默认:当前项目)', false)
|
|
76
|
-
.option('--universal', '使用通用目录 .agent/skills(默认:.claude/skills)', false)
|
|
77
|
-
.option('--all', '卸载目标目录下所有已安装 skills', false)
|
|
78
|
-
.option('--output <path>', 'sync 输出文件(默认:AGENTS.md)')
|
|
79
|
-
.option('--no-sync', '跳过 openskills sync', false)
|
|
80
|
-
.action(async (skillNames, opts) => {
|
|
81
|
-
await uninstall(opts, skillNames);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
const config = program.command('config').description('配置管理:默认 profile、Web UI 选择等。');
|
|
85
|
-
|
|
86
|
-
config
|
|
87
|
-
.command('set-default-profile')
|
|
88
|
-
.description('设置默认 profile(当你不传 --profile 时会用它)。')
|
|
89
|
-
.argument('<name>', 'profile 名称,例如 laptop')
|
|
90
|
-
.action(async (name) => {
|
|
91
|
-
await setDefaultProfileCmd(name);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
config
|
|
95
|
-
.command('set-remote-profile-url')
|
|
96
|
-
.description('设置远端 profile URL(用于 config push/pull)。')
|
|
97
|
-
.argument('<url>', '例如 https://<bucket>.<region>.aliyuncs.com/skillmanager_profile.json')
|
|
98
|
-
.action(async (url) => {
|
|
99
|
-
await setRemoteProfileUrlCmd(url);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
config
|
|
103
|
-
.command('push')
|
|
104
|
-
.description('上传某个 profile 到远端 URL(HTTP PUT)。')
|
|
105
|
-
.option('--profile <name>', 'profile 名称(默认:default)', 'default')
|
|
106
|
-
.option('--url <url>', '远端 URL(可省略,使用 config.remoteProfileUrl 或 SKILLMANAGER_PROFILE_URL)')
|
|
107
|
-
.action(async (opts) => {
|
|
108
|
-
await pushProfileCmd(opts);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
config
|
|
112
|
-
.command('pull')
|
|
113
|
-
.description('从远端 URL 下载 profile 并保存到本地(HTTP GET)。')
|
|
114
|
-
.option('--profile <name>', 'profile 名称(默认:default)', 'default')
|
|
115
|
-
.option('--url <url>', '远端 URL(可省略,使用 config.remoteProfileUrl 或 SKILLMANAGER_PROFILE_URL)')
|
|
116
|
-
.action(async (opts) => {
|
|
117
|
-
await pullProfileCmd(opts);
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
config
|
|
121
|
-
.command('show')
|
|
122
|
-
.description('显示配置(含默认 profile)。')
|
|
123
|
-
.action(async () => {
|
|
124
|
-
await showConfig();
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const source = program.command('source').description('管理 skills 来源仓库(官方/第三方/自研)。');
|
|
128
|
-
|
|
129
|
-
source
|
|
130
|
-
.command('list')
|
|
131
|
-
.description('列出当前 sources.json 中的来源。')
|
|
132
|
-
.action(async () => {
|
|
133
|
-
await listSources();
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
source
|
|
137
|
-
.command('add')
|
|
138
|
-
.description('添加来源:支持 owner/repo、GitHub URL、或 git@... SSH URL。')
|
|
139
|
-
.argument('<repoOrRef>', '例如 ComposioHQ/awesome-claude-skills 或 https://github.com/obra/superpowers')
|
|
140
|
-
.option('--id <id>', '指定来源 id(可选)')
|
|
141
|
-
.option('--name <name>', '显示名称(可选)')
|
|
142
|
-
.option('--ref <openskillsRef>', '指定 openskillsRef(可选,形如 owner/repo)')
|
|
143
|
-
.option('--disabled', '添加为禁用(bootstrap 默认不安装)', false)
|
|
144
|
-
.action(async (repoOrRef, opts) => {
|
|
145
|
-
await addSource(repoOrRef, opts);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
source
|
|
149
|
-
.command('remove')
|
|
150
|
-
.description('删除来源(按 id)。')
|
|
151
|
-
.argument('<id>', '来源 id')
|
|
152
|
-
.action(async (id) => {
|
|
153
|
-
await removeSource(id);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
source
|
|
157
|
-
.command('enable')
|
|
158
|
-
.description('启用来源(按 id)。')
|
|
159
|
-
.argument('<id>', '来源 id')
|
|
160
|
-
.action(async (id) => {
|
|
161
|
-
await setEnabled(id, true);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
source
|
|
165
|
-
.command('disable')
|
|
166
|
-
.description('禁用来源(按 id)。')
|
|
167
|
-
.argument('<id>', '来源 id')
|
|
168
|
-
.action(async (id) => {
|
|
169
|
-
await setEnabled(id, false);
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
await program.parseAsync(process.argv);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
main().catch((err) => {
|
|
176
|
-
console.error(err?.stack || String(err));
|
|
177
|
-
process.exitCode = 1;
|
|
178
|
-
});
|
|
179
|
-
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
|
|
4
|
+
const { Command } = require('commander');
|
|
5
|
+
|
|
6
|
+
const { bootstrap } = require('./commands/bootstrap');
|
|
7
|
+
const { selectUi } = require('./commands/select');
|
|
8
|
+
const { where } = require('./commands/where');
|
|
9
|
+
const { update } = require('./commands/update');
|
|
10
|
+
const { uninstall } = require('./commands/uninstall');
|
|
11
|
+
const { webui } = require('./commands/webui');
|
|
12
|
+
const { listSources, addSource, removeSource, setEnabled } = require('./commands/source');
|
|
13
|
+
const { showConfig, setDefaultProfileCmd, setRemoteProfileUrlCmd, pushProfileCmd, pullProfileCmd } = require('./commands/config');
|
|
14
|
+
|
|
15
|
+
async function main() {
|
|
16
|
+
const program = new Command();
|
|
17
|
+
|
|
18
|
+
program
|
|
19
|
+
.name('skillmanager')
|
|
20
|
+
.description('跨平台 Agent Skills 管理器(基于 openskills)')
|
|
21
|
+
.version(require('../package.json').version);
|
|
22
|
+
|
|
23
|
+
program
|
|
24
|
+
.command('install')
|
|
25
|
+
.description('安装 skills:按 sources 配置安装全部,或用 Web UI 选择子集安装。')
|
|
26
|
+
.option('--global', '安装到全局(默认:当前项目)', false)
|
|
27
|
+
.option('--universal', '使用通用目录 .agent/skills(默认:.claude/skills)', false)
|
|
28
|
+
.option('--output <path>', 'sync 输出文件(默认:AGENTS.md)')
|
|
29
|
+
.option('--no-sync', '跳过 openskills sync', false)
|
|
30
|
+
.option('--dry-run', '仅打印将执行的内容,不实际安装', false)
|
|
31
|
+
.option('--concurrency <n>', '选择模式下的并发扫描数(默认:3)', '3')
|
|
32
|
+
.option('--profile <name>', '选择配置名(默认:来自 config 或 SKILLMANAGER_PROFILE 环境变量)')
|
|
33
|
+
.action(async (opts) => {
|
|
34
|
+
await bootstrap(opts);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
program
|
|
38
|
+
.command('webui')
|
|
39
|
+
.description('打开 Web UI:用于选择并安装(install)或选择并卸载(uninstall)。')
|
|
40
|
+
.option('--mode <install|uninstall>', '模式:install(选择并安装)或 uninstall(选择并卸载)', 'install')
|
|
41
|
+
.option('--profile <name>', '作用:install 模式下使用/保存到的 profile(默认:使用默认 profile)')
|
|
42
|
+
.option('--global', '作用:把目标切到全局目录(~/.claude/skills 或 ~/.agent/skills)', false)
|
|
43
|
+
.option('--universal', '作用:使用 .agent/skills(通用 AGENTS.md 场景;默认是 .claude/skills)', false)
|
|
44
|
+
.option('--output <path>', '作用:sync 输出文件路径(默认:AGENTS.md)')
|
|
45
|
+
.option('--no-sync', '作用:不执行 openskills sync(仅安装/卸载,不更新 AGENTS.md)', false)
|
|
46
|
+
.option('--concurrency <n>', '作用:install 模式下并发拉取/扫描来源仓库,提高速度(默认:3)', '3')
|
|
47
|
+
.action(async (opts) => {
|
|
48
|
+
await webui(opts);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
program
|
|
52
|
+
.command('paths')
|
|
53
|
+
.description('打印 skillmanager 的配置/缓存目录,以及 sources.json 位置。')
|
|
54
|
+
.action(async () => {
|
|
55
|
+
await where();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
program
|
|
59
|
+
.command('update')
|
|
60
|
+
.description('更新 skills,并同步生成/更新 AGENTS.md。')
|
|
61
|
+
.option('--global', '安装到全局(默认:当前项目)', false)
|
|
62
|
+
.option('--universal', '使用通用目录 .agent/skills(默认:.claude/skills)', false)
|
|
63
|
+
.option('--output <path>', 'sync 输出文件(默认:AGENTS.md)')
|
|
64
|
+
.option('--no-sync', '跳过 openskills sync', false)
|
|
65
|
+
.option('--profile <name>', '按 profile 选择集更新(会重新安装选中的 skills)')
|
|
66
|
+
.option('--concurrency <n>', '选择模式下的并发扫描数(默认:3)', '3')
|
|
67
|
+
.action(async (opts) => {
|
|
68
|
+
await update(opts);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
program
|
|
72
|
+
.command('uninstall')
|
|
73
|
+
.description('卸载 skills(从 .claude/skills 或 .agent/skills 删除,并可 sync 更新 AGENTS.md)。')
|
|
74
|
+
.argument('[skillNames...]', '要卸载的 skill 名称(目录名),可多个')
|
|
75
|
+
.option('--global', '卸载全局目录(默认:当前项目)', false)
|
|
76
|
+
.option('--universal', '使用通用目录 .agent/skills(默认:.claude/skills)', false)
|
|
77
|
+
.option('--all', '卸载目标目录下所有已安装 skills', false)
|
|
78
|
+
.option('--output <path>', 'sync 输出文件(默认:AGENTS.md)')
|
|
79
|
+
.option('--no-sync', '跳过 openskills sync', false)
|
|
80
|
+
.action(async (skillNames, opts) => {
|
|
81
|
+
await uninstall(opts, skillNames);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const config = program.command('config').description('配置管理:默认 profile、Web UI 选择等。');
|
|
85
|
+
|
|
86
|
+
config
|
|
87
|
+
.command('set-default-profile')
|
|
88
|
+
.description('设置默认 profile(当你不传 --profile 时会用它)。')
|
|
89
|
+
.argument('<name>', 'profile 名称,例如 laptop')
|
|
90
|
+
.action(async (name) => {
|
|
91
|
+
await setDefaultProfileCmd(name);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
config
|
|
95
|
+
.command('set-remote-profile-url')
|
|
96
|
+
.description('设置远端 profile URL(用于 config push/pull)。')
|
|
97
|
+
.argument('<url>', '例如 https://<bucket>.<region>.aliyuncs.com/skillmanager_profile.json')
|
|
98
|
+
.action(async (url) => {
|
|
99
|
+
await setRemoteProfileUrlCmd(url);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
config
|
|
103
|
+
.command('push')
|
|
104
|
+
.description('上传某个 profile 到远端 URL(HTTP PUT)。')
|
|
105
|
+
.option('--profile <name>', 'profile 名称(默认:default)', 'default')
|
|
106
|
+
.option('--url <url>', '远端 URL(可省略,使用 config.remoteProfileUrl 或 SKILLMANAGER_PROFILE_URL)')
|
|
107
|
+
.action(async (opts) => {
|
|
108
|
+
await pushProfileCmd(opts);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
config
|
|
112
|
+
.command('pull')
|
|
113
|
+
.description('从远端 URL 下载 profile 并保存到本地(HTTP GET)。')
|
|
114
|
+
.option('--profile <name>', 'profile 名称(默认:default)', 'default')
|
|
115
|
+
.option('--url <url>', '远端 URL(可省略,使用 config.remoteProfileUrl 或 SKILLMANAGER_PROFILE_URL)')
|
|
116
|
+
.action(async (opts) => {
|
|
117
|
+
await pullProfileCmd(opts);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
config
|
|
121
|
+
.command('show')
|
|
122
|
+
.description('显示配置(含默认 profile)。')
|
|
123
|
+
.action(async () => {
|
|
124
|
+
await showConfig();
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const source = program.command('source').description('管理 skills 来源仓库(官方/第三方/自研)。');
|
|
128
|
+
|
|
129
|
+
source
|
|
130
|
+
.command('list')
|
|
131
|
+
.description('列出当前 sources.json 中的来源。')
|
|
132
|
+
.action(async () => {
|
|
133
|
+
await listSources();
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
source
|
|
137
|
+
.command('add')
|
|
138
|
+
.description('添加来源:支持 owner/repo、GitHub URL、或 git@... SSH URL。')
|
|
139
|
+
.argument('<repoOrRef>', '例如 ComposioHQ/awesome-claude-skills 或 https://github.com/obra/superpowers')
|
|
140
|
+
.option('--id <id>', '指定来源 id(可选)')
|
|
141
|
+
.option('--name <name>', '显示名称(可选)')
|
|
142
|
+
.option('--ref <openskillsRef>', '指定 openskillsRef(可选,形如 owner/repo)')
|
|
143
|
+
.option('--disabled', '添加为禁用(bootstrap 默认不安装)', false)
|
|
144
|
+
.action(async (repoOrRef, opts) => {
|
|
145
|
+
await addSource(repoOrRef, opts);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
source
|
|
149
|
+
.command('remove')
|
|
150
|
+
.description('删除来源(按 id)。')
|
|
151
|
+
.argument('<id>', '来源 id')
|
|
152
|
+
.action(async (id) => {
|
|
153
|
+
await removeSource(id);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
source
|
|
157
|
+
.command('enable')
|
|
158
|
+
.description('启用来源(按 id)。')
|
|
159
|
+
.argument('<id>', '来源 id')
|
|
160
|
+
.action(async (id) => {
|
|
161
|
+
await setEnabled(id, true);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
source
|
|
165
|
+
.command('disable')
|
|
166
|
+
.description('禁用来源(按 id)。')
|
|
167
|
+
.argument('<id>', '来源 id')
|
|
168
|
+
.action(async (id) => {
|
|
169
|
+
await setEnabled(id, false);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
await program.parseAsync(process.argv);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
main().catch((err) => {
|
|
176
|
+
console.error(err?.stack || String(err));
|
|
177
|
+
process.exitCode = 1;
|
|
178
|
+
});
|
|
179
|
+
|