eskill 1.3.3 → 1.3.5

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/cli.js CHANGED
@@ -13,7 +13,7 @@ const program = new Command();
13
13
  program
14
14
  .name('eskill')
15
15
  .description('Unified AI Agent Skills Management - Install skills from Git URLs')
16
- .version('1.3.3')
16
+ .version('1.3.5')
17
17
  .option('-g, --global', '使用全局技能目录(~/.eskill/skills/),否则使用当前目录(./.claude/skills/)', false);
18
18
 
19
19
  // 安装命令
package/lib/completion.js CHANGED
@@ -33,7 +33,11 @@ async function getGlobalSkills() {
33
33
  export function bashCompletionScript() {
34
34
  return '\n_eskill_completion() {\n' +
35
35
  ' local cur prev words cword\n' +
36
- ' _init_completion || return\n\n' +
36
+ ' COMPREPLY=()\n' +
37
+ ' cur="${COMP_WORDS[COMP_CWORD]}"\n' +
38
+ ' prev="${COMP_WORDS[COMP_CWORD-1]}"\n' +
39
+ ' words=("${COMP_WORDS[@]}")\n' +
40
+ ' cword=$COMP_CWORD\n\n' +
37
41
  ' # 检测是否使用了 -g/--global 选项\n' +
38
42
  ' local global_mode=""\n' +
39
43
  ' for word in "${words[@]}"; do\n' +
@@ -52,6 +56,20 @@ export function bashCompletionScript() {
52
56
  ' ;;\n' +
53
57
  ' esac\n' +
54
58
  ' done\n\n' +
59
+ ' # 如果还没有输入命令,提供命令补全(支持前缀匹配)\n' +
60
+ ' if [[ -z "${cmd}" ]] && [[ $cword -gt 0 ]]; then\n' +
61
+ ' local commands="install add remove rm uninstall update list ls link upload search cleanup config agents completion help"\n' +
62
+ ' local matching_cmds=""\n' +
63
+ ' for c in ${commands}; do\n' +
64
+ ' if [[ "$c" == "${cur}"* ]]; then\n' +
65
+ ' matching_cmds="$matching_cmds $c"\n' +
66
+ ' fi\n' +
67
+ ' done\n' +
68
+ ' if [[ -n "$matching_cmds" ]]; then\n' +
69
+ ' COMPREPLY=($(compgen -W "${matching_cmds}" -- "${cur}"))\n' +
70
+ ' return\n' +
71
+ ' fi\n' +
72
+ ' fi\n\n' +
55
73
  ' case ${prev} in\n' +
56
74
  ' install|add)\n' +
57
75
  ' COMPREPLY=($(compgen -W "-a --agent -l --link -f --force" -- "${cur}"))\n' +
@@ -130,7 +148,7 @@ export function bashCompletionScript() {
130
148
  ' return\n' +
131
149
  ' ;;\n' +
132
150
  ' *)\n' +
133
- ' COMPREPLY=($(compgen -W "install add remove rm uninstall update list ls link upload search cleanup config agents completion help" -- "${cur}"))\n' +
151
+ ' COMPREPLY=($(compgen -W "${commands}" -- "${cur}"))\n' +
134
152
  ' return\n' +
135
153
  ' ;;\n' +
136
154
  ' esac\n' +
@@ -163,116 +181,85 @@ export function zshCompletionScript() {
163
181
  ' \'completion:生成自动补全脚本\'\n' +
164
182
  ' \'help:显示帮助信息\'\n' +
165
183
  ' )\n\n' +
166
- ' local -a install_options\n' +
167
- ' install_options=(\n' +
168
- ' \'--agent[目标 agent]\'\n' +
169
- ' \'{-a,--agent}[目标 agent]\'\n' +
170
- ' \'--link[使用符号链接而非复制]\'\n' +
171
- ' \'{-l,--link}[使用符号链接而非复制]\'\n' +
172
- ' \'--force[强制覆盖已存在的技能]\'\n' +
173
- ' \'{-f,--force}[强制覆盖已存在的技能]\'\n' +
174
- ' )\n\n' +
175
- ' local -a list_options\n' +
176
- ' list_options=(\n' +
177
- ' \'--agent[目标 agent]\'\n' +
178
- ' \'{-a,--agent}[目标 agent]\'\n' +
179
- ' )\n\n' +
180
- ' local -a update_options\n' +
181
- ' update_options=(\n' +
182
- ' \'--force[强制更新(即使版本相同)]\'\n' +
183
- ' \'{-f,--force}[强制更新(即使版本相同)]\'\n' +
184
- ' )\n\n' +
185
- ' local -a search_options\n' +
186
- ' search_options=(\n' +
187
- ' \'--page[页码]\'\n' +
188
- ' \'{-p,--page}[页码]\'\n' +
189
- ' \'--limit[每页数量(max: 100)]\'\n' +
190
- ' \'{-l,--limit}[每页数量(max: 100)]\'\n' +
191
- ' \'--sort[排序方式(stars/recent)]\'\n' +
192
- ' \'{-s,--sort}[排序方式(stars/recent)]\'\n' +
193
- ' \'--ai[使用 AI 语义搜索]\'\n' +
194
- ' )\n\n' +
195
- ' local -a cleanup_options\n' +
196
- ' cleanup_options=(\n' +
197
- ' \'--all[清理所有数据(包括配置和技能)]\'\n' +
198
- ' \'{-a,--all}[清理所有数据(包括配置和技能)]\'\n' +
199
- ' )\n\n' +
200
- ' local -a completion_options\n' +
201
- ' completion_options=(\n' +
202
- ' \'--shell[Shell 类型(bash/zsh)]\'\n' +
203
- ' \'{-s,--shell}[Shell 类型(bash/zsh)]\'\n' +
204
- ' )\n\n' +
205
- ' local -a config_commands\n' +
206
- ' config_commands=(\n' +
207
- ' \'set-api-key:设置 API Key\'\n' +
208
- ' \'status:查看配置状态\'\n' +
209
- ' )\n\n' +
210
- ' _arguments -C \\\n' +
211
- ' \'(-g --global)'{-g,--global}\'[使用全局技能目录] \\\n' +
212
- ' \'1: :_eskill_commands\' \\\n' +
213
- ' \'*::arg:->args\'\n\n' +
184
+ ' if (( CURRENT == 1 )); then\n' +
185
+ ' _describe \'command\' commands\n' +
186
+ ' return\n' +
187
+ ' fi\n\n' +
214
188
  ' case $words[1] in\n' +
215
189
  ' install|add)\n' +
216
- ' _describe \'options\' install_options\n' +
190
+ ' _arguments \\\n' +
191
+ ' \'{-a,--agent=[目标 agent]\' \\\n' +
192
+ ' \'{-l,--link}[使用符号链接而非复制]\' \\\n' +
193
+ ' \'{-f,--force}[强制覆盖已存在的技能]\' \\\n' +
194
+ ' \'*: :_nothing\'\n' +
217
195
  ' ;;\n' +
218
196
  ' remove|rm|uninstall)\n' +
219
197
  ' local skills=($(eskill _list_skills -g 2>/dev/null))\n' +
220
- ' _alternative \'args:option:(--agent -a)\' \'skills:skills:($skills)\'\n' +
198
+ ' _arguments \\\n' +
199
+ ' \'1: :_skills\' \\\n' +
200
+ ' \'{-a,--agent=[目标 agent]}\' \\\n' +
201
+ ' \'*:: :_nothing\'\n' +
221
202
  ' ;;\n' +
222
203
  ' list|ls)\n' +
223
- ' _describe \'options\' list_options\n' +
204
+ ' _arguments \\\n' +
205
+ ' \'{-a,--agent=[目标 agent]}\' \\\n' +
206
+ ' \'*:: :_nothing\'\n' +
224
207
  ' ;;\n' +
225
208
  ' link)\n' +
226
209
  ' local skills=($(eskill _list_global_skills 2>/dev/null))\n' +
227
- ' _describe \'global skills\' skills\n' +
210
+ ' _arguments \\\n' +
211
+ ' \'1: :_global_skills\' \\\n' +
212
+ ' \'*:: :_nothing\'\n' +
228
213
  ' ;;\n' +
229
214
  ' upload)\n' +
230
215
  ' local skills=($(eskill _list_local_skills 2>/dev/null))\n' +
231
- ' _describe \'local skills\' skills\n' +
216
+ ' _arguments \\\n' +
217
+ ' \'1: :_local_skills\' \\\n' +
218
+ ' \'*:: :_nothing\'\n' +
232
219
  ' ;;\n' +
233
220
  ' update)\n' +
234
221
  ' local skills=($(eskill _list_skills -g 2>/dev/null))\n' +
235
- ' _alternative \'args:options:(--force -f)\' \'skills:skills:(all ${skills})\'\n' +
222
+ ' _arguments \\\n' +
223
+ ' \'1: :_update_skills\' \\\n' +
224
+ ' \'{-f,--force}[强制更新(即使版本相同)]\' \\\n' +
225
+ ' \'*:: :_nothing\'\n' +
236
226
  ' ;;\n' +
237
227
  ' search)\n' +
238
- ' _describe \'options\' search_options\n' +
228
+ ' _arguments \\\n' +
229
+ ' \'{-p,--page=[页码]}\' \\\n' +
230
+ ' \'{-l,--limit=[每页数量(max: 100)]}\' \\\n' +
231
+ ' \'{-s,--sort=[排序方式(stars/recent)]}\' \\\n' +
232
+ ' \'--ai[使用 AI 语义搜索]\' \\\n' +
233
+ ' \'*: :_nothing\'\n' +
239
234
  ' ;;\n' +
240
235
  ' cleanup)\n' +
241
- ' _describe \'options\' cleanup_options\n' +
236
+ ' _arguments \\\n' +
237
+ ' \'{-a,--all}[清理所有数据(包括配置和技能)]\' \\\n' +
238
+ ' \'*:: :_nothing\'\n' +
242
239
  ' ;;\n' +
243
240
  ' config)\n' +
244
- ' _describe \'actions\' config_commands\n' +
241
+ ' _arguments \\\n' +
242
+ ' \'1: :_config_actions\' \\\n' +
243
+ ' \'*:: :_nothing\'\n' +
245
244
  ' ;;\n' +
246
245
  ' completion)\n' +
247
- ' _describe \'options\' completion_options\n' +
246
+ ' _arguments \\\n' +
247
+ ' \'{-s,--shell=[Shell 类型(bash/zsh)]\' \\\n' +
248
+ ' \'*:: :_nothing\'\n' +
248
249
  ' ;;\n' +
249
250
  ' *)\n' +
250
- ' _describe \'command\' commands\n' +
251
+ ' _arguments \\\n' +
252
+ ' \'{-g,--global}[使用全局技能目录]\' \\\n' +
253
+ ' \'*:: :_nothing\'\n' +
251
254
  ' ;;\n' +
252
255
  ' esac\n' +
253
256
  '}\n\n' +
254
- '_eskill_commands() {\n' +
255
- ' local -a commands\n' +
256
- ' commands=(\n' +
257
- ' \'install:从 Git URL 或名称安装技能\'\n' +
258
- ' \'add:安装技能(别名)\'\n' +
259
- ' \'remove:删除已安装的技能\'\n' +
260
- ' \'rm:删除技能(别名)\'\n' +
261
- ' \'uninstall:删除技能(别名)\'\n' +
262
- ' \'update:更新技能\'\n' +
263
- ' \'list:列出已安装的技能\'\n' +
264
- ' \'ls:列出技能(别名)\'\n' +
265
- ' \'link:将全局技能软链接到本地\'\n' +
266
- ' \'upload:上传本地技能到全局仓库\'\n' +
267
- ' \'search:搜索技能\'\n' +
268
- ' \'cleanup:清理技能数据\'\n' +
269
- ' \'config:配置管理\'\n' +
270
- ' \'agents:列出支持的 agents\'\n' +
271
- ' \'completion:生成自动补全脚本\'\n' +
272
- ' \'help:显示帮助信息\'\n' +
273
- ' )\n' +
274
- ' _describe \'command\' commands\n' +
275
- '}\n\n' +
257
+ '_nothing() { _message \'no more arguments\' }\n' +
258
+ '_skills() { _describe \'技能\' ${words[@]} }\n' +
259
+ '_global_skills() { _describe \'全局技能\' ${words[@]} }\n' +
260
+ '_local_skills() { _describe \'本地技能\' ${words[@]} }\n' +
261
+ '_update_skills() { _alternative \'skills:技能:($(eskill _list_skills -g 2>/dev/null))\' \'all:all\' }\n' +
262
+ '_config_actions() { _describe \'配置操作\' \'set-api-key:设置 API Key\' \'status:查看配置状态\' }\n\n' +
276
263
  '_eskill "$@"\n';
277
264
  }
278
265
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eskill",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "description": "Unified AI Agent Skills Management - Install skills from Git URLs",
5
5
  "main": "index.js",
6
6
  "type": "module",