codebakers 2.5.4 → 3.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.
- package/README.md +54 -255
- package/dist/chunk-HOWR3YTF.js +146 -0
- package/dist/index.d.ts +0 -3
- package/dist/index.js +10488 -7993
- package/dist/terminal-6ZQVP6R7.js +10 -0
- package/package.json +26 -41
- package/AUDIT_REPORT.md +0 -138
- package/dist/advisors-RWRTSJRR.js +0 -7
- package/dist/chunk-ASIJIQYC.js +0 -320
- package/dist/chunk-D44U3IEA.js +0 -565
- package/dist/chunk-LANM5XQW.js +0 -326
- package/dist/prd-RYITSL6Q.js +0 -7
- package/install.bat +0 -9
- package/installers/CodeBakers-Install.bat +0 -207
- package/installers/CodeBakers-Install.command +0 -232
- package/installers/README.md +0 -157
- package/installers/mac/assets/README.txt +0 -31
- package/installers/mac/build-mac-installer.sh +0 -240
- package/installers/windows/CodeBakers.iss +0 -256
- package/installers/windows/assets/README.txt +0 -16
- package/installers/windows/scripts/post-install.bat +0 -15
- package/src/channels/discord.ts +0 -5
- package/src/channels/slack.ts +0 -5
- package/src/channels/sms.ts +0 -4
- package/src/channels/telegram.ts +0 -5
- package/src/channels/whatsapp.ts +0 -7
- package/src/commands/advisors.ts +0 -699
- package/src/commands/build.ts +0 -1025
- package/src/commands/check.ts +0 -365
- package/src/commands/code.ts +0 -806
- package/src/commands/connect.ts +0 -12
- package/src/commands/deploy.ts +0 -448
- package/src/commands/design.ts +0 -298
- package/src/commands/fix.ts +0 -20
- package/src/commands/gateway.ts +0 -604
- package/src/commands/generate.ts +0 -178
- package/src/commands/init.ts +0 -634
- package/src/commands/integrate.ts +0 -884
- package/src/commands/learn.ts +0 -36
- package/src/commands/migrate.ts +0 -419
- package/src/commands/prd-maker.ts +0 -588
- package/src/commands/prd.ts +0 -419
- package/src/commands/security.ts +0 -102
- package/src/commands/setup.ts +0 -600
- package/src/commands/status.ts +0 -56
- package/src/commands/website.ts +0 -741
- package/src/index.ts +0 -627
- package/src/patterns/loader.ts +0 -337
- package/src/services/github.ts +0 -61
- package/src/services/supabase.ts +0 -147
- package/src/services/vercel.ts +0 -61
- package/src/utils/claude-md.ts +0 -287
- package/src/utils/config.ts +0 -375
- package/src/utils/display.ts +0 -338
- package/src/utils/files.ts +0 -418
- package/src/utils/nlp.ts +0 -312
- package/src/utils/ui.ts +0 -441
- package/src/utils/updates.ts +0 -8
- package/src/utils/voice.ts +0 -323
- package/tsconfig.json +0 -26
package/dist/chunk-LANM5XQW.js
DELETED
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Config
|
|
3
|
-
} from "./chunk-ASIJIQYC.js";
|
|
4
|
-
|
|
5
|
-
// src/commands/prd.ts
|
|
6
|
-
import * as p from "@clack/prompts";
|
|
7
|
-
import chalk from "chalk";
|
|
8
|
-
import fs from "fs-extra";
|
|
9
|
-
import * as path from "path";
|
|
10
|
-
import Anthropic from "@anthropic-ai/sdk";
|
|
11
|
-
async function prdCommand(filePath) {
|
|
12
|
-
const config = new Config();
|
|
13
|
-
if (!config.isConfigured()) {
|
|
14
|
-
p.log.error("Please run `codebakers setup` first.");
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
p.intro(chalk.bgCyan.black(" Build from PRD "));
|
|
18
|
-
let prdPath = filePath;
|
|
19
|
-
if (!prdPath) {
|
|
20
|
-
const file = await p.text({
|
|
21
|
-
message: "Path to PRD file:",
|
|
22
|
-
placeholder: "./PRD.md or paste URL",
|
|
23
|
-
validate: (v) => !v ? "File path required" : void 0
|
|
24
|
-
});
|
|
25
|
-
if (p.isCancel(file)) return;
|
|
26
|
-
prdPath = file;
|
|
27
|
-
}
|
|
28
|
-
const spinner2 = p.spinner();
|
|
29
|
-
spinner2.start("Reading PRD...");
|
|
30
|
-
let prdContent;
|
|
31
|
-
try {
|
|
32
|
-
if (prdPath.startsWith("http")) {
|
|
33
|
-
const response = await fetch(prdPath);
|
|
34
|
-
prdContent = await response.text();
|
|
35
|
-
} else {
|
|
36
|
-
prdContent = await fs.readFile(prdPath, "utf-8");
|
|
37
|
-
}
|
|
38
|
-
} catch (error) {
|
|
39
|
-
spinner2.stop("Error");
|
|
40
|
-
p.log.error(`Could not read PRD: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
spinner2.stop("PRD loaded");
|
|
44
|
-
spinner2.start("Analyzing PRD...");
|
|
45
|
-
const anthropicCreds = config.getCredentials("anthropic");
|
|
46
|
-
if (!anthropicCreds?.apiKey) {
|
|
47
|
-
spinner2.stop("Error");
|
|
48
|
-
p.log.error("Anthropic API key not configured.");
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const anthropic = new Anthropic({ apiKey: anthropicCreds.apiKey });
|
|
52
|
-
const parsed = await parsePRD(anthropic, prdContent);
|
|
53
|
-
spinner2.stop("PRD analyzed");
|
|
54
|
-
console.log(chalk.bold("\n\u{1F4CB} Extracted from PRD:\n"));
|
|
55
|
-
console.log(` ${chalk.cyan("Name:")} ${parsed.name}`);
|
|
56
|
-
console.log(` ${chalk.cyan("Description:")} ${parsed.description}`);
|
|
57
|
-
console.log(` ${chalk.cyan("Features:")} ${parsed.features.length} features`);
|
|
58
|
-
console.log(` ${chalk.cyan("Pages:")} ${parsed.pages.join(", ") || "Auto-detect"}`);
|
|
59
|
-
console.log(` ${chalk.cyan("Database:")} ${parsed.database.length} tables`);
|
|
60
|
-
console.log(` ${chalk.cyan("Integrations:")} ${parsed.integrations.join(", ") || "None"}`);
|
|
61
|
-
console.log("");
|
|
62
|
-
if (parsed.features.length > 0) {
|
|
63
|
-
console.log(chalk.bold("Features to build:"));
|
|
64
|
-
parsed.features.slice(0, 10).forEach((f, i) => {
|
|
65
|
-
console.log(chalk.dim(` ${i + 1}. ${f}`));
|
|
66
|
-
});
|
|
67
|
-
if (parsed.features.length > 10) {
|
|
68
|
-
console.log(chalk.dim(` ... and ${parsed.features.length - 10} more`));
|
|
69
|
-
}
|
|
70
|
-
console.log("");
|
|
71
|
-
}
|
|
72
|
-
const proceed = await p.confirm({
|
|
73
|
-
message: "Build this project?",
|
|
74
|
-
initialValue: true
|
|
75
|
-
});
|
|
76
|
-
if (!proceed || p.isCancel(proceed)) {
|
|
77
|
-
p.cancel("Cancelled");
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const options = await p.group({
|
|
81
|
-
createInfra: () => p.confirm({
|
|
82
|
-
message: "Create GitHub + Vercel + Supabase?",
|
|
83
|
-
initialValue: true
|
|
84
|
-
}),
|
|
85
|
-
designProfile: () => p.select({
|
|
86
|
-
message: "Design profile:",
|
|
87
|
-
options: [
|
|
88
|
-
{ value: "minimal", label: "Minimal (Linear, Notion)" },
|
|
89
|
-
{ value: "bold", label: "Bold (Stripe, Ramp)" },
|
|
90
|
-
{ value: "editorial", label: "Editorial (Medium, Substack)" },
|
|
91
|
-
{ value: "playful", label: "Playful (Figma, Slack)" },
|
|
92
|
-
{ value: "premium", label: "Premium (Apple, Porsche)" },
|
|
93
|
-
{ value: "dashboard", label: "Dashboard (Datadog, Linear)" }
|
|
94
|
-
],
|
|
95
|
-
initialValue: parsed.design.profile || "minimal"
|
|
96
|
-
})
|
|
97
|
-
});
|
|
98
|
-
if (p.isCancel(options)) return;
|
|
99
|
-
await buildFromPRD(parsed, options, anthropic, config);
|
|
100
|
-
}
|
|
101
|
-
async function parsePRD(anthropic, content) {
|
|
102
|
-
const response = await anthropic.messages.create({
|
|
103
|
-
model: "claude-sonnet-4-5-20250929",
|
|
104
|
-
max_tokens: 4096,
|
|
105
|
-
messages: [{
|
|
106
|
-
role: "user",
|
|
107
|
-
content: `Analyze this PRD and extract structured information. Return JSON only, no explanation.
|
|
108
|
-
|
|
109
|
-
PRD:
|
|
110
|
-
${content}
|
|
111
|
-
|
|
112
|
-
Return this exact JSON structure:
|
|
113
|
-
{
|
|
114
|
-
"name": "project name (lowercase, hyphenated)",
|
|
115
|
-
"description": "one sentence description",
|
|
116
|
-
"features": ["feature 1", "feature 2", ...],
|
|
117
|
-
"pages": ["page1", "page2", ...],
|
|
118
|
-
"database": ["table1", "table2", ...],
|
|
119
|
-
"integrations": ["stripe", "supabase", ...],
|
|
120
|
-
"design": {
|
|
121
|
-
"profile": "minimal|bold|editorial|playful|premium|dashboard or null",
|
|
122
|
-
"brandColor": "#hexcolor or null"
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
Extract ALL features mentioned. Include auth, payments, dashboards, etc.
|
|
127
|
-
For pages, list actual pages/routes needed.
|
|
128
|
-
For database, list tables/entities needed.
|
|
129
|
-
For integrations, list third-party services mentioned.`
|
|
130
|
-
}]
|
|
131
|
-
});
|
|
132
|
-
const text2 = response.content[0].type === "text" ? response.content[0].text : "";
|
|
133
|
-
const jsonMatch = text2.match(/\{[\s\S]*\}/);
|
|
134
|
-
if (!jsonMatch) {
|
|
135
|
-
throw new Error("Could not parse PRD");
|
|
136
|
-
}
|
|
137
|
-
return JSON.parse(jsonMatch[0]);
|
|
138
|
-
}
|
|
139
|
-
async function buildFromPRD(prd, options, anthropic, config) {
|
|
140
|
-
const spinner2 = p.spinner();
|
|
141
|
-
const projectPath = path.join(process.cwd(), prd.name);
|
|
142
|
-
spinner2.start("Creating project structure...");
|
|
143
|
-
await fs.ensureDir(projectPath);
|
|
144
|
-
await fs.ensureDir(path.join(projectPath, ".codebakers"));
|
|
145
|
-
await fs.ensureDir(path.join(projectPath, "src", "app"));
|
|
146
|
-
await fs.ensureDir(path.join(projectPath, "src", "components"));
|
|
147
|
-
await fs.ensureDir(path.join(projectPath, "src", "lib"));
|
|
148
|
-
spinner2.stop("Project structure created");
|
|
149
|
-
spinner2.start("Saving PRD...");
|
|
150
|
-
await fs.writeFile(path.join(projectPath, "PRD.md"), await fs.readFile(process.cwd(), "utf-8").catch(() => JSON.stringify(prd, null, 2)));
|
|
151
|
-
await fs.writeJson(path.join(projectPath, ".codebakers", "prd.json"), prd, { spaces: 2 });
|
|
152
|
-
await fs.writeJson(path.join(projectPath, ".codebakers", "design.json"), {
|
|
153
|
-
profile: options.designProfile,
|
|
154
|
-
colors: prd.design.brandColor ? { brand: prd.design.brandColor } : void 0
|
|
155
|
-
}, { spaces: 2 });
|
|
156
|
-
spinner2.stop("PRD saved");
|
|
157
|
-
spinner2.start("Generating build plan...");
|
|
158
|
-
const buildPlan = await generateBuildPlan(anthropic, prd, options.designProfile);
|
|
159
|
-
await fs.writeJson(path.join(projectPath, ".codebakers", "build-plan.json"), buildPlan, { spaces: 2 });
|
|
160
|
-
spinner2.stop("Build plan generated");
|
|
161
|
-
console.log(chalk.bold("\n\u{1F3D7}\uFE0F Build Plan:\n"));
|
|
162
|
-
buildPlan.phases.forEach((phase, i) => {
|
|
163
|
-
console.log(chalk.cyan(`Phase ${i + 1}: ${phase.name}`));
|
|
164
|
-
phase.tasks.forEach((task) => {
|
|
165
|
-
console.log(chalk.dim(` \u2022 ${task}`));
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
console.log("");
|
|
169
|
-
const startBuild = await p.confirm({
|
|
170
|
-
message: "Start building?",
|
|
171
|
-
initialValue: true
|
|
172
|
-
});
|
|
173
|
-
if (!startBuild || p.isCancel(startBuild)) {
|
|
174
|
-
p.log.info(`Build plan saved to ${prd.name}/.codebakers/build-plan.json`);
|
|
175
|
-
p.log.info(`Run \`cd ${prd.name} && codebakers code\` to continue building.`);
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
for (let i = 0; i < buildPlan.phases.length; i++) {
|
|
179
|
-
const phase = buildPlan.phases[i];
|
|
180
|
-
console.log(chalk.bold(`
|
|
181
|
-
\u{1F4E6} Phase ${i + 1}: ${phase.name}
|
|
182
|
-
`));
|
|
183
|
-
for (const task of phase.tasks) {
|
|
184
|
-
spinner2.start(task);
|
|
185
|
-
try {
|
|
186
|
-
await executeTask(anthropic, projectPath, task, prd, options.designProfile);
|
|
187
|
-
spinner2.stop(`\u2713 ${task}`);
|
|
188
|
-
} catch (error) {
|
|
189
|
-
spinner2.stop(`\u2717 ${task}`);
|
|
190
|
-
p.log.error(error instanceof Error ? error.message : "Task failed");
|
|
191
|
-
const continueBuilding = await p.confirm({
|
|
192
|
-
message: "Continue with next task?",
|
|
193
|
-
initialValue: true
|
|
194
|
-
});
|
|
195
|
-
if (!continueBuilding || p.isCancel(continueBuilding)) {
|
|
196
|
-
p.log.info("Build paused. Run `codebakers code` to continue.");
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
if (options.createInfra) {
|
|
203
|
-
console.log(chalk.bold("\n\u{1F680} Setting up infrastructure...\n"));
|
|
204
|
-
spinner2.start("Creating GitHub repository...");
|
|
205
|
-
spinner2.stop("GitHub repository created");
|
|
206
|
-
spinner2.start("Creating Supabase project...");
|
|
207
|
-
spinner2.stop("Supabase project created");
|
|
208
|
-
spinner2.start("Creating Vercel project...");
|
|
209
|
-
spinner2.stop("Vercel project created");
|
|
210
|
-
spinner2.start("Deploying...");
|
|
211
|
-
spinner2.stop("Deployed!");
|
|
212
|
-
}
|
|
213
|
-
p.outro(chalk.green(`
|
|
214
|
-
\u2713 Project built from PRD!
|
|
215
|
-
|
|
216
|
-
${chalk.bold("Your project:")}
|
|
217
|
-
${chalk.cyan(`cd ${prd.name}`)}
|
|
218
|
-
${chalk.cyan("npm run dev")}
|
|
219
|
-
|
|
220
|
-
${chalk.bold("Continue building:")}
|
|
221
|
-
${chalk.cyan("codebakers code")} \u2014 AI agent
|
|
222
|
-
${chalk.cyan("codebakers check")} \u2014 Verify patterns
|
|
223
|
-
${chalk.cyan("codebakers deploy")} \u2014 Deploy changes
|
|
224
|
-
`));
|
|
225
|
-
}
|
|
226
|
-
async function generateBuildPlan(anthropic, prd, designProfile) {
|
|
227
|
-
const response = await anthropic.messages.create({
|
|
228
|
-
model: "claude-sonnet-4-5-20250929",
|
|
229
|
-
max_tokens: 4096,
|
|
230
|
-
messages: [{
|
|
231
|
-
role: "user",
|
|
232
|
-
content: `Create a build plan for this project. Return JSON only.
|
|
233
|
-
|
|
234
|
-
Project: ${prd.name}
|
|
235
|
-
Description: ${prd.description}
|
|
236
|
-
Features: ${prd.features.join(", ")}
|
|
237
|
-
Pages: ${prd.pages.join(", ")}
|
|
238
|
-
Database tables: ${prd.database.join(", ")}
|
|
239
|
-
Integrations: ${prd.integrations.join(", ")}
|
|
240
|
-
Design: ${designProfile}
|
|
241
|
-
|
|
242
|
-
Return this structure:
|
|
243
|
-
{
|
|
244
|
-
"phases": [
|
|
245
|
-
{
|
|
246
|
-
"name": "Phase name",
|
|
247
|
-
"tasks": ["task 1", "task 2", ...]
|
|
248
|
-
}
|
|
249
|
-
]
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
Phases should be:
|
|
253
|
-
1. Setup (package.json, config, base files)
|
|
254
|
-
2. Database (schema, migrations, types)
|
|
255
|
-
3. Auth (if needed)
|
|
256
|
-
4. Core Features (main functionality)
|
|
257
|
-
5. UI/Pages (frontend)
|
|
258
|
-
6. Integrations (third-party services)
|
|
259
|
-
7. Polish (loading states, error handling, empty states)
|
|
260
|
-
|
|
261
|
-
Keep tasks specific and actionable.`
|
|
262
|
-
}]
|
|
263
|
-
});
|
|
264
|
-
const text2 = response.content[0].type === "text" ? response.content[0].text : "";
|
|
265
|
-
const jsonMatch = text2.match(/\{[\s\S]*\}/);
|
|
266
|
-
if (!jsonMatch) {
|
|
267
|
-
throw new Error("Could not generate build plan");
|
|
268
|
-
}
|
|
269
|
-
return JSON.parse(jsonMatch[0]);
|
|
270
|
-
}
|
|
271
|
-
async function executeTask(anthropic, projectPath, task, prd, designProfile) {
|
|
272
|
-
const response = await anthropic.messages.create({
|
|
273
|
-
model: "claude-sonnet-4-5-20250929",
|
|
274
|
-
max_tokens: 8192,
|
|
275
|
-
messages: [{
|
|
276
|
-
role: "user",
|
|
277
|
-
content: `Execute this task for the project.
|
|
278
|
-
|
|
279
|
-
Project: ${prd.name}
|
|
280
|
-
Task: ${task}
|
|
281
|
-
Design Profile: ${designProfile}
|
|
282
|
-
|
|
283
|
-
Context:
|
|
284
|
-
- Features: ${prd.features.join(", ")}
|
|
285
|
-
- Database: ${prd.database.join(", ")}
|
|
286
|
-
|
|
287
|
-
Output files in this format:
|
|
288
|
-
|
|
289
|
-
<<<FILE: path/to/file.ts>>>
|
|
290
|
-
file content here
|
|
291
|
-
<<<END_FILE>>>
|
|
292
|
-
|
|
293
|
-
<<<FILE: another/file.tsx>>>
|
|
294
|
-
file content here
|
|
295
|
-
<<<END_FILE>>>
|
|
296
|
-
|
|
297
|
-
Follow these rules:
|
|
298
|
-
- Use TypeScript
|
|
299
|
-
- Use Next.js App Router
|
|
300
|
-
- Use Tailwind CSS
|
|
301
|
-
- Use shadcn/ui components
|
|
302
|
-
- Every button needs onClick handler
|
|
303
|
-
- Every form needs Zod validation
|
|
304
|
-
- Every async operation needs loading/error states
|
|
305
|
-
- Every list needs empty state
|
|
306
|
-
- No generic gradient heroes
|
|
307
|
-
- No icon spam
|
|
308
|
-
- Generous spacing (py-16 or larger for sections)
|
|
309
|
-
|
|
310
|
-
Generate ALL files needed for this task.`
|
|
311
|
-
}]
|
|
312
|
-
});
|
|
313
|
-
const text2 = response.content[0].type === "text" ? response.content[0].text : "";
|
|
314
|
-
const fileRegex = /<<<FILE:\s*(.+?)>>>([\s\S]*?)<<<END_FILE>>>/g;
|
|
315
|
-
let match;
|
|
316
|
-
while ((match = fileRegex.exec(text2)) !== null) {
|
|
317
|
-
const filePath = path.join(projectPath, match[1].trim());
|
|
318
|
-
const content = match[2].trim();
|
|
319
|
-
await fs.ensureDir(path.dirname(filePath));
|
|
320
|
-
await fs.writeFile(filePath, content);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
export {
|
|
325
|
-
prdCommand
|
|
326
|
-
};
|
package/dist/prd-RYITSL6Q.js
DELETED
package/install.bat
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
setlocal EnableDelayedExpansion
|
|
3
|
-
title CodeBakers Installer
|
|
4
|
-
color 0B
|
|
5
|
-
|
|
6
|
-
:: ============================================================================
|
|
7
|
-
:: CODEBAKERS INSTALLER FOR WINDOWS
|
|
8
|
-
:: ============================================================================
|
|
9
|
-
|
|
10
|
-
echo.
|
|
11
|
-
echo ================================================================
|
|
12
|
-
echo.
|
|
13
|
-
echo WELCOME TO CODEBAKERS
|
|
14
|
-
echo.
|
|
15
|
-
echo Build apps 10x faster with AI that follows YOUR rules
|
|
16
|
-
echo.
|
|
17
|
-
echo ================================================================
|
|
18
|
-
echo.
|
|
19
|
-
echo What you're getting:
|
|
20
|
-
echo.
|
|
21
|
-
echo * AI Coding Agent - Claude builds features for you
|
|
22
|
-
echo * Website Builder - Describe it, AI creates it
|
|
23
|
-
echo * One-Click Deploy - Push to production instantly
|
|
24
|
-
echo * 50+ Integrations - Stripe, Supabase, Twilio and more
|
|
25
|
-
echo.
|
|
26
|
-
echo ================================================================
|
|
27
|
-
echo.
|
|
28
|
-
echo Press any key to install...
|
|
29
|
-
pause >nul
|
|
30
|
-
|
|
31
|
-
:: ============================================================================
|
|
32
|
-
:: STEP 1: Check for Node.js
|
|
33
|
-
:: ============================================================================
|
|
34
|
-
|
|
35
|
-
echo.
|
|
36
|
-
echo ----------------------------------------------------------------
|
|
37
|
-
echo STEP 1: Checking for Node.js...
|
|
38
|
-
echo ----------------------------------------------------------------
|
|
39
|
-
echo.
|
|
40
|
-
|
|
41
|
-
node --version >nul 2>&1
|
|
42
|
-
if %errorlevel% neq 0 (
|
|
43
|
-
echo [!] Node.js is not installed.
|
|
44
|
-
echo.
|
|
45
|
-
echo CodeBakers requires Node.js to run.
|
|
46
|
-
echo.
|
|
47
|
-
echo Opening Node.js download page...
|
|
48
|
-
echo Install Node.js LTS, then run this installer again.
|
|
49
|
-
echo.
|
|
50
|
-
start https://nodejs.org/
|
|
51
|
-
echo Press any key to exit...
|
|
52
|
-
pause >nul
|
|
53
|
-
exit /b 1
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
for /f "tokens=*" %%i in ('node --version') do set NODE_VERSION=%%i
|
|
57
|
-
echo [OK] Node.js %NODE_VERSION% found
|
|
58
|
-
echo.
|
|
59
|
-
|
|
60
|
-
:: ============================================================================
|
|
61
|
-
:: STEP 2: Install CodeBakers (Silent - no npm output)
|
|
62
|
-
:: ============================================================================
|
|
63
|
-
|
|
64
|
-
echo ----------------------------------------------------------------
|
|
65
|
-
echo STEP 2: Installing CodeBakers...
|
|
66
|
-
echo ----------------------------------------------------------------
|
|
67
|
-
echo.
|
|
68
|
-
|
|
69
|
-
:: Always do silent install/update - npm handles versioning
|
|
70
|
-
call npm install -g codebakers@latest >nul 2>&1
|
|
71
|
-
|
|
72
|
-
:: Verify it worked
|
|
73
|
-
where codebakers >nul 2>&1
|
|
74
|
-
if %errorlevel% neq 0 (
|
|
75
|
-
echo [!] Installation failed. Retrying...
|
|
76
|
-
call npm install -g codebakers@latest
|
|
77
|
-
echo.
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
echo [OK] CodeBakers is ready!
|
|
81
|
-
echo.
|
|
82
|
-
|
|
83
|
-
:: ============================================================================
|
|
84
|
-
:: STEP 3: Choose Editor
|
|
85
|
-
:: ============================================================================
|
|
86
|
-
|
|
87
|
-
echo ----------------------------------------------------------------
|
|
88
|
-
echo STEP 3: Choose your code editor
|
|
89
|
-
echo ----------------------------------------------------------------
|
|
90
|
-
echo.
|
|
91
|
-
|
|
92
|
-
:: Detect installed editors
|
|
93
|
-
set CURSOR_INSTALLED=0
|
|
94
|
-
set VSCODE_INSTALLED=0
|
|
95
|
-
set WINDSURF_INSTALLED=0
|
|
96
|
-
|
|
97
|
-
where cursor >nul 2>&1 && set CURSOR_INSTALLED=1
|
|
98
|
-
where code >nul 2>&1 && set VSCODE_INSTALLED=1
|
|
99
|
-
where windsurf >nul 2>&1 && set WINDSURF_INSTALLED=1
|
|
100
|
-
|
|
101
|
-
echo Select your preferred editor:
|
|
102
|
-
echo.
|
|
103
|
-
|
|
104
|
-
set OPTION_NUM=0
|
|
105
|
-
|
|
106
|
-
if %CURSOR_INSTALLED%==1 (
|
|
107
|
-
set /a OPTION_NUM+=1
|
|
108
|
-
set "OPTION_!OPTION_NUM!=cursor"
|
|
109
|
-
echo [!OPTION_NUM!] Cursor
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
if %VSCODE_INSTALLED%==1 (
|
|
113
|
-
set /a OPTION_NUM+=1
|
|
114
|
-
set "OPTION_!OPTION_NUM!=vscode"
|
|
115
|
-
echo [!OPTION_NUM!] VS Code
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
if %WINDSURF_INSTALLED%==1 (
|
|
119
|
-
set /a OPTION_NUM+=1
|
|
120
|
-
set "OPTION_!OPTION_NUM!=windsurf"
|
|
121
|
-
echo [!OPTION_NUM!] Windsurf
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
set /a OPTION_NUM+=1
|
|
125
|
-
set "OPTION_!OPTION_NUM!=manual"
|
|
126
|
-
echo [!OPTION_NUM!] Other / I'll do it myself
|
|
127
|
-
|
|
128
|
-
echo.
|
|
129
|
-
set /p CHOICE=" Enter your choice (1-!OPTION_NUM!): "
|
|
130
|
-
|
|
131
|
-
:: Validate choice
|
|
132
|
-
if "!CHOICE!"=="" set CHOICE=1
|
|
133
|
-
if !CHOICE! gtr !OPTION_NUM! set CHOICE=!OPTION_NUM!
|
|
134
|
-
if !CHOICE! lss 1 set CHOICE=1
|
|
135
|
-
|
|
136
|
-
:: Get the selected option
|
|
137
|
-
set "SELECTED=!OPTION_%CHOICE%!"
|
|
138
|
-
|
|
139
|
-
:: ============================================================================
|
|
140
|
-
:: FINAL: Show instructions and optionally open editor
|
|
141
|
-
:: ============================================================================
|
|
142
|
-
|
|
143
|
-
echo.
|
|
144
|
-
echo ================================================================
|
|
145
|
-
echo.
|
|
146
|
-
echo [OK] CodeBakers installed successfully!
|
|
147
|
-
echo.
|
|
148
|
-
echo ================================================================
|
|
149
|
-
echo.
|
|
150
|
-
echo HERE'S WHAT TO DO NEXT:
|
|
151
|
-
echo.
|
|
152
|
-
echo 1. Open !SELECTED!
|
|
153
|
-
echo.
|
|
154
|
-
echo 2. Click "File" then "Open Folder"
|
|
155
|
-
echo Select ANY folder where you want to build
|
|
156
|
-
echo (Example: C:\dev\my-project)
|
|
157
|
-
echo.
|
|
158
|
-
echo 3. Open the terminal inside your editor
|
|
159
|
-
echo Press: Ctrl + ` (the key above Tab)
|
|
160
|
-
echo.
|
|
161
|
-
echo 4. Type this command and press Enter:
|
|
162
|
-
echo.
|
|
163
|
-
echo codebakers
|
|
164
|
-
echo.
|
|
165
|
-
echo ================================================================
|
|
166
|
-
echo.
|
|
167
|
-
echo That's it! CodeBakers will guide you from there.
|
|
168
|
-
echo.
|
|
169
|
-
echo ================================================================
|
|
170
|
-
echo.
|
|
171
|
-
|
|
172
|
-
if "!SELECTED!"=="manual" (
|
|
173
|
-
echo Press any key to exit...
|
|
174
|
-
pause >nul
|
|
175
|
-
exit /b 0
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
set /p OPEN_EDITOR=" Would you like to open !SELECTED! now? (Y/n): "
|
|
179
|
-
|
|
180
|
-
if /i "!OPEN_EDITOR!"=="n" (
|
|
181
|
-
echo.
|
|
182
|
-
echo No problem! Open !SELECTED! whenever you're ready.
|
|
183
|
-
echo.
|
|
184
|
-
echo Press any key to exit...
|
|
185
|
-
pause >nul
|
|
186
|
-
exit /b 0
|
|
187
|
-
)
|
|
188
|
-
|
|
189
|
-
echo.
|
|
190
|
-
echo Opening !SELECTED!...
|
|
191
|
-
echo.
|
|
192
|
-
echo Remember: Open a folder, then open terminal, then type 'codebakers'
|
|
193
|
-
echo.
|
|
194
|
-
|
|
195
|
-
if "!SELECTED!"=="cursor" (
|
|
196
|
-
start "" cursor
|
|
197
|
-
)
|
|
198
|
-
if "!SELECTED!"=="vscode" (
|
|
199
|
-
start "" code
|
|
200
|
-
)
|
|
201
|
-
if "!SELECTED!"=="windsurf" (
|
|
202
|
-
start "" windsurf
|
|
203
|
-
)
|
|
204
|
-
|
|
205
|
-
echo This window will close in 10 seconds...
|
|
206
|
-
timeout /t 10 >nul
|
|
207
|
-
exit /b 0
|