antikit 1.12.4 → 1.12.6
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 +1 -1
- package/src/commands/config.js +14 -9
- package/src/commands/list.js +48 -31
- package/src/commands/source.js +17 -9
package/package.json
CHANGED
package/src/commands/config.js
CHANGED
|
@@ -7,24 +7,29 @@ import {
|
|
|
7
7
|
loadConfig
|
|
8
8
|
} from '../utils/configManager.js';
|
|
9
9
|
|
|
10
|
+
import Table from 'cli-table3';
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* List all configurations
|
|
12
14
|
*/
|
|
13
15
|
export function listConfig() {
|
|
14
16
|
const config = loadConfig();
|
|
15
17
|
console.log(chalk.bold('\nCurrent Configuration:'));
|
|
16
|
-
console.log(chalk.dim('─'.repeat(40)));
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
19
|
+
const table = new Table({
|
|
20
|
+
head: [chalk.cyan('Setting'), chalk.cyan('Value')],
|
|
21
|
+
colWidths: [20, 60],
|
|
22
|
+
style: { head: [], border: [] }
|
|
23
|
+
});
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
const tokenDisplay = config.githubToken
|
|
26
|
+
? chalk.green('********' + config.githubToken.slice(-4))
|
|
27
|
+
: chalk.yellow('(not set)');
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
table.push(['GitHub Token', tokenDisplay]);
|
|
30
|
+
table.push(['Config File', getConfigPath()]);
|
|
31
|
+
|
|
32
|
+
console.log(table.toString());
|
|
28
33
|
console.log();
|
|
29
34
|
}
|
|
30
35
|
|
package/src/commands/list.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import ora from 'ora';
|
|
3
3
|
import { checkbox, confirm, Separator } from '@inquirer/prompts';
|
|
4
|
+
import Table from 'cli-table3';
|
|
4
5
|
import { fetchRemoteSkills, fetchSkillInfo } from '../utils/github.js';
|
|
5
6
|
import { skillExists, getOrCreateSkillsDir } from '../utils/local.js';
|
|
6
7
|
import { installSkill } from './install.js';
|
|
@@ -100,43 +101,59 @@ export async function listRemoteSkills(options) {
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
function displaySkillsList(skills) {
|
|
103
|
-
console.log(chalk.bold('
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (b === 'official') return 1;
|
|
117
|
-
return a.localeCompare(b);
|
|
104
|
+
console.log(chalk.bold('\nAvailable Skills:'));
|
|
105
|
+
|
|
106
|
+
const table = new Table({
|
|
107
|
+
head: [
|
|
108
|
+
chalk.cyan('Source'),
|
|
109
|
+
chalk.cyan('Skill Name'),
|
|
110
|
+
chalk.cyan('Version'),
|
|
111
|
+
chalk.cyan('Status'),
|
|
112
|
+
chalk.cyan('Description')
|
|
113
|
+
],
|
|
114
|
+
colWidths: [15, 25, 12, 12, Math.max(20, (process.stdout.columns || 80) - 74)],
|
|
115
|
+
wordWrap: true,
|
|
116
|
+
style: { head: [], border: [] }
|
|
118
117
|
});
|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
119
|
+
// Sort: Official first, then Source, then Name
|
|
120
|
+
skills.sort((a, b) => {
|
|
121
|
+
if (a.source === 'official' && b.source !== 'official') return -1;
|
|
122
|
+
if (b.source === 'official' && a.source !== 'official') return 1;
|
|
123
|
+
if (a.source !== b.source) return a.source.localeCompare(b.source);
|
|
124
|
+
return a.name.localeCompare(b.name);
|
|
125
|
+
});
|
|
128
126
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
skills.forEach(skill => {
|
|
128
|
+
let status = '';
|
|
129
|
+
if (skill.installed) {
|
|
130
|
+
status = skill.updateAvailable ? chalk.yellow('Update') : chalk.green('Installed');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
let versionDisplay = skill.remoteVersion || '0.0.0';
|
|
134
|
+
if (skill.installed && skill.localVersion) {
|
|
135
|
+
if (skill.updateAvailable) {
|
|
136
|
+
versionDisplay = `${chalk.dim(skill.localVersion)}→${chalk.yellow(skill.remoteVersion)}`;
|
|
137
|
+
} else {
|
|
138
|
+
versionDisplay = skill.localVersion;
|
|
134
139
|
}
|
|
135
140
|
}
|
|
136
|
-
}
|
|
137
141
|
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
table.push([
|
|
143
|
+
chalk.magenta(skill.source),
|
|
144
|
+
chalk.bold(skill.name),
|
|
145
|
+
versionDisplay,
|
|
146
|
+
status,
|
|
147
|
+
skill.description || chalk.dim('')
|
|
148
|
+
]);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
console.log(table.toString());
|
|
152
|
+
console.log(
|
|
153
|
+
chalk.dim(
|
|
154
|
+
`\nUse ${chalk.white('antikit list -i')} to select and install skills interactively.\n`
|
|
155
|
+
)
|
|
156
|
+
);
|
|
140
157
|
}
|
|
141
158
|
|
|
142
159
|
async function interactiveInstall(skills) {
|
package/src/commands/source.js
CHANGED
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
getConfigPath
|
|
8
8
|
} from '../utils/configManager.js';
|
|
9
9
|
|
|
10
|
+
import Table from 'cli-table3';
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* List all configured sources
|
|
12
14
|
*/
|
|
@@ -14,19 +16,25 @@ export function listSources() {
|
|
|
14
16
|
const sources = getSources();
|
|
15
17
|
|
|
16
18
|
console.log(chalk.bold('\nConfigured Sources:'));
|
|
17
|
-
|
|
19
|
+
|
|
20
|
+
const table = new Table({
|
|
21
|
+
head: [chalk.cyan('Name'), chalk.cyan('Repository'), chalk.cyan('Branch'), chalk.cyan('Path')],
|
|
22
|
+
colWidths: [20, 40, 15, 20],
|
|
23
|
+
style: { head: [], border: [] }
|
|
24
|
+
});
|
|
18
25
|
|
|
19
26
|
for (const source of sources) {
|
|
20
|
-
const defaultBadge = source.default ? chalk.green('
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
const defaultBadge = source.default ? chalk.green(' *') : '';
|
|
28
|
+
table.push([
|
|
29
|
+
chalk.bold(source.name) + defaultBadge,
|
|
30
|
+
`${source.owner}/${source.repo}`,
|
|
31
|
+
source.branch || 'main',
|
|
32
|
+
source.path || chalk.dim('(root)')
|
|
33
|
+
]);
|
|
25
34
|
}
|
|
26
35
|
|
|
27
|
-
console.log();
|
|
28
|
-
console.log(chalk.dim(
|
|
29
|
-
console.log();
|
|
36
|
+
console.log(table.toString());
|
|
37
|
+
console.log(chalk.dim(`\nConfig file: ${getConfigPath()}\n`));
|
|
30
38
|
}
|
|
31
39
|
|
|
32
40
|
/**
|