@base44-preview/cli 0.0.15-pr.95.a5dcdb8 → 0.0.15-pr.95.ac0a180
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/cli/index.js +46 -17
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -37980,6 +37980,13 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
37980
37980
|
//#region src/cli/commands/project/create.ts
|
|
37981
37981
|
var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
|
|
37982
37982
|
const DEFAULT_TEMPLATE_ID = "backend-only";
|
|
37983
|
+
const SUPPORTED_AGENTS = [{
|
|
37984
|
+
value: "cursor",
|
|
37985
|
+
label: "Cursor"
|
|
37986
|
+
}, {
|
|
37987
|
+
value: "claude-code",
|
|
37988
|
+
label: "Claude Code"
|
|
37989
|
+
}];
|
|
37983
37990
|
async function getTemplateById(templateId) {
|
|
37984
37991
|
const templates = await listTemplates();
|
|
37985
37992
|
const template = templates.find((t) => t.id === templateId);
|
|
@@ -38075,26 +38082,12 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38075
38082
|
id: projectId,
|
|
38076
38083
|
projectRoot: resolvedPath
|
|
38077
38084
|
});
|
|
38078
|
-
let shouldAddSkills;
|
|
38079
|
-
if (isInteractive) {
|
|
38080
|
-
const result = await ye({ message: "Add AI agent skills? (Helps AI assistants like Cursor, Claude Code work with Base44)" });
|
|
38081
|
-
shouldAddSkills = !pD(result) && result;
|
|
38082
|
-
} else shouldAddSkills = !!skills;
|
|
38083
|
-
if (shouldAddSkills) await runTask("Adding AI agent skills...", async () => {
|
|
38084
|
-
await execa({
|
|
38085
|
-
cwd: resolvedPath,
|
|
38086
|
-
shell: true
|
|
38087
|
-
})`npx -y add-skill base44/skills`;
|
|
38088
|
-
}, {
|
|
38089
|
-
successMessage: theme.colors.base44Orange("AI agent skills added successfully"),
|
|
38090
|
-
errorMessage: "Failed to add AI agent skills"
|
|
38091
|
-
});
|
|
38092
38085
|
const { project, entities } = await readProjectConfig(resolvedPath);
|
|
38093
38086
|
let finalAppUrl;
|
|
38094
38087
|
if (entities.length > 0) {
|
|
38095
38088
|
let shouldPushEntities;
|
|
38096
38089
|
if (isInteractive) {
|
|
38097
|
-
const result = await
|
|
38090
|
+
const result = await confirm({ message: "Set up the backend data now? (This pushes the data models used by the template to Base44)" });
|
|
38098
38091
|
shouldPushEntities = !pD(result) && result;
|
|
38099
38092
|
} else shouldPushEntities = !!deploy;
|
|
38100
38093
|
if (shouldPushEntities) await runTask(`Pushing ${entities.length} data models to Base44...`, async () => {
|
|
@@ -38108,7 +38101,7 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38108
38101
|
const { installCommand, buildCommand, outputDirectory } = project.site;
|
|
38109
38102
|
let shouldDeploy;
|
|
38110
38103
|
if (isInteractive) {
|
|
38111
|
-
const result = await
|
|
38104
|
+
const result = await confirm({ message: "Would you like to deploy the site now? (Hosted on Base44)" });
|
|
38112
38105
|
shouldDeploy = !pD(result) && result;
|
|
38113
38106
|
} else shouldDeploy = !!deploy;
|
|
38114
38107
|
if (shouldDeploy && installCommand && buildCommand && outputDirectory) {
|
|
@@ -38131,12 +38124,48 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38131
38124
|
finalAppUrl = appUrl;
|
|
38132
38125
|
}
|
|
38133
38126
|
}
|
|
38127
|
+
let selectedAgents = [];
|
|
38128
|
+
if (isInteractive) {
|
|
38129
|
+
const result = await fe({
|
|
38130
|
+
message: "Add AI agent skills? (Select agents to configure)",
|
|
38131
|
+
options: SUPPORTED_AGENTS.map((agent) => ({
|
|
38132
|
+
value: agent.value,
|
|
38133
|
+
label: agent.label
|
|
38134
|
+
})),
|
|
38135
|
+
initialValues: SUPPORTED_AGENTS.map((agent) => agent.value),
|
|
38136
|
+
required: false
|
|
38137
|
+
});
|
|
38138
|
+
if (!pD(result)) selectedAgents = result;
|
|
38139
|
+
} else if (skills) selectedAgents = SUPPORTED_AGENTS.map((agent) => agent.value);
|
|
38140
|
+
if (selectedAgents.length > 0) {
|
|
38141
|
+
const agentArgs = selectedAgents.flatMap((agent) => ["-a", agent]);
|
|
38142
|
+
M.message("Installing skills for: " + selectedAgents.join(", "));
|
|
38143
|
+
try {
|
|
38144
|
+
await execa("npx", [
|
|
38145
|
+
"-y",
|
|
38146
|
+
"add-skill",
|
|
38147
|
+
"base44/skills",
|
|
38148
|
+
"-y",
|
|
38149
|
+
"-s",
|
|
38150
|
+
"base44-cli",
|
|
38151
|
+
"-s",
|
|
38152
|
+
"base44-sdk",
|
|
38153
|
+
...agentArgs
|
|
38154
|
+
], {
|
|
38155
|
+
cwd: resolvedPath,
|
|
38156
|
+
stdio: "inherit"
|
|
38157
|
+
});
|
|
38158
|
+
M.message(theme.colors.base44Orange("AI agent skills added successfully"));
|
|
38159
|
+
} catch (error) {
|
|
38160
|
+
M.message("Failed to add AI agent skills - you can add them later with: npx add-skill base44/skills");
|
|
38161
|
+
}
|
|
38162
|
+
}
|
|
38134
38163
|
M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
|
|
38135
38164
|
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
|
|
38136
38165
|
if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
38137
38166
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
38138
38167
|
}
|
|
38139
|
-
const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--skills", "Add AI agent skills (Cursor, Claude Code
|
|
38168
|
+
const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--skills", "Add AI agent skills (Cursor, Claude Code)").hook("preAction", validateNonInteractiveFlags$1).action(async (options) => {
|
|
38140
38169
|
await chooseCreate(options);
|
|
38141
38170
|
});
|
|
38142
38171
|
|
package/package.json
CHANGED