Skip to content

file:edit

← Back to CLI Commands

Edit file with audit trail

pnpm file:edit

Options:

FlagDescriptionRequired
--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-stringNo
--new <str>Shorthand for —new-stringNo
--replace-allReplace 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-workspaceEscape workspace containment. Its use is recorded in the audit trail.No

← Back to CLI Commands