skill4agent 1.0.0

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.
@@ -0,0 +1,311 @@
1
+ import chalk from 'chalk';
2
+ import fs from 'fs-extra';
3
+ import inquirer from 'inquirer';
4
+ import os from 'os';
5
+ import path from 'path';
6
+ import { extractZip } from '../utils';
7
+ import { UNIVERSAL_AGENTS, OTHER_AGENTS, UNIVERSAL_PATH, getAgentDisplayPath } from '../tools';
8
+ import { downloadSkill, getSkillInfo, SkillInfo } from '../api';
9
+
10
+ function getAgentName(id: string): string {
11
+ const agent = [...UNIVERSAL_AGENTS, ...OTHER_AGENTS].find(a => a.id === id);
12
+ return agent?.name || id;
13
+ }
14
+
15
+ async function promptTypeSelection(skillInfo: SkillInfo): Promise<'original' | 'translated'> {
16
+ const isOriginalEnglish = skillInfo.originalLanguage === 'en';
17
+ const originalName = isOriginalEnglish ? 'English' : 'Chinese';
18
+ const translatedName = isOriginalEnglish ? 'Chinese' : 'English';
19
+
20
+ if (!skillInfo.hasTranslation) {
21
+ console.log(chalk.yellow(`\nℹ️ This skill does not have a ${translatedName} translation yet.`));
22
+ console.log(chalk.gray(` Installing ${originalName} version...\n`));
23
+ return 'original';
24
+ }
25
+
26
+ const { type } = await inquirer.prompt({
27
+ type: 'list',
28
+ name: 'type',
29
+ message: `Select version for "${skillInfo.name}"`,
30
+ choices: [
31
+ {
32
+ name: `${originalName} (Original)`,
33
+ value: 'original',
34
+ },
35
+ {
36
+ name: `${translatedName} (Translation)`,
37
+ value: 'translated',
38
+ },
39
+ ],
40
+ default: 'original',
41
+ });
42
+
43
+ return type;
44
+ }
45
+
46
+ async function promptScopeSelection(): Promise<'project' | 'global'> {
47
+ const { scope } = await inquirer.prompt({
48
+ type: 'list',
49
+ name: 'scope',
50
+ message: 'Installation scope',
51
+ choices: [
52
+ {
53
+ name: 'Project (Install in current directory (committed with your project))',
54
+ value: 'project',
55
+ },
56
+ {
57
+ name: 'Global (Install in home directory (available across all projects))',
58
+ value: 'global',
59
+ },
60
+ ],
61
+ default: 'project',
62
+ });
63
+
64
+ return scope;
65
+ }
66
+
67
+ async function promptAgentSelection(isGlobal: boolean): Promise<string[]> {
68
+ const universalNames = UNIVERSAL_AGENTS.map(a => a.name).join(', ');
69
+ const universalDisplayPath = getAgentDisplayPath(UNIVERSAL_AGENTS[0].id, isGlobal);
70
+
71
+ const otherAgentChoices = OTHER_AGENTS.map(agent => ({
72
+ name: `${agent.name} (${getAgentDisplayPath(agent.id, isGlobal)})`,
73
+ value: agent.id,
74
+ }));
75
+
76
+ console.log(chalk.green(`✓ Universal (${universalDisplayPath}): ${universalNames} is always included`));
77
+
78
+ const { selectedOtherAgents } = await inquirer.prompt({
79
+ type: 'checkbox',
80
+ name: 'selectedOtherAgents',
81
+ message: 'Select additional agents:',
82
+ pageSize: 12,
83
+ loop: false,
84
+ choices: otherAgentChoices,
85
+ });
86
+
87
+ const selectedNames = (selectedOtherAgents as string[]).map(id =>
88
+ OTHER_AGENTS.find(a => a.id === id)?.name || id
89
+ );
90
+ const displayNames = selectedNames.length > 0
91
+ ? ['Universal', ...selectedNames].join(', ')
92
+ : 'Universal';
93
+ console.log(chalk.green(`✓ Selected: ${displayNames}\n`));
94
+
95
+ const universalAgentIds = UNIVERSAL_AGENTS.map(a => a.id);
96
+ return [...universalAgentIds, ...(selectedOtherAgents as string[])];
97
+ }
98
+
99
+ async function promptMethodSelection(): Promise<'symlink' | 'copy'> {
100
+ const { method } = await inquirer.prompt({
101
+ type: 'list',
102
+ name: 'method',
103
+ message: 'Installation method',
104
+ choices: [
105
+ {
106
+ name: 'Symlink (Recommended) (Single source of truth, easy updates)',
107
+ value: 'symlink',
108
+ },
109
+ {
110
+ name: 'Copy to all agents (Independent copies for each agent)',
111
+ value: 'copy',
112
+ },
113
+ ],
114
+ default: 'symlink',
115
+ });
116
+
117
+ return method;
118
+ }
119
+
120
+ function displaySummary(
121
+ skillName: string,
122
+ source: string,
123
+ typeDisplay: string,
124
+ scope: string,
125
+ agents: string[],
126
+ method: string
127
+ ): void {
128
+ const universalAgentIds = UNIVERSAL_AGENTS.map(a => a.id);
129
+ const hasUniversal = agents.some(id => universalAgentIds.includes(id));
130
+ const otherAgents = agents.filter(id => !universalAgentIds.includes(id));
131
+ const otherAgentNames = otherAgents.map(id => getAgentName(id));
132
+
133
+ const agentDisplay = hasUniversal
134
+ ? ['Universal', ...otherAgentNames].join(', ')
135
+ : otherAgentNames.join(', ');
136
+ const agentCount = (hasUniversal ? 1 : 0) + otherAgentNames.length;
137
+
138
+ console.log(chalk.blue('\n📊 Installation Summary'));
139
+ console.log(chalk.gray('─'.repeat(50)));
140
+ console.log(`Skill: ${chalk.white(skillName)}`);
141
+ console.log(`Source: ${source}`);
142
+ console.log(`Type: ${typeDisplay}`);
143
+ console.log(`Scope: ${scope === 'global' ? 'Global' : 'Project'}`);
144
+ console.log(`Agents (${agentCount}): ${agentDisplay}`);
145
+ console.log(`Method: ${method === 'symlink' ? 'Symlink (Recommended)' : 'Copy'}`);
146
+ console.log(chalk.gray('─'.repeat(50)));
147
+ }
148
+
149
+ async function promptConfirmation(): Promise<boolean> {
150
+ const { confirm } = await inquirer.prompt({
151
+ type: 'confirm',
152
+ name: 'confirm',
153
+ message: 'Proceed with installation?',
154
+ default: true,
155
+ });
156
+
157
+ return confirm;
158
+ }
159
+
160
+ export async function add(topSource: string, skillName: string): Promise<void> {
161
+ console.log(chalk.blue(`\n📦 Installing skill: ${skillName}`));
162
+ console.log(chalk.gray(` Source: ${topSource}\n`));
163
+
164
+ let result: { skill: SkillInfo | null; sourceExists: boolean };
165
+ try {
166
+ result = await getSkillInfo(topSource, skillName);
167
+ } catch (error: any) {
168
+ console.log(chalk.red(`\n❌ Skill "${skillName}" not found in source "${topSource}".`));
169
+ console.log(chalk.gray(` Please check the source repository and skill name.\n`));
170
+ return;
171
+ }
172
+
173
+ if (!result.skill) {
174
+ console.log(chalk.red(`\n❌ Skill "${skillName}" not found in source "${topSource}".`));
175
+ console.log(chalk.gray(` Please check the source repository and skill name.\n`));
176
+ return;
177
+ }
178
+
179
+ const skillInfo = result.skill;
180
+
181
+ console.log(chalk.blue(`\n📦 Skill: ${chalk.white(skillInfo.name)}`));
182
+ console.log(chalk.gray(` Category: ${skillInfo.category?.nameEn || 'N/A'} | Installs: ${skillInfo.installs}`));
183
+
184
+ if (skillInfo.tags) {
185
+ console.log(chalk.gray(` Tags: ${skillInfo.tags}`));
186
+ }
187
+
188
+ if (!skillInfo.hasScript) {
189
+ console.log(chalk.gray(` 📜 Scripts: No scripts`));
190
+ } else {
191
+ const statusText = skillInfo.scriptCheckResult === 'safe' ? '✅ Check passed' : '⚠️ Needs attention';
192
+ console.log(chalk.gray(` 📜 Scripts: ${skillInfo.scriptCount} script(s) - ${statusText}`));
193
+ }
194
+
195
+ console.log(chalk.gray(` ${skillInfo.hasTranslation ? '✅' : '❌'} Translation available\n`));
196
+
197
+ const type = await promptTypeSelection(skillInfo);
198
+
199
+ const isOriginalEnglish = skillInfo.originalLanguage === 'en';
200
+ const typeDisplay = type === 'original'
201
+ ? (isOriginalEnglish ? 'English' : 'Chinese')
202
+ : (isOriginalEnglish ? 'Chinese' : 'English');
203
+ console.log(chalk.gray(` Type: ${typeDisplay}\n`));
204
+
205
+ const scope = await promptScopeSelection();
206
+ const isGlobal = scope === 'global';
207
+
208
+ const selectedAgentIds = await promptAgentSelection(isGlobal);
209
+ if (selectedAgentIds.length === 0) {
210
+ console.log(chalk.yellow('\n⚠️ No agents selected. Installation cancelled.'));
211
+ return;
212
+ }
213
+
214
+ const installMethod = await promptMethodSelection();
215
+
216
+ displaySummary(skillName, topSource, typeDisplay, scope, selectedAgentIds, installMethod);
217
+
218
+ const confirmed = await promptConfirmation();
219
+ if (!confirmed) {
220
+ console.log(chalk.yellow('\n⚠️ Installation cancelled.'));
221
+ return;
222
+ }
223
+
224
+ const basePath = isGlobal ? os.homedir() : process.cwd();
225
+
226
+ let tempZip: string;
227
+ try {
228
+ tempZip = await downloadSkill(topSource, skillName, type);
229
+ } catch (error: any) {
230
+ if (error.response?.status === 404) {
231
+ console.log(chalk.red(`\n❌ Failed to download skill "${skillName}".`));
232
+ console.log(chalk.gray(` The skill may not exist or the download link is invalid.\n`));
233
+ return;
234
+ }
235
+ console.log(chalk.red(`\n❌ Download failed: ${error.message}`));
236
+ return;
237
+ }
238
+
239
+ if (installMethod === 'symlink') {
240
+ const universalFullPath = path.join(basePath, UNIVERSAL_PATH);
241
+ fs.ensureDirSync(universalFullPath);
242
+ const skillDir = path.join(universalFullPath, skillName);
243
+
244
+ if (fs.existsSync(skillDir)) {
245
+ console.log(chalk.yellow(`\n⚠️ Skill "${skillName}" already exists. Overwriting...`));
246
+ fs.removeSync(skillDir);
247
+ }
248
+
249
+ await extractZip(tempZip, universalFullPath);
250
+ fs.removeSync(tempZip);
251
+
252
+ console.log(chalk.green(`✅ Installed to: ${skillDir}`));
253
+
254
+ const otherAgentIds = selectedAgentIds.filter(id => !UNIVERSAL_AGENTS.some(a => a.id === id));
255
+
256
+ for (const agentId of otherAgentIds) {
257
+ const agent = OTHER_AGENTS.find(a => a.id === agentId);
258
+ if (!agent) continue;
259
+ const effectivePath = isGlobal && agent.globalPath ? agent.globalPath : agent.path;
260
+ const agentPath = path.join(basePath, effectivePath);
261
+ fs.ensureDirSync(agentPath);
262
+ const destDir = path.join(agentPath, skillName);
263
+ if (fs.existsSync(destDir)) {
264
+ fs.removeSync(destDir);
265
+ }
266
+
267
+ if (isGlobal) {
268
+ fs.symlinkSync(skillDir, destDir);
269
+ } else {
270
+ const relativePath = path.relative(agentPath, skillDir);
271
+ fs.symlinkSync(relativePath, destDir);
272
+ }
273
+
274
+ console.log(chalk.green(`✅ Linked to: ${destDir}`));
275
+ }
276
+ } else {
277
+ const universalFullPath = path.join(basePath, UNIVERSAL_PATH);
278
+ fs.ensureDirSync(universalFullPath);
279
+
280
+ if (fs.existsSync(path.join(universalFullPath, skillName))) {
281
+ fs.removeSync(path.join(universalFullPath, skillName));
282
+ }
283
+
284
+ await extractZip(tempZip, universalFullPath);
285
+ fs.removeSync(tempZip);
286
+
287
+ console.log(chalk.green(`✅ Copied to: ${universalFullPath}`));
288
+
289
+ let copiedCount = 0;
290
+ const otherAgentIds = selectedAgentIds.filter(id => !UNIVERSAL_AGENTS.some(a => a.id === id));
291
+
292
+ for (const agentId of otherAgentIds) {
293
+ const agent = OTHER_AGENTS.find(a => a.id === agentId);
294
+ if (!agent) continue;
295
+ const effectivePath = isGlobal && agent.globalPath ? agent.globalPath : agent.path;
296
+ const agentPath = path.join(basePath, effectivePath);
297
+ fs.ensureDirSync(agentPath);
298
+ const destDir = path.join(agentPath, skillName);
299
+
300
+ if (fs.existsSync(destDir)) {
301
+ fs.removeSync(destDir);
302
+ }
303
+
304
+ fs.copySync(path.join(universalFullPath, skillName), destDir);
305
+ console.log(chalk.green(`✅ Copied to: ${destDir}`));
306
+ copiedCount++;
307
+ }
308
+ }
309
+
310
+ console.log(chalk.green('\n🎉 Installation completed!\n'));
311
+ }
@@ -0,0 +1,186 @@
1
+ import chalk from 'chalk';
2
+ import fs from 'fs-extra';
3
+ import os from 'os';
4
+ import path from 'path';
5
+ import { extractZip } from '../utils';
6
+ import { UNIVERSAL_PATH, getAgentDisplayPath } from '../tools';
7
+ import { downloadSkill, getSkillInfo } from '../api';
8
+
9
+ interface InstallOptions {
10
+ topSource: string;
11
+ skillName: string;
12
+ type: 'original' | 'translated';
13
+ global: boolean;
14
+ dirs: string[];
15
+ method: 'symlink' | 'copy';
16
+ }
17
+
18
+ function getAgentNameFromPath(dirPath: string): string {
19
+ const name = path.basename(dirPath);
20
+ return name.charAt(0).toUpperCase() + name.slice(1);
21
+ }
22
+
23
+ function getAgentDisplayName(dirPath: string): string {
24
+ const dirname = path.basename(path.dirname(dirPath));
25
+ if (dirname === '.agents') return 'Universal';
26
+ return dirname.charAt(0).toUpperCase() + dirname.slice(1);
27
+ }
28
+
29
+ function displaySummary(options: InstallOptions, skillInfo: any, typeDisplay: string, allDirs: string[]): void {
30
+ const dirNames = allDirs.map(d => getAgentDisplayName(d));
31
+ const dirCount = allDirs.length;
32
+
33
+ console.log(chalk.blue('\n📊 Installation Summary'));
34
+ console.log(chalk.gray('─'.repeat(50)));
35
+ console.log(`Skill: ${chalk.white(skillInfo.name)}`);
36
+ console.log(`Source: ${options.topSource}`);
37
+ console.log(`Type: ${typeDisplay}`);
38
+ console.log(`Scope: ${options.global ? 'Global' : 'Project'}`);
39
+ console.log(`Dirs (${dirCount}): ${dirNames.join(', ')}`);
40
+ console.log(`Method: ${options.method === 'symlink' ? 'Symlink (Recommended)' : 'Copy'}`);
41
+ console.log(chalk.gray('─'.repeat(50)));
42
+ }
43
+
44
+ export async function install(options: InstallOptions): Promise<void> {
45
+ const { topSource, skillName, type, global, dirs, method } = options;
46
+
47
+ console.log(chalk.blue(`\n📦 Installing skill: ${skillName}`));
48
+ console.log(chalk.gray(` Source: ${topSource}\n`));
49
+
50
+ let result: { skill: any; sourceExists: boolean };
51
+ try {
52
+ result = await getSkillInfo(topSource, skillName);
53
+ } catch (error: any) {
54
+ console.log(chalk.red(`\n❌ Skill "${skillName}" not found in source "${topSource}".`));
55
+ console.log(chalk.gray(` Please check the source repository and skill name.\n`));
56
+ return;
57
+ }
58
+
59
+ if (!result.skill) {
60
+ console.log(chalk.red(`\n❌ Skill "${skillName}" not found in source "${topSource}".`));
61
+ console.log(chalk.gray(` Please check the source repository and skill name.\n`));
62
+ return;
63
+ }
64
+
65
+ const skillInfo = result.skill;
66
+
67
+ console.log(chalk.blue(`\n📦 Skill: ${chalk.white(skillInfo.name)}`));
68
+ console.log(chalk.gray(` Category: ${skillInfo.category?.nameEn || 'N/A'} | Installs: ${skillInfo.installs}`));
69
+
70
+ if (skillInfo.tags) {
71
+ console.log(chalk.gray(` Tags: ${skillInfo.tags}`));
72
+ }
73
+
74
+ if (!skillInfo.hasScript) {
75
+ console.log(chalk.gray(` 📜 Scripts: No scripts`));
76
+ } else {
77
+ const statusText = skillInfo.scriptCheckResult === 'safe' ? '✅ Check passed' : '⚠️ Needs attention';
78
+ console.log(chalk.gray(` 📜 Scripts: ${skillInfo.scriptCount} script(s) - ${statusText}`));
79
+ }
80
+
81
+ console.log(chalk.gray(` ${skillInfo.hasTranslation ? '✅' : '❌'} Translation available\n`));
82
+
83
+ let finalType = type;
84
+ const isOriginalEnglish = skillInfo.originalLanguage === 'en';
85
+
86
+ if (type === 'translated' && !skillInfo.hasTranslation) {
87
+ console.log(chalk.yellow(`⚠️ Translation not available. Using original (${isOriginalEnglish ? 'English' : 'Chinese'}) version.\n`));
88
+ finalType = 'original';
89
+ }
90
+
91
+ const typeDisplay = finalType === 'original'
92
+ ? (isOriginalEnglish ? 'English' : 'Chinese')
93
+ : (isOriginalEnglish ? 'Chinese' : 'English');
94
+ console.log(chalk.gray(` Type: ${typeDisplay}\n`));
95
+
96
+ const isGlobal = global;
97
+ const basePath = isGlobal ? os.homedir() : process.cwd();
98
+
99
+ const allDirs = [UNIVERSAL_PATH, ...dirs.map((d: string) => d.endsWith('/skills') ? d : `${d}/skills`)];
100
+ const dirNames = allDirs.map(d => getAgentDisplayName(d));
101
+ console.log(chalk.green(`✓ Directories: ${dirNames.join(', ')}`));
102
+
103
+ if (allDirs.length === 0) {
104
+ console.log(chalk.yellow('\n⚠️ No directories selected. Installation cancelled.'));
105
+ return;
106
+ }
107
+
108
+ displaySummary({ topSource, skillName, type: finalType, global, dirs, method }, skillInfo, typeDisplay, allDirs);
109
+
110
+ let tempZip: string;
111
+ try {
112
+ tempZip = await downloadSkill(topSource, skillName, finalType);
113
+ } catch (error: any) {
114
+ if (error.response?.status === 404) {
115
+ console.log(chalk.red(`\n❌ Failed to download skill "${skillName}".`));
116
+ console.log(chalk.gray(` The skill may not exist or the download link is invalid.\n`));
117
+ return;
118
+ }
119
+ console.log(chalk.red(`\n❌ Download failed: ${error.message}`));
120
+ return;
121
+ }
122
+
123
+ if (method === 'symlink') {
124
+ const universalFullPath = path.join(basePath, UNIVERSAL_PATH);
125
+ fs.ensureDirSync(universalFullPath);
126
+ const skillDir = path.join(universalFullPath, skillName);
127
+
128
+ if (fs.existsSync(skillDir)) {
129
+ console.log(chalk.yellow(`\n⚠️ Skill "${skillName}" already exists. Overwriting...`));
130
+ fs.removeSync(skillDir);
131
+ }
132
+
133
+ await extractZip(tempZip, universalFullPath);
134
+ fs.removeSync(tempZip);
135
+
136
+ console.log(chalk.green(`✅ Installed to: ${skillDir}`));
137
+
138
+ for (const dir of dirs) {
139
+ const fullDir = dir.endsWith('/skills') ? dir : `${dir}/skills`;
140
+ const dirPath = path.join(basePath, fullDir);
141
+ fs.ensureDirSync(dirPath);
142
+ const destDir = path.join(dirPath, skillName);
143
+ if (fs.existsSync(destDir)) {
144
+ fs.removeSync(destDir);
145
+ }
146
+
147
+ if (isGlobal) {
148
+ fs.symlinkSync(skillDir, destDir);
149
+ } else {
150
+ const relativePath = path.relative(dirPath, skillDir);
151
+ fs.symlinkSync(relativePath, destDir);
152
+ }
153
+
154
+ console.log(chalk.green(`✅ Linked to: ${destDir}`));
155
+ }
156
+ } else {
157
+ const universalFullPath = path.join(basePath, UNIVERSAL_PATH);
158
+ const skillDir = path.join(universalFullPath, skillName);
159
+ fs.ensureDirSync(universalFullPath);
160
+
161
+ if (fs.existsSync(skillDir)) {
162
+ fs.removeSync(skillDir);
163
+ }
164
+
165
+ await extractZip(tempZip, universalFullPath);
166
+ fs.removeSync(tempZip);
167
+
168
+ console.log(chalk.green(`✅ Copied to: ${skillDir}`));
169
+
170
+ for (const dir of dirs) {
171
+ const fullDir = dir.endsWith('/skills') ? dir : `${dir}/skills`;
172
+ const dirPath = path.join(basePath, fullDir);
173
+ fs.ensureDirSync(dirPath);
174
+ const destDir = path.join(dirPath, skillName);
175
+
176
+ if (fs.existsSync(destDir)) {
177
+ fs.removeSync(destDir);
178
+ }
179
+
180
+ fs.copySync(skillDir, destDir);
181
+ console.log(chalk.green(`✅ Copied to: ${destDir}`));
182
+ }
183
+ }
184
+
185
+ console.log(chalk.green('\n🎉 Installation completed!\n'));
186
+ }
@@ -0,0 +1,15 @@
1
+ export async function list(): Promise<void> {
2
+ console.log('list command');
3
+ }
4
+
5
+ export async function search(query: string): Promise<void> {
6
+ console.log('search command', query);
7
+ }
8
+
9
+ export async function update(skillName?: string): Promise<void> {
10
+ console.log('update command', skillName);
11
+ }
12
+
13
+ export async function uninstall(skillName: string): Promise<void> {
14
+ console.log('uninstall command', skillName);
15
+ }
package/src/main.ts ADDED
@@ -0,0 +1,78 @@
1
+ import chalk from 'chalk';
2
+ import { Command } from 'commander';
3
+ import { install } from './commands/install';
4
+ import { add } from './commands/add';
5
+ import { list, search, update, uninstall } from './commands/list';
6
+
7
+ const program = new Command();
8
+
9
+ program
10
+ .name('skill4agent')
11
+ .description('CLI tool for installing and managing agent skills')
12
+ .version('1.0.0');
13
+
14
+ program
15
+ .command('add <top_source> <skill_name>')
16
+ .description('Interactive installation with guided prompts')
17
+ .action(async (topSource: string, skillName: string) => {
18
+ await add(topSource, skillName);
19
+ });
20
+
21
+ program
22
+ .command('install <top_source> <skill_name>')
23
+ .description('Non-interactive installation with command-line options')
24
+ .option('--type <type>', 'Package type: original or translated', 'original')
25
+ .option('--global', 'Install to global storage')
26
+ .option('--dirs <dirs>', 'Additional directories (comma-separated): .trae,.cursor,.qwen')
27
+ .option('--method <method>', 'Installation method: symlink or copy', 'symlink')
28
+ .action(async (topSource: string, skillName: string, options: any) => {
29
+ if (options.type && !['original', 'translated'].includes(options.type)) {
30
+ console.log(chalk.red('\n❌ Invalid --type value. Must be "original" or "translated".\n'));
31
+ process.exit(1);
32
+ }
33
+
34
+ if (options.method && !['symlink', 'copy'].includes(options.method)) {
35
+ console.log(chalk.red('\n❌ Invalid --method value. Must be "symlink" or "copy".\n'));
36
+ process.exit(1);
37
+ }
38
+
39
+ const dirsArray = options.dirs
40
+ ? options.dirs.split(',').map((a: string) => a.trim()).filter((a: string) => a.length > 0)
41
+ : [];
42
+
43
+ await install({
44
+ topSource,
45
+ skillName,
46
+ type: options.type || 'original',
47
+ global: !!options.global,
48
+ dirs: dirsArray,
49
+ method: options.method || 'symlink',
50
+ });
51
+ });
52
+
53
+ program
54
+ .command('list')
55
+ .description('List installed skills')
56
+ .action(list);
57
+
58
+ program
59
+ .command('search <query>')
60
+ .description('Search for skills')
61
+ .action(search);
62
+
63
+ program
64
+ .command('update [skill_name]')
65
+ .description('Update installed skills')
66
+ .action(update);
67
+
68
+ program
69
+ .command('uninstall <skill_name>')
70
+ .description('Uninstall a skill')
71
+ .action(uninstall);
72
+
73
+ program.parse();
74
+
75
+ process.on('unhandledRejection', (reason: any) => {
76
+ console.error(chalk.red('Error:'), reason);
77
+ process.exit(1);
78
+ });