create-twinbloc-app 0.1.5 → 0.1.7
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 +31 -25
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -93,17 +93,16 @@ const printBanner = () => {
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
const agentDirectories = [
|
|
96
|
-
{ key: "
|
|
97
|
-
{ key: "agent", path: ".agent", label: "Agent" },
|
|
98
|
-
{ key: "claude", path: ".claude", label: "Claude" },
|
|
99
|
-
{ key: "codex", path: ".codex", label: "Codex" },
|
|
96
|
+
{ key: "agent", path: ".agent/skills", label: "Vscode" },
|
|
100
97
|
{ key: "cursor", path: ".cursor", label: "Cursor" },
|
|
101
|
-
{ key: "
|
|
102
|
-
{ key: "
|
|
103
|
-
{ key: "
|
|
104
|
-
{ key: "
|
|
105
|
-
{ key: "
|
|
106
|
-
{ key: "
|
|
98
|
+
{ key: "claude", path: ".claude/skills", label: "Claude" },
|
|
99
|
+
{ key: "windsurf", path: ".windsurf/skills", label: "Windsurf" },
|
|
100
|
+
{ key: "codex", path: ".codex/skills", label: "Codex" },
|
|
101
|
+
{ key: "antigravity", path: ".agents/skills", label: "Antigravity" },
|
|
102
|
+
{ key: "github", path: ".github/skills", label: "Github" },
|
|
103
|
+
{ key: "kilocode", path: ".kilocode/skills", label: "Kilocode" },
|
|
104
|
+
{ key: "opencode", path: ".opencode/skills", label: "Opencode" },
|
|
105
|
+
{ key: "trae", path: ".trae/skills", label: "Trae" },
|
|
107
106
|
];
|
|
108
107
|
|
|
109
108
|
const getExistingAgentKeys = async (rootDir) => {
|
|
@@ -116,16 +115,6 @@ const getExistingAgentKeys = async (rootDir) => {
|
|
|
116
115
|
return existing;
|
|
117
116
|
};
|
|
118
117
|
|
|
119
|
-
const getAvailableAgentDirectories = async (rootDir) => {
|
|
120
|
-
const available = [];
|
|
121
|
-
for (const dir of agentDirectories) {
|
|
122
|
-
if (await fs.pathExists(path.join(rootDir, dir.path))) {
|
|
123
|
-
available.push(dir);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return available;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
118
|
const renderAgentSelectionHeader = () => {
|
|
130
119
|
output.write("\x1b[2J\x1b[0;0H");
|
|
131
120
|
printBanner();
|
|
@@ -227,14 +216,31 @@ const main = async () => {
|
|
|
227
216
|
await fs.copy(examplePath, targetDir, { overwrite: true });
|
|
228
217
|
}
|
|
229
218
|
|
|
230
|
-
const availableAgentDirectories = await getAvailableAgentDirectories(templateRoot);
|
|
231
219
|
const existingAgentKeys = await getExistingAgentKeys(targetDir);
|
|
232
|
-
const defaultKeys =
|
|
220
|
+
const defaultKeys = agentDirectories.filter((dir) => existingAgentKeys.has(dir.key)).map((dir) => dir.key);
|
|
221
|
+
|
|
222
|
+
const selectedKeys = await promptAgentSelection(agentDirectories, defaultKeys);
|
|
223
|
+
const selectedLabels = agentDirectories.filter((dir) => selectedKeys.has(dir.key)).map((dir) => dir.label);
|
|
224
|
+
|
|
225
|
+
// Copy skills from .agents/skills (master source) to other selected agents
|
|
226
|
+
const sourceAgent = agentDirectories.find((d) => d.key === "antigravity");
|
|
227
|
+
const sourcePath = path.join(targetDir, sourceAgent.path);
|
|
228
|
+
|
|
229
|
+
if (await fs.pathExists(sourcePath)) {
|
|
230
|
+
await Promise.all(
|
|
231
|
+
agentDirectories
|
|
232
|
+
.filter((dir) => selectedKeys.has(dir.key) && dir.key !== "antigravity")
|
|
233
|
+
.map(async (dir) => {
|
|
234
|
+
const destPath = path.join(targetDir, dir.path);
|
|
235
|
+
await fs.ensureDir(destPath);
|
|
236
|
+
await fs.copy(sourcePath, destPath, { overwrite: true });
|
|
237
|
+
}),
|
|
238
|
+
);
|
|
239
|
+
}
|
|
233
240
|
|
|
234
|
-
|
|
235
|
-
const selectedLabels = availableAgentDirectories.filter((dir) => selectedKeys.has(dir.key)).map((dir) => dir.label);
|
|
241
|
+
await Promise.all(agentDirectories.filter((dir) => selectedKeys.has(dir.key)).map((dir) => fs.ensureDir(path.join(targetDir, dir.path))));
|
|
236
242
|
|
|
237
|
-
const dirsToRemove =
|
|
243
|
+
const dirsToRemove = agentDirectories.filter((dir) => !selectedKeys.has(dir.key));
|
|
238
244
|
await Promise.all(dirsToRemove.map((dir) => fs.remove(path.join(targetDir, dir.path))));
|
|
239
245
|
|
|
240
246
|
const appName = path.basename(targetDir);
|