feat(cli): add scaffold command to set up an existing app (3/3)#538
Open
moranshe-max wants to merge 1 commit into
Open
feat(cli): add scaffold command to set up an existing app (3/3)#538moranshe-max wants to merge 1 commit into
scaffold command to set up an existing app (3/3)#538moranshe-max wants to merge 1 commit into
Conversation
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.54-pr.538.f4c963cPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.54-pr.538.f4c963c"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.54-pr.538.f4c963c"
}
}
Preview published to npm registry — try new features instantly! |
7a9d632 to
2ec38c9
Compare
8244989 to
e286bf4
Compare
2ec38c9 to
afa746c
Compare
e286bf4 to
46bf24d
Compare
afa746c to
8dbce4c
Compare
46bf24d to
dd70d92
Compare
722fd10 to
b7f735c
Compare
e502594 to
48e9697
Compare
b7f735c to
b9a7845
Compare
48e9697 to
ab0b4ea
Compare
4bf2800 to
e68a9cc
Compare
ab0b4ea to
54f3fe5
Compare
init command for Stripe Projects handoff (3/3)init command to scaffold an existing app (3/3)
init command to scaffold an existing app (3/3)init command to scaffold an existing app (3/4)
e68a9cc to
6ff70b0
Compare
init command to scaffold an existing app (3/4)scaffold command to set up an existing app (3/4)
scaffold command to set up an existing app (3/4)scaffold command to set up an existing app (3/3)
kfirstri
reviewed
Jun 10, 2026
|
|
||
| /** | ||
| * Post-scaffold steps shared by `create` and `init`: optionally push the | ||
| * Post-scaffold steps shared by `create` and `scaffold`: optionally push the |
kfirstri
reviewed
Jun 10, 2026
Comment on lines
+15
to
+17
| * Resolves the existing app ID from --app-id or the BASE44_APP_ID environment | ||
| * variable (e.g. written to `.env` by a CI pipeline or provisioning tool). | ||
| */ |
kfirstri
reviewed
Jun 10, 2026
| name: string | undefined, | ||
| options: ScaffoldOptions, | ||
| ): Promise<RunCommandResult> { | ||
| const appId = resolveAppId(options); |
Collaborator
There was a problem hiding this comment.
Consider checking if we're already inside an existing project? i think we're doing the same for create?
Collaborator
There was a problem hiding this comment.
oh i think you do this check at initProjectFile
kfirstri
reviewed
Jun 10, 2026
Comment on lines
+27
to
+29
| message: | ||
| "Or set the BASE44_APP_ID environment variable (e.g. via .env)", | ||
| }, |
Collaborator
There was a problem hiding this comment.
lets not show this to users yet, this is a feature we want to support in general, so just show the first message
kfirstri
reviewed
Jun 10, 2026
Comment on lines
+67
to
+71
| if (skippedFiles.length > 0) { | ||
| log.info( | ||
| `Kept existing file${skippedFiles.length > 1 ? "s" : ""}: ${skippedFiles.join(", ")}`, | ||
| ); | ||
| } |
kfirstri
reviewed
Jun 10, 2026
| t.expectResult(result).toContain("BASE44_APP_ID"); | ||
| }); | ||
|
|
||
| it("authenticates via env credentials without a stored login", async () => { |
Collaborator
There was a problem hiding this comment.
I think we tested this in the last PR.. not really relevant for scafolding
54f3fe5 to
8cc7307
Compare
f5ecf5c to
c952bd2
Compare
8cc7307 to
9daf582
Compare
c952bd2 to
94b420d
Compare
9daf582 to
e2744ae
Compare
Adds `base44 scaffold`, which sets up a local project for an already-existing Base44 app (provisioned externally, e.g. via env vars) without creating a new app. It resolves the app id from `--app-id` or the `BASE44_APP_ID` environment variable, renders the minimal backend-only template into the current directory (preserving any existing files), and runs the shared post-scaffold setup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
94b420d to
37a9767
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
Adds a new
base44 scaffoldcommand that sets up a local project directory for an existing Base44 app, rather than minting a new one likecreatedoes. The command resolves the target app id from--app-idor theBASE44_APP_IDenv var, renders thebackend-onlytemplate without clobbering pre-existing files, writes the app config, and runs the shared post-scaffold setup (push entities, deploy site, install skills, print summary).Related Issue
None
Type of Change
Changes Made
scaffoldcommand (cli/commands/project/scaffold.ts) that scaffolds the current directory for an existing app, resolving the app id from--app-idorBASE44_APP_IDand failing with a helpful hint when neither is present.cli/program.ts.initProjectFiles()incore/project/create.ts— likecreateProjectFiles()but skips thecreateProject()API call since the app already exists, and skips files that already exist so scaffolding never clobbers existing files like.gitignore.renderTemplate()incore/project/template.tswith askipExistingoption; it now returns the destination-relative paths of any skipped files.create/scaffoldsplit and their shared post-scaffold logic indocs/commands.md.tests/cli/scaffold.spec.tscovering app-id resolution precedence (flag over env), the missing-app-id error, the no-create-API behavior, and non-destructive scaffolding.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
scaffoldreuses the post-scaffold logic shared withcreateviaproject/scaffold-shared.ts(completeProjectSetup,getTemplateById,printProjectSummary). It runs non-interactively and skips site deployment by default, supporting--no-skillsto opt out of AI agent skills installation.🤖 Generated by Claude | 2026-06-10 12:46 UTC | f4c963c