ashlr__rename_file
Rename or move a file. Logs the operation to the session and triggers the genome auto-propose hook.
ashlr__rename_file renames or moves a file from one path to another.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | yes | Source path (absolute or cwd-relative). |
to | string | yes | Destination path (absolute or cwd-relative). |
dryRun | boolean | no | If true, list planned edits without writing or renaming (default false). |
maxFiles | number | no | Hard cap on importer candidate files (default 200). Beyond this the scan truncates with a warning. |
roots | string[] | no | Limit the importer scan to these subdirectories (absolute or cwd-relative). Default: process.cwd(). |
Notes
- Creates parent directories of the destination if they don't exist.
- Will overwrite the destination if it already exists — no implicit confirmation.
- The operation is logged to
~/.ashlr/session-log.jsonland triggers genome auto-propose.
When to use ashlr__edit_structural instead
If you are renaming a symbol (function, class, variable) across source files and want scope-aware renaming, use ashlr__edit_structural instead. ashlr__rename_file only moves the file on disk.
Related
ashlr__write— write file contentashlr__edit_structural— AST-aware symbol rename- Capabilities matrix