Skip to content

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

FieldTypeRequiredNotes
fromstringyesExisting workspace-relative path.
tostringyesDestination 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");

Notes

require("fs").renameSync(from, to) routes to the same tool, with the same approval on the destination.