Skip to content

feat(eject): adding a new command#220

Merged
kfirstri merged 23 commits intomainfrom
eject-command
Feb 10, 2026
Merged

feat(eject): adding a new command#220
kfirstri merged 23 commits intomainfrom
eject-command

Conversation

@dor-chaouat
Copy link
Contributor

@dor-chaouat dor-chaouat commented Feb 9, 2026

Note

Description

This PR adds a new base44 eject command that allows users to download the code for an existing Base44 project with managed source code. The command downloads the project's code as a tarball, extracts it to a local directory, creates a new Base44 project (a copy of the original), links it, and optionally deploys it.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added new eject command in src/cli/commands/project/eject.ts with support for interactive project selection or --project-id flag
  • Implemented downloadProject() API function to stream tar.gz response from /api/apps/{id}/eject endpoint
  • Added createProjectFilesForExistingProject() helper to extract downloaded project files
  • Extended deployAction() to accept optional projectRoot parameter for deploying ejected projects
  • Added new error hints for 400 status codes in ApiError
  • Implemented snake_case to camelCase transformation in ProjectSchema using Zod's .transform()
  • Added makeDirectory() utility function in src/core/utils/fs.ts
  • Created comprehensive test suite in tests/cli/eject.spec.ts with fixtures and tar mocking
  • Updated AGENTS.md with documentation on snake_case → camelCase API response transformation pattern

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

The command supports both interactive mode (with project selection prompt) and non-interactive mode (using --project-id and -y flags). Only projects with is_managed_source_code: true can be ejected. The ejected project creates a new Base44 app (named "{original} Copy") and automatically links it to avoid conflicts with the original project.


🤖 Generated by Claude | 2026-02-10 23:45 UTC

Copy link
Collaborator

@kfirstri kfirstri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small changes

@github-project-automation github-project-automation bot moved this from Backlog to Ready in CLI Development Feb 10, 2026
@kfirstri
Copy link
Collaborator

oh and please add a basic test for this in tests/cli

@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.30-pr.220.650c524

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.30-pr.220.650c524"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.30-pr.220.650c524"
  }
}

Preview published to npm registry — try new features instantly!

@base44 base44 deleted a comment from claude bot Feb 10, 2026
@base44 base44 deleted a comment from claude bot Feb 10, 2026
@base44 base44 deleted a comment from claude bot Feb 10, 2026
@base44 base44 deleted a comment from claude bot Feb 10, 2026
@base44 base44 deleted a comment from claude bot Feb 10, 2026
@base44 base44 deleted a comment from claude bot Feb 10, 2026
@github-project-automation github-project-automation bot moved this from Ready to In review in CLI Development Feb 10, 2026
@kfirstri kfirstri merged commit b6f5c63 into main Feb 10, 2026
11 checks passed
@kfirstri kfirstri deleted the eject-command branch February 10, 2026 15:43
@github-project-automation github-project-automation bot moved this from In review to Done in CLI Development Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants