eskill 1.3.2 → 1.3.3

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.
Files changed (3) hide show
  1. package/cli.js +1 -1
  2. package/lib/completion.js +100 -31
  3. package/package.json +1 -1
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.2')
16
+ .version('1.3.3')
17
17
  .option('-g, --global', '使用全局技能目录(~/.eskill/skills/),否则使用当前目录(./.claude/skills/)', false);
18
18
 
19
19
  // 安装命令
package/lib/completion.js CHANGED
@@ -5,8 +5,7 @@
5
5
  * eskill completion >> ~/.bashrc
6
6
  * eskill completion >> ~/.zshrc
7
7
  */
8
- import { listSkills, getSkillsDir } from './installer.js';
9
- import { existsSync } from 'fs';
8
+ import { listSkills } from './installer.js';
10
9
  import { getDefaultAgent } from './agent-config.js';
11
10
 
12
11
  // 获取已安装的技能列表
@@ -43,10 +42,24 @@ export function bashCompletionScript() {
43
42
  ' break\n' +
44
43
  ' fi\n' +
45
44
  ' done\n\n' +
45
+ ' # 检测当前命令\n' +
46
+ ' local cmd=""\n' +
47
+ ' for word in "${words[@]}"; do\n' +
48
+ ' case ${word} in\n' +
49
+ ' install|add|remove|rm|uninstall|update|list|ls|link|upload|search|cleanup|config|completion|agents|help)\n' +
50
+ ' cmd="${word}"\n' +
51
+ ' break\n' +
52
+ ' ;;\n' +
53
+ ' esac\n' +
54
+ ' done\n\n' +
46
55
  ' case ${prev} in\n' +
56
+ ' install|add)\n' +
57
+ ' COMPREPLY=($(compgen -W "-a --agent -l --link -f --force" -- "${cur}"))\n' +
58
+ ' return\n' +
59
+ ' ;;\n' +
47
60
  ' remove|rm|uninstall)\n' +
48
61
  ' local skills=$(eskill _list_skills ${global_mode} 2>/dev/null)\n' +
49
- ' COMPREPLY=($(compgen -W "${skills}" -- "${cur}"))\n' +
62
+ ' COMPREPLY=($(compgen -W "${skills} -a --agent" -- "${cur}"))\n' +
50
63
  ' return\n' +
51
64
  ' ;;\n' +
52
65
  ' link)\n' +
@@ -61,16 +74,19 @@ export function bashCompletionScript() {
61
74
  ' ;;\n' +
62
75
  ' update)\n' +
63
76
  ' local skills=$(eskill _list_skills ${global_mode} 2>/dev/null)\n' +
64
- ' local all="all"\n' +
65
- ' COMPREPLY=($(compgen -W "${skills} ${all}" -- "${cur}"))\n' +
77
+ ' COMPREPLY=($(compgen -W "${skills} all -f --force" -- "${cur}"))\n' +
66
78
  ' return\n' +
67
79
  ' ;;\n' +
68
- ' cleanup)\n' +
69
- ' COMPREPLY=($(compgen -W "--all -a" -- "${cur}"))\n' +
80
+ ' list|ls)\n' +
81
+ ' COMPREPLY=($(compgen -W "-a --agent" -- "${cur}"))\n' +
70
82
  ' return\n' +
71
83
  ' ;;\n' +
72
84
  ' search)\n' +
73
- ' COMPREPLY=($(compgen -W "--page --limit --sort --ai -p -l -s" -- "${cur}"))\n' +
85
+ ' COMPREPLY=($(compgen -W "-p --page -l --limit -s --sort --ai" -- "${cur}"))\n' +
86
+ ' return\n' +
87
+ ' ;;\n' +
88
+ ' cleanup)\n' +
89
+ ' COMPREPLY=($(compgen -W "-a --all" -- "${cur}"))\n' +
74
90
  ' return\n' +
75
91
  ' ;;\n' +
76
92
  ' config)\n' +
@@ -78,13 +94,39 @@ export function bashCompletionScript() {
78
94
  ' return\n' +
79
95
  ' ;;\n' +
80
96
  ' completion)\n' +
81
- ' COMPREPLY=($(compgen -W "--shell -s" -- "${cur}"))\n' +
97
+ ' COMPREPLY=($(compgen -W "-s --shell" -- "${cur}"))\n' +
82
98
  ' return\n' +
83
99
  ' ;;\n' +
84
100
  ' *)\n' +
85
101
  ' case ${cur} in\n' +
86
102
  ' -*)\n' +
87
- ' COMPREPLY=($(compgen -W "-g --global -h --help -V --version" -- "${cur}"))\n' +
103
+ ' # 根据当前命令显示对应选项\n' +
104
+ ' case ${cmd} in\n' +
105
+ ' install|add)\n' +
106
+ ' COMPREPLY=($(compgen -W "-a --agent -l --link -f --force" -- "${cur}"))\n' +
107
+ ' ;;\n' +
108
+ ' remove|rm|uninstall)\n' +
109
+ ' COMPREPLY=($(compgen -W "-a --agent" -- "${cur}"))\n' +
110
+ ' ;;\n' +
111
+ ' update)\n' +
112
+ ' COMPREPLY=($(compgen -W "-f --force" -- "${cur}"))\n' +
113
+ ' ;;\n' +
114
+ ' list|ls)\n' +
115
+ ' COMPREPLY=($(compgen -W "-a --agent" -- "${cur}"))\n' +
116
+ ' ;;\n' +
117
+ ' search)\n' +
118
+ ' COMPREPLY=($(compgen -W "-p --page -l --limit -s --sort --ai" -- "${cur}"))\n' +
119
+ ' ;;\n' +
120
+ ' cleanup)\n' +
121
+ ' COMPREPLY=($(compgen -W "-a --all" -- "${cur}"))\n' +
122
+ ' ;;\n' +
123
+ ' completion)\n' +
124
+ ' COMPREPLY=($(compgen -W "-s --shell" -- "${cur}"))\n' +
125
+ ' ;;\n' +
126
+ ' *)\n' +
127
+ ' COMPREPLY=($(compgen -W "-g --global -h --help -V --version" -- "${cur}"))\n' +
128
+ ' ;;\n' +
129
+ ' esac\n' +
88
130
  ' return\n' +
89
131
  ' ;;\n' +
90
132
  ' *)\n' +
@@ -121,26 +163,44 @@ export function zshCompletionScript() {
121
163
  ' \'completion:生成自动补全脚本\'\n' +
122
164
  ' \'help:显示帮助信息\'\n' +
123
165
  ' )\n\n' +
124
- ' local -a link_commands\n' +
125
- ' link_commands=(\n' +
126
- ' \'--global:使用全局技能目录\'\n' +
127
- ' \'--help:显示帮助信息\'\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' +
128
179
  ' )\n\n' +
129
- ' local -a update_commands\n' +
130
- ' update_commands=(\n' +
131
- ' \'--force:强制更新\'\n' +
132
- ' \'all:更新所有技能\'\n' +
180
+ ' local -a update_options\n' +
181
+ ' update_options=(\n' +
182
+ ' \'--force[强制更新(即使版本相同)]\'\n' +
183
+ ' \'{-f,--force}[强制更新(即使版本相同)]\'\n' +
133
184
  ' )\n\n' +
134
- ' local -a search_commands\n' +
135
- ' search_commands=(\n' +
136
- ' \'--page:页码\'\n' +
137
- ' \'--limit:每页数量\'\n' +
138
- ' \'--sort:排序方式\'\n' +
139
- ' \'--ai:AI 语义搜索\'\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' +
140
194
  ' )\n\n' +
141
- ' local -a cleanup_commands\n' +
142
- ' cleanup_commands=(\n' +
143
- ' \'--all:清理所有数据\'\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' +
144
204
  ' )\n\n' +
145
205
  ' local -a config_commands\n' +
146
206
  ' config_commands=(\n' +
@@ -152,9 +212,15 @@ export function zshCompletionScript() {
152
212
  ' \'1: :_eskill_commands\' \\\n' +
153
213
  ' \'*::arg:->args\'\n\n' +
154
214
  ' case $words[1] in\n' +
215
+ ' install|add)\n' +
216
+ ' _describe \'options\' install_options\n' +
217
+ ' ;;\n' +
155
218
  ' remove|rm|uninstall)\n' +
156
219
  ' local skills=($(eskill _list_skills -g 2>/dev/null))\n' +
157
- ' _describe \'skills\' skills\n' +
220
+ ' _alternative \'args:option:(--agent -a)\' \'skills:skills:($skills)\'\n' +
221
+ ' ;;\n' +
222
+ ' list|ls)\n' +
223
+ ' _describe \'options\' list_options\n' +
158
224
  ' ;;\n' +
159
225
  ' link)\n' +
160
226
  ' local skills=($(eskill _list_global_skills 2>/dev/null))\n' +
@@ -166,17 +232,20 @@ export function zshCompletionScript() {
166
232
  ' ;;\n' +
167
233
  ' update)\n' +
168
234
  ' local skills=($(eskill _list_skills -g 2>/dev/null))\n' +
169
- ' _values "skills" ${skills} "all"\n' +
235
+ ' _alternative \'args:options:(--force -f)\' \'skills:skills:(all ${skills})\'\n' +
170
236
  ' ;;\n' +
171
237
  ' search)\n' +
172
- ' _describe \'options\' search_commands\n' +
238
+ ' _describe \'options\' search_options\n' +
173
239
  ' ;;\n' +
174
240
  ' cleanup)\n' +
175
- ' _describe \'options\' cleanup_commands\n' +
241
+ ' _describe \'options\' cleanup_options\n' +
176
242
  ' ;;\n' +
177
243
  ' config)\n' +
178
244
  ' _describe \'actions\' config_commands\n' +
179
245
  ' ;;\n' +
246
+ ' completion)\n' +
247
+ ' _describe \'options\' completion_options\n' +
248
+ ' ;;\n' +
180
249
  ' *)\n' +
181
250
  ' _describe \'command\' commands\n' +
182
251
  ' ;;\n' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eskill",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Unified AI Agent Skills Management - Install skills from Git URLs",
5
5
  "main": "index.js",
6
6
  "type": "module",