ai-agent-config 1.0.4 → 1.0.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/bin/cli.js +11 -1
- package/package.json +1 -1
- package/scripts/installer.js +56 -13
package/bin/cli.js
CHANGED
|
@@ -11,6 +11,10 @@ const path = require("path");
|
|
|
11
11
|
const platforms = require("../scripts/platforms");
|
|
12
12
|
const installer = require("../scripts/installer");
|
|
13
13
|
|
|
14
|
+
// Read version from package.json
|
|
15
|
+
const packageJson = require("../package.json");
|
|
16
|
+
const VERSION = packageJson.version;
|
|
17
|
+
|
|
14
18
|
const COMMANDS = {
|
|
15
19
|
init: "Initialize config file in home directory",
|
|
16
20
|
install: "Install skills to detected platforms",
|
|
@@ -18,13 +22,14 @@ const COMMANDS = {
|
|
|
18
22
|
list: "List available skills and workflows",
|
|
19
23
|
platforms: "Show detected platforms",
|
|
20
24
|
uninstall: "Remove installed skills",
|
|
25
|
+
version: "Show version number",
|
|
21
26
|
help: "Show this help message",
|
|
22
27
|
};
|
|
23
28
|
|
|
24
29
|
function showHelp() {
|
|
25
30
|
console.log(`
|
|
26
31
|
╔═══════════════════════════════════════════════════════════════╗
|
|
27
|
-
║ AI Agent Config CLI
|
|
32
|
+
║ AI Agent Config CLI v${VERSION.padEnd(27)}║
|
|
28
33
|
║ Universal Global Skills for AI Coding Assistants ║
|
|
29
34
|
╚═══════════════════════════════════════════════════════════════╝
|
|
30
35
|
|
|
@@ -298,6 +303,11 @@ switch (command) {
|
|
|
298
303
|
case "uninstall":
|
|
299
304
|
uninstall(args.slice(1));
|
|
300
305
|
break;
|
|
306
|
+
case "version":
|
|
307
|
+
case "--version":
|
|
308
|
+
case "-v":
|
|
309
|
+
console.log(`v${VERSION}`);
|
|
310
|
+
break;
|
|
301
311
|
case "help":
|
|
302
312
|
case "--help":
|
|
303
313
|
case "-h":
|
package/package.json
CHANGED
package/scripts/installer.js
CHANGED
|
@@ -107,6 +107,41 @@ function getAvailableWorkflows() {
|
|
|
107
107
|
.map((name) => name.replace(".md", ""));
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Copy workflows as skills for Claude Code
|
|
112
|
+
* Claude Code doesn't support workflows directory, so we convert them to skills
|
|
113
|
+
*/
|
|
114
|
+
function copyWorkflowsAsSkills(skillsPath, force = false) {
|
|
115
|
+
const results = [];
|
|
116
|
+
|
|
117
|
+
if (!fs.existsSync(REPO_WORKFLOWS_DIR)) {
|
|
118
|
+
return results;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const workflowFiles = fs.readdirSync(REPO_WORKFLOWS_DIR).filter((f) => f.endsWith(".md"));
|
|
122
|
+
|
|
123
|
+
for (const wfFile of workflowFiles) {
|
|
124
|
+
const workflowName = wfFile.replace(".md", "");
|
|
125
|
+
const srcPath = path.join(REPO_WORKFLOWS_DIR, wfFile);
|
|
126
|
+
const destDir = path.join(skillsPath, workflowName);
|
|
127
|
+
const destPath = path.join(destDir, "SKILL.md");
|
|
128
|
+
|
|
129
|
+
// Create skill directory
|
|
130
|
+
if (!fs.existsSync(destDir)) {
|
|
131
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (fs.existsSync(destPath) && !force) {
|
|
135
|
+
results.push({ name: workflowName, skipped: 1, copied: 0 });
|
|
136
|
+
} else {
|
|
137
|
+
fs.copyFileSync(srcPath, destPath);
|
|
138
|
+
results.push({ name: workflowName, skipped: 0, copied: 1 });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return results;
|
|
143
|
+
}
|
|
144
|
+
|
|
110
145
|
/**
|
|
111
146
|
* Install skills and workflows to a specific platform
|
|
112
147
|
*/
|
|
@@ -145,19 +180,27 @@ function installToPlatform(platform, options = {}) {
|
|
|
145
180
|
});
|
|
146
181
|
}
|
|
147
182
|
|
|
148
|
-
//
|
|
149
|
-
if (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
183
|
+
// Handle workflows based on platform
|
|
184
|
+
if (fs.existsSync(REPO_WORKFLOWS_DIR)) {
|
|
185
|
+
// Claude Code: Copy workflows as skills (workflows → skills/<name>/SKILL.md)
|
|
186
|
+
if (platform.name === "claude" && skillsPath) {
|
|
187
|
+
const workflowResults = copyWorkflowsAsSkills(skillsPath, force);
|
|
188
|
+
results.workflows = workflowResults;
|
|
189
|
+
}
|
|
190
|
+
// Other platforms (Antigravity): Copy workflows to workflows directory
|
|
191
|
+
else if (workflowsPath) {
|
|
192
|
+
const workflowFiles = fs.readdirSync(REPO_WORKFLOWS_DIR).filter((f) => f.endsWith(".md"));
|
|
193
|
+
|
|
194
|
+
for (const wfFile of workflowFiles) {
|
|
195
|
+
const srcPath = path.join(REPO_WORKFLOWS_DIR, wfFile);
|
|
196
|
+
const destPath = path.join(workflowsPath, wfFile);
|
|
197
|
+
|
|
198
|
+
if (fs.existsSync(destPath) && !force) {
|
|
199
|
+
results.workflows.push({ name: wfFile.replace(".md", ""), skipped: 1, copied: 0 });
|
|
200
|
+
} else {
|
|
201
|
+
fs.copyFileSync(srcPath, destPath);
|
|
202
|
+
results.workflows.push({ name: wfFile.replace(".md", ""), skipped: 0, copied: 1 });
|
|
203
|
+
}
|
|
161
204
|
}
|
|
162
205
|
}
|
|
163
206
|
}
|