antikit 1.0.1 → 1.1.1
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/package.json +9 -2
- package/src/commands/install.js +4 -9
- package/src/commands/list.js +68 -15
- package/src/index.js +6 -1
- package/src/utils/local.js +17 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antikit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "CLI tool to manage AI agent skills from Anti Gravity skills repository",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"antikit": "src/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"test": "node src/index.js --help"
|
|
11
|
+
"test": "node src/index.js --help",
|
|
12
|
+
"semantic-release": "semantic-release"
|
|
12
13
|
},
|
|
13
14
|
"keywords": [
|
|
14
15
|
"cli",
|
|
@@ -36,9 +37,15 @@
|
|
|
36
37
|
"src/**/*"
|
|
37
38
|
],
|
|
38
39
|
"dependencies": {
|
|
40
|
+
"@inquirer/prompts": "^8.2.0",
|
|
39
41
|
"chalk": "^5.3.0",
|
|
40
42
|
"commander": "^12.1.0",
|
|
41
43
|
"ora": "^8.1.1",
|
|
42
44
|
"simple-git": "^3.27.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"semantic-release": "^24.2.0",
|
|
48
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
49
|
+
"@semantic-release/git": "^10.0.1"
|
|
43
50
|
}
|
|
44
51
|
}
|
package/src/commands/install.js
CHANGED
|
@@ -4,17 +4,12 @@ import { execSync } from 'child_process';
|
|
|
4
4
|
import { existsSync, mkdirSync, cpSync, rmSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
import { CONFIG } from '../config.js';
|
|
7
|
-
import {
|
|
7
|
+
import { getOrCreateSkillsDir, skillExists } from '../utils/local.js';
|
|
8
8
|
import { fetchRemoteSkills } from '../utils/github.js';
|
|
9
9
|
|
|
10
|
-
export async function installSkill(skillName, options) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!skillsDir) {
|
|
14
|
-
console.log(chalk.red('No .agent/skills directory found in current path.'));
|
|
15
|
-
console.log(chalk.dim('Make sure you are in a project with .agent/skills folder.'));
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
10
|
+
export async function installSkill(skillName, options = {}) {
|
|
11
|
+
// Get or create skills directory
|
|
12
|
+
const skillsDir = getOrCreateSkillsDir();
|
|
18
13
|
|
|
19
14
|
// Check if skill already exists
|
|
20
15
|
if (skillExists(skillName) && !options.force) {
|
package/src/commands/list.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import ora from 'ora';
|
|
3
|
+
import { checkbox, confirm } from '@inquirer/prompts';
|
|
3
4
|
import { fetchRemoteSkills, fetchSkillInfo } from '../utils/github.js';
|
|
4
5
|
import { skillExists } from '../utils/local.js';
|
|
6
|
+
import { installSkill } from './install.js';
|
|
5
7
|
|
|
6
8
|
export async function listRemoteSkills(options) {
|
|
7
9
|
const spinner = ora('Fetching skills from remote...').start();
|
|
@@ -34,23 +36,14 @@ export async function listRemoteSkills(options) {
|
|
|
34
36
|
);
|
|
35
37
|
infoSpinner.stop();
|
|
36
38
|
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
for (const skill of skillsWithInfo) {
|
|
42
|
-
const status = skill.installed
|
|
43
|
-
? chalk.green(' ✓')
|
|
44
|
-
: chalk.dim(' ');
|
|
45
|
-
|
|
46
|
-
console.log(`${status} ${chalk.cyan.bold(skill.name)}`);
|
|
47
|
-
if (skill.description) {
|
|
48
|
-
console.log(` ${chalk.dim(skill.description)}`);
|
|
49
|
-
}
|
|
39
|
+
// Interactive mode - show selection menu
|
|
40
|
+
if (options.interactive) {
|
|
41
|
+
await interactiveInstall(skillsWithInfo);
|
|
42
|
+
return;
|
|
50
43
|
}
|
|
51
44
|
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
// Display list
|
|
46
|
+
displaySkillsList(skillsWithInfo);
|
|
54
47
|
|
|
55
48
|
} catch (error) {
|
|
56
49
|
spinner.fail('Failed to fetch skills');
|
|
@@ -58,3 +51,63 @@ export async function listRemoteSkills(options) {
|
|
|
58
51
|
process.exit(1);
|
|
59
52
|
}
|
|
60
53
|
}
|
|
54
|
+
|
|
55
|
+
function displaySkillsList(skills) {
|
|
56
|
+
console.log(chalk.bold('Available Skills:'));
|
|
57
|
+
console.log(chalk.dim('─'.repeat(60)));
|
|
58
|
+
|
|
59
|
+
for (const skill of skills) {
|
|
60
|
+
const status = skill.installed
|
|
61
|
+
? chalk.green(' ✓')
|
|
62
|
+
: chalk.dim(' ');
|
|
63
|
+
|
|
64
|
+
console.log(`${status} ${chalk.cyan.bold(skill.name)}`);
|
|
65
|
+
if (skill.description) {
|
|
66
|
+
console.log(` ${chalk.dim(skill.description)}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
console.log();
|
|
71
|
+
console.log(chalk.dim(`Use ${chalk.white('antikit list -i')} to select and install skills`));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function interactiveInstall(skills) {
|
|
75
|
+
// Prepare choices for checkbox
|
|
76
|
+
const choices = skills.map(skill => ({
|
|
77
|
+
name: `${skill.installed ? chalk.green('✓') : ' '} ${chalk.cyan(skill.name)} ${skill.description ? chalk.dim('- ' + skill.description.slice(0, 50) + '...') : ''}`,
|
|
78
|
+
value: skill.name,
|
|
79
|
+
disabled: skill.installed ? '(installed)' : false
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
// Show checkbox selection
|
|
83
|
+
const selected = await checkbox({
|
|
84
|
+
message: 'Select skills to install (Space to select, Enter to confirm):',
|
|
85
|
+
choices,
|
|
86
|
+
pageSize: 15
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
if (selected.length === 0) {
|
|
90
|
+
console.log(chalk.yellow('\nNo skills selected.'));
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Confirm installation
|
|
95
|
+
const shouldInstall = await confirm({
|
|
96
|
+
message: `Install ${selected.length} skill(s)?`,
|
|
97
|
+
default: true
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
if (!shouldInstall) {
|
|
101
|
+
console.log(chalk.yellow('Installation cancelled.'));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Install selected skills
|
|
106
|
+
console.log();
|
|
107
|
+
for (const skillName of selected) {
|
|
108
|
+
await installSkill(skillName, { force: false });
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
console.log();
|
|
112
|
+
console.log(chalk.green.bold(`✓ Installed ${selected.length} skill(s)`));
|
|
113
|
+
}
|
package/src/index.js
CHANGED
|
@@ -2,23 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
import { Command } from 'commander';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
|
+
import { createRequire } from 'module';
|
|
5
6
|
import { listRemoteSkills } from './commands/list.js';
|
|
6
7
|
import { listLocalSkills } from './commands/local.js';
|
|
7
8
|
import { installSkill } from './commands/install.js';
|
|
8
9
|
import { removeSkill } from './commands/remove.js';
|
|
9
10
|
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
const pkg = require('../package.json');
|
|
13
|
+
|
|
10
14
|
const program = new Command();
|
|
11
15
|
|
|
12
16
|
program
|
|
13
17
|
.name('antikit')
|
|
14
18
|
.description('CLI tool to manage skills from antiskills repository')
|
|
15
|
-
.version(
|
|
19
|
+
.version(pkg.version);
|
|
16
20
|
|
|
17
21
|
program
|
|
18
22
|
.command('list')
|
|
19
23
|
.alias('ls')
|
|
20
24
|
.description('List available skills from remote repository')
|
|
21
25
|
.option('-s, --search <query>', 'Search skills by name')
|
|
26
|
+
.option('-i, --interactive', 'Interactive mode to select and install skills')
|
|
22
27
|
.action(listRemoteSkills);
|
|
23
28
|
|
|
24
29
|
program
|
package/src/utils/local.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync, readdirSync, readFileSync, rmSync } from 'fs';
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, rmSync, mkdirSync } from 'fs';
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
import { CONFIG } from '../config.js';
|
|
4
4
|
|
|
@@ -19,6 +19,22 @@ export function findLocalSkillsDir() {
|
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Get or create skills directory in current working directory
|
|
24
|
+
*/
|
|
25
|
+
export function getOrCreateSkillsDir() {
|
|
26
|
+
// First try to find existing
|
|
27
|
+
const existing = findLocalSkillsDir();
|
|
28
|
+
if (existing) {
|
|
29
|
+
return existing;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Create in current directory
|
|
33
|
+
const newPath = join(process.cwd(), CONFIG.LOCAL_SKILLS_DIR);
|
|
34
|
+
mkdirSync(newPath, { recursive: true });
|
|
35
|
+
return newPath;
|
|
36
|
+
}
|
|
37
|
+
|
|
22
38
|
/**
|
|
23
39
|
* Get list of installed skills
|
|
24
40
|
*/
|