file:edit
file:edit
Section titled “file:edit”Edit file with audit trail
Options:
| Flag | Description | Required |
|---|---|---|
--path <path> | Path to file (alternative to positional) | No |
--old-string <str> | String to find and replace (required) | No |
--new-string <str> | Replacement string (required, can be empty) | No |
--old <str> | Shorthand for —old-string | No |
--new <str> | Shorthand for —new-string | No |
--replace-all | Replace all occurrences (default: single unique match) | No |
--encoding <enc> | File encoding (default: utf-8) | No |
--workspace-root <dir> | Contain edits to this directory (default: derived from git top-level / workspace root). | No |
--worktree-root <dir> | Reject edits outside this directory. Pass the output of git rev-parse —show-toplevel from inside your declared worktree to defend against parallel-agent cwd-inheritance leaks. | No |
--allow-outside-workspace | Escape workspace containment. Its use is recorded in the audit trail. | No |