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.
Output
The command returns JSON:See also
- Bring your own agent: How the sandbox works, and what you can change in it
sandbox edit: Apply exact string replacements to an existing filesandbox run: Run a shell command in the sandboxsandbox checkpoint: Save a restore point before or after a set of changes