@b0tts/template-dev-installer 1.0.2 → 1.0.4
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.mjs
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
// the current working directory.
|
|
6
6
|
//
|
|
7
7
|
// Categories:
|
|
8
|
-
// 1. Skills
|
|
9
|
-
// 2. OpenCode
|
|
10
|
-
// 3. Pi
|
|
11
|
-
// 4. All
|
|
8
|
+
// 1. Skills — AGENTS.md, README.md, .agents/, b0ttsagent/ (additive)
|
|
9
|
+
// 2. OpenCode — .opencode/plugins/, opencode.json, settings.json
|
|
10
|
+
// 3. Pi — .pi/agent/settings.json, extensions/, mcp.json
|
|
11
|
+
// 4. All — everything above
|
|
12
12
|
// ────────────────────────────────────────────────────────────────────
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import { checkbox, confirm } from "@inquirer/prompts";
|
|
15
15
|
import { cpSync, existsSync } from "node:fs";
|
|
16
16
|
import { resolve, dirname } from "node:path";
|
|
17
17
|
import { fileURLToPath } from "node:url";
|
|
@@ -26,11 +26,15 @@ const CWD = process.cwd();
|
|
|
26
26
|
|
|
27
27
|
const CATEGORIES = {
|
|
28
28
|
skills: {
|
|
29
|
-
label: "Skills (AGENTS.md, README.md, .agents/)",
|
|
29
|
+
label: "Skills (AGENTS.md, README.md, .agents/, b0ttsagent/)",
|
|
30
30
|
items: [
|
|
31
31
|
{ src: "AGENTS.md", dest: "AGENTS.md" },
|
|
32
32
|
{ src: "README.md", dest: "README.md" },
|
|
33
33
|
{ src: ".agents", dest: ".agents" },
|
|
34
|
+
{ src: "b0ttsagent/temp", dest: "b0ttsagent/temp", additive: true },
|
|
35
|
+
{ src: "b0ttsagent/sessionlogs", dest: "b0ttsagent/sessionlogs", additive: true },
|
|
36
|
+
{ src: "b0ttsagent/handoffs", dest: "b0ttsagent/handoffs", additive: true },
|
|
37
|
+
{ src: "b0ttsagent/NavGuides", dest: "b0ttsagent/NavGuides", additive: true },
|
|
34
38
|
],
|
|
35
39
|
},
|
|
36
40
|
opencode: {
|
|
@@ -66,8 +70,14 @@ function copyItem(item) {
|
|
|
66
70
|
console.log(` ✘ Source not found: ${item.src} (skipping)`);
|
|
67
71
|
return;
|
|
68
72
|
}
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
if (item.additive && existsSync(dest)) {
|
|
74
|
+
console.log(` → ${item.dest} already exists — skipping.`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (!item.additive) {
|
|
78
|
+
warnIfExists(dest);
|
|
79
|
+
}
|
|
80
|
+
cpSync(src, dest, { recursive: true, force: !item.additive });
|
|
71
81
|
console.log(` ✓ ${item.dest}`);
|
|
72
82
|
}
|
|
73
83
|
|
|
@@ -86,38 +96,38 @@ async function main() {
|
|
|
86
96
|
console.log(" Development Template Installer");
|
|
87
97
|
console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
|
|
88
98
|
|
|
89
|
-
const
|
|
90
|
-
message: "
|
|
99
|
+
const chosen = await checkbox({
|
|
100
|
+
message: "Select categories to install (Space to toggle, Enter to confirm):",
|
|
91
101
|
choices: [
|
|
92
|
-
{ name: "
|
|
93
|
-
{ name: "
|
|
94
|
-
{ name: "
|
|
95
|
-
{ name: "
|
|
102
|
+
{ name: "All", value: "all" },
|
|
103
|
+
{ name: "Skills", value: "skills" },
|
|
104
|
+
{ name: "OpenCode", value: "opencode" },
|
|
105
|
+
{ name: "Pi", value: "pi" },
|
|
96
106
|
],
|
|
97
107
|
});
|
|
98
108
|
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
installCategory(
|
|
109
|
+
if (chosen.length === 0) {
|
|
110
|
+
console.log("Nothing selected. Aborted.");
|
|
111
|
+
process.exit(0);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Determine what to install
|
|
115
|
+
const toInstall = chosen.includes("all")
|
|
116
|
+
? Object.keys(CATEGORIES)
|
|
117
|
+
: chosen;
|
|
118
|
+
|
|
119
|
+
const labels = toInstall.map((n) => CATEGORIES[n].label.split(" (")[0]).join(", ");
|
|
120
|
+
const ok = await confirm({
|
|
121
|
+
message: `Install ${labels} into ${CWD}?`,
|
|
122
|
+
default: true,
|
|
123
|
+
});
|
|
124
|
+
if (!ok) {
|
|
125
|
+
console.log("Aborted.");
|
|
126
|
+
process.exit(0);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
for (const name of toInstall) {
|
|
130
|
+
installCategory(name);
|
|
121
131
|
}
|
|
122
132
|
|
|
123
133
|
console.log("\n✔ Done.\n");
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b0tts/template-dev-installer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive installer for the DevelopmentTemplate — pick Skills, OpenCode, Pi, or install everything at once.",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"files/"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@inquirer/prompts": "^5.0.0"
|
|
14
|
+
"@inquirer/prompts": "^5.0.0",
|
|
15
|
+
"adm-zip": "^0.5.17"
|
|
15
16
|
},
|
|
16
17
|
"keywords": [
|
|
17
18
|
"template",
|