base44 sandbox run "rm src/old-page.jsx" to delete a file. The same goes for creating an empty file, which sandbox write rejects, so use base44 sandbox run "touch notes.txt" there too.
The command runs from the app root unless you pass --cwd. 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 it.Usage
-l or --force is read as a flag for base44 instead of being passed through:
Arguments
Flags
A command still running past its timeout is stopped and fails with
TIMEOUT.
Output
The command returns JSON:Working directory
Each command runs in its own shell, so acd does not carry over to the next one. Set the directory with --cwd, or chain the commands together:
See also
- Bring your own agent: How the sandbox works, and what you can change in it
sandbox edit: Apply exact string replacements to a filesandbox write: Create a new file in the sandboxsandbox checkpoint: Save a restore point before or after a set of changes