@baseline-studio/cli 2.2.1 → 2.2.2
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/dist/commands/init.js +21 -7
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -28,11 +28,15 @@ async function init() {
|
|
|
28
28
|
console.log(` ───────────────────────────────────\n`);
|
|
29
29
|
// 1. Gather basic info
|
|
30
30
|
const clientName = await ask(rl, " What's your company or project name? ");
|
|
31
|
-
const folder = `${clientName.toLowerCase().replace(/\s+/g, "-")}-system`;
|
|
32
31
|
const repo = "TrentM6/baseline-core";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
// Use current directory if empty, otherwise create a subfolder
|
|
33
|
+
const cwd = process.cwd();
|
|
34
|
+
const cwdEntries = (0, fs_1.readdirSync)(cwd).filter((f) => !f.startsWith("."));
|
|
35
|
+
const destDir = cwdEntries.length === 0
|
|
36
|
+
? cwd
|
|
37
|
+
: (0, path_1.join)(cwd, `${clientName.toLowerCase().replace(/\s+/g, "-")}-system`);
|
|
38
|
+
if (destDir !== cwd && (0, fs_1.existsSync)(destDir)) {
|
|
39
|
+
console.error(`\n Error: ${destDir} already exists.\n`);
|
|
36
40
|
rl.close();
|
|
37
41
|
process.exit(1);
|
|
38
42
|
}
|
|
@@ -85,6 +89,10 @@ async function init() {
|
|
|
85
89
|
}
|
|
86
90
|
console.log(` ── ${prompt.title} ──\n`);
|
|
87
91
|
const answers = [];
|
|
92
|
+
// Pre-fill company name into identity file
|
|
93
|
+
if (ctxFile === "core/identity.md") {
|
|
94
|
+
answers.push(`**What is your company name?**\n${clientName}`);
|
|
95
|
+
}
|
|
88
96
|
for (const q of prompt.questions) {
|
|
89
97
|
const answer = await ask(rl, ` ${q}\n > `);
|
|
90
98
|
if (answer.trim()) {
|
|
@@ -148,12 +156,18 @@ async function init() {
|
|
|
148
156
|
// Clean up
|
|
149
157
|
(0, fs_1.rmSync)(tmpDir, { recursive: true });
|
|
150
158
|
rl.close();
|
|
159
|
+
const displayPath = destDir === cwd ? "." : `./${clientName.toLowerCase().replace(/\s+/g, "-")}-system`;
|
|
160
|
+
const skillCount = (0, fs_1.existsSync)((0, path_1.join)(destDir, "skills")) ? (0, fs_1.readdirSync)((0, path_1.join)(destDir, "skills")).filter((f) => !f.startsWith(".") && !f.startsWith("_")).length : 0;
|
|
161
|
+
const frameworkCount = (0, fs_1.existsSync)((0, path_1.join)(destDir, "frameworks")) ? (0, fs_1.readdirSync)((0, path_1.join)(destDir, "frameworks")).filter((f) => !f.startsWith(".") && !f.startsWith("_")).length : 0;
|
|
162
|
+
const scriptCount = (0, fs_1.existsSync)((0, path_1.join)(destDir, "scripts")) ? (0, fs_1.readdirSync)((0, path_1.join)(destDir, "scripts")).filter((f) => !f.startsWith(".") && !f.startsWith("_")).length : 0;
|
|
151
163
|
console.log(` ───────────────────────────────────`);
|
|
152
|
-
console.log(` ${clientName} system created at
|
|
164
|
+
console.log(` ${clientName} system created at ${displayPath}`);
|
|
153
165
|
console.log(` Version: v${latest}`);
|
|
154
|
-
console.log(`
|
|
166
|
+
console.log(` ${skillCount} skills | ${frameworkCount} frameworks | ${scriptCount} scripts`);
|
|
155
167
|
console.log(`\n Next steps:`);
|
|
156
|
-
|
|
168
|
+
if (destDir !== cwd) {
|
|
169
|
+
console.log(` cd ${clientName.toLowerCase().replace(/\s+/g, "-")}-system`);
|
|
170
|
+
}
|
|
157
171
|
console.log(` Edit context/ files to add more detail`);
|
|
158
172
|
console.log(` Run \`npx baseline status\` to check for updates\n`);
|
|
159
173
|
}
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const program = new commander_1.Command();
|
|
|
9
9
|
program
|
|
10
10
|
.name("baseline")
|
|
11
11
|
.description("Distribute and update the Baseline System")
|
|
12
|
-
.version("2.2.
|
|
12
|
+
.version("2.2.2");
|
|
13
13
|
program
|
|
14
14
|
.command("status")
|
|
15
15
|
.description("Show current version and check for updates")
|