cli-ai-skills 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,202 @@
1
+ const inquirer = require('inquirer');
2
+ const chalk = require('chalk');
3
+
4
+ class InstallationPrompts {
5
+ /**
6
+ * Prompt for installation scope
7
+ */
8
+ async askScope() {
9
+ const { scope } = await inquirer.prompt([
10
+ {
11
+ type: 'list',
12
+ name: 'scope',
13
+ message: 'šŸ“ Where do you want to install skills?',
14
+ choices: [
15
+ {
16
+ name: 'Global (available for all projects)',
17
+ value: 'global',
18
+ short: 'Global'
19
+ },
20
+ {
21
+ name: 'Local (current repository only)',
22
+ value: 'local',
23
+ short: 'Local'
24
+ }
25
+ ],
26
+ default: 'global'
27
+ }
28
+ ]);
29
+
30
+ return scope;
31
+ }
32
+
33
+ /**
34
+ * Prompt for platform selection
35
+ * @param {Object} platformInfo - Detected platform information
36
+ */
37
+ async askPlatforms(platformInfo) {
38
+ const choices = [];
39
+
40
+ if (platformInfo.copilot.installed || platformInfo.copilot.cliInstalled) {
41
+ choices.push({
42
+ name: `GitHub Copilot CLI (${platformInfo.copilot.globalPath})`,
43
+ value: 'copilot',
44
+ checked: true
45
+ });
46
+ }
47
+
48
+ if (platformInfo.claude.installed) {
49
+ choices.push({
50
+ name: `Claude Code (${platformInfo.claude.globalPath})`,
51
+ value: 'claude',
52
+ checked: true
53
+ });
54
+ }
55
+
56
+ if (choices.length === 0) {
57
+ throw new Error('No AI platforms detected. Install GitHub Copilot CLI or Claude Code first.');
58
+ }
59
+
60
+ const { platforms } = await inquirer.prompt([
61
+ {
62
+ type: 'checkbox',
63
+ name: 'platforms',
64
+ message: 'šŸ“¦ Select platforms to install skills for:',
65
+ choices,
66
+ validate: (answer) => {
67
+ if (answer.length === 0) {
68
+ return 'You must select at least one platform.';
69
+ }
70
+ return true;
71
+ }
72
+ }
73
+ ]);
74
+
75
+ return platforms;
76
+ }
77
+
78
+ /**
79
+ * Prompt for skill selection
80
+ * @param {Array} availableSkills - List of available skills
81
+ */
82
+ async askSkills(availableSkills) {
83
+ const choices = availableSkills.map(skill => ({
84
+ name: `${skill.name} v${skill.version} - ${skill.description}`,
85
+ value: skill.name,
86
+ checked: false
87
+ }));
88
+
89
+ choices.push({
90
+ name: chalk.bold('All skills'),
91
+ value: '__ALL__',
92
+ checked: false
93
+ });
94
+
95
+ const { skills } = await inquirer.prompt([
96
+ {
97
+ type: 'checkbox',
98
+ name: 'skills',
99
+ message: 'šŸŽÆ Which skills do you want to install?',
100
+ choices,
101
+ pageSize: 10,
102
+ validate: (answer) => {
103
+ if (answer.length === 0) {
104
+ return 'You must select at least one skill.';
105
+ }
106
+ return true;
107
+ }
108
+ }
109
+ ]);
110
+
111
+ // If "All skills" selected, return all skill names
112
+ if (skills.includes('__ALL__')) {
113
+ return availableSkills.map(s => s.name);
114
+ }
115
+
116
+ return skills;
117
+ }
118
+
119
+ /**
120
+ * Prompt for update decision
121
+ * @param {string} skillName - Name of the skill
122
+ * @param {Object} versionInfo - Version comparison info
123
+ */
124
+ async askUpdate(skillName, versionInfo) {
125
+ const choices = [];
126
+
127
+ if (versionInfo.needsUpdate) {
128
+ choices.push({
129
+ name: `Update to v${versionInfo.latestVersion}`,
130
+ value: 'update'
131
+ });
132
+ choices.push({
133
+ name: `Keep v${versionInfo.currentVersion}`,
134
+ value: 'keep'
135
+ });
136
+ } else {
137
+ choices.push({
138
+ name: 'Keep current version',
139
+ value: 'keep'
140
+ });
141
+ }
142
+
143
+ choices.push({
144
+ name: 'Reinstall current version',
145
+ value: 'reinstall'
146
+ });
147
+ choices.push({
148
+ name: 'Skip',
149
+ value: 'skip'
150
+ });
151
+
152
+ const { action } = await inquirer.prompt([
153
+ {
154
+ type: 'list',
155
+ name: 'action',
156
+ message: `${skillName} v${versionInfo.currentVersion} is ${versionInfo.status}. What would you like to do?`,
157
+ choices
158
+ }
159
+ ]);
160
+
161
+ return action;
162
+ }
163
+
164
+ /**
165
+ * Confirm local installation
166
+ */
167
+ async confirmLocalInstallation() {
168
+ console.log(chalk.yellow('\nšŸ“‚ Local installation will create:'));
169
+ console.log(' .github/skills/ (for GitHub Copilot)');
170
+ console.log(' .claude/skills/ (for Claude Code)');
171
+ console.log(chalk.dim('\nāš ļø Note: Local skills only work when inside this repository\n'));
172
+
173
+ const { confirm } = await inquirer.prompt([
174
+ {
175
+ type: 'confirm',
176
+ name: 'confirm',
177
+ message: 'Proceed with local installation?',
178
+ default: true
179
+ }
180
+ ]);
181
+
182
+ return confirm;
183
+ }
184
+
185
+ /**
186
+ * Confirm overwrite
187
+ */
188
+ async confirmOverwrite(skillName, platform) {
189
+ const { confirm } = await inquirer.prompt([
190
+ {
191
+ type: 'confirm',
192
+ name: 'confirm',
193
+ message: `${skillName} already exists in ${platform}. Overwrite?`,
194
+ default: false
195
+ }
196
+ ]);
197
+
198
+ return confirm;
199
+ }
200
+ }
201
+
202
+ module.exports = InstallationPrompts;
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "cli-ai-skills",
3
+ "version": "1.0.0",
4
+ "description": "Install AI skills for GitHub Copilot CLI and Claude Code",
5
+ "main": "lib/index.js",
6
+ "bin": {
7
+ "cli-ai-skills": "bin/cli.js"
8
+ },
9
+ "scripts": {
10
+ "test": "node bin/cli.js --help",
11
+ "link": "npm link",
12
+ "unlink": "npm unlink -g cli-ai-skills",
13
+ "prepublishOnly": "npm test",
14
+ "version": "git add -A",
15
+ "postversion": "git push && git push --tags"
16
+ },
17
+ "keywords": [
18
+ "copilot",
19
+ "claude",
20
+ "ai",
21
+ "skills",
22
+ "cli",
23
+ "prompt-engineering",
24
+ "github-copilot",
25
+ "claude-code"
26
+ ],
27
+ "author": "Eric Andrade",
28
+ "license": "MIT",
29
+ "engines": {
30
+ "node": ">=14.0.0"
31
+ },
32
+ "files": [
33
+ "bin/",
34
+ "lib/",
35
+ "README.md"
36
+ ],
37
+ "dependencies": {
38
+ "axios": "^1.6.5",
39
+ "chalk": "^4.1.2",
40
+ "commander": "^11.1.0",
41
+ "fs-extra": "^11.2.0",
42
+ "inquirer": "^8.2.5",
43
+ "js-yaml": "^4.1.0",
44
+ "ora": "^5.4.1",
45
+ "semver": "^7.5.4"
46
+ },
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/ericgandrade/cli-ai-skills.git"
50
+ },
51
+ "bugs": {
52
+ "url": "https://github.com/ericgandrade/cli-ai-skills/issues"
53
+ },
54
+ "homepage": "https://github.com/ericgandrade/cli-ai-skills#readme"
55
+ }