file_move
Gate: gated
on file, target the destination path
· write
Move or rename a file. Both ends stay inside the workspace. Worth knowing which end you are approving: the gate checks the destination, because that is where the bytes end up. See the file kind.
Input
| Field | Type | Required | Notes |
|---|---|---|---|
from | string | yes | Existing workspace-relative path. |
to | string | yes | Destination workspace-relative path. This is the gated target. |
Output
Both ends of the move:
{ "from": "inbox/note.md", "to": "notes/note.md" }From JavaScript
await nocturn.fs.move("inbox/note.md", "notes/note.md");nocturn.call("file_move", { from: "inbox/note.md", to: "notes/note.md" });Notes
require("fs").renameSync(from, to) routes to the same tool, with the same approval on the destination.