Skip to main content
Create a new file in an app’s sandbox, the cloud environment that holds the app’s code. The change is committed as part of this command, becomes visible in the Base44 app editor, and is included when you publish, with no separate deploy or push step. Prefer sandbox edit for changing a file that already exists. It applies surgical replacements and returns a diff, so you can’t accidentally discard the rest of the file. Every path is relative to the app root. sandbox commands don’t require a local project. Target an app by passing --app-id, setting the BASE44_APP_ID environment variable, or running the command from a linked project if you have one.
This command needs the sandbox:write permission. The CLI requests it when you sign in, and an existing session cannot gain it afterwards. If the command fails with an authorization error, run base44 login again to start a session that has the proper permissions.

Usage

Arguments

Flags

Content piped on stdin is sent exactly as given, including leading and trailing whitespace and the final newline.
You can’t use this command to blank out or delete an existing file, since empty content is rejected. To delete a file, run base44 sandbox run "rm <path>". To blank one out instead, run base44 sandbox run "truncate -s 0 <path>". To create a new empty file, run base44 sandbox run "touch <path>".

Output

The command returns JSON:

See also