Skip to content

filesystem.file.read.v1

Read file

Returns one bounded inline UTF-8 page of the file, split only on character boundaries. Omit the cursor to start at the first byte; pass the cursor from the previous page to continue. A null cursor in the result means the page reached the end of the file. The cursor addresses bytes by offset and carries the file identity it was issued against, so a file whose size or modification time changed between pages, or while the page itself was being read, returns invalidated instead of bytes that may have shifted.

At a glance

Callable byagent, cli, plugin
Effectread — Reads state and changes nothing.
Confirmationnever — Runs without asking.
Idempotencynone
Leaves the machineno
Provided bydev.tenon.core
Contract classsealed

Input

PropertyRequiredTypeConstraints
cursornostringlength 0–96
pathyesstringlength 1–16384

Output

PropertyRequiredTypeConstraints
contentyes{byteCount, kind, text}
cursoryesstring | null
invalidatedyesboolean

Errors it can return

These are this contract’s own failures, on top of the lifecycle errors every intent can settle with. See Errors.

  • dev.tenon.core.content-not-text
  • dev.tenon.core.filesystem-failed
  • dev.tenon.core.path-not-found

Call it

From a plugin — declare it in intents.uses first:

js
const result = await tenon.intents.send("filesystem.file.read.v1", {})
if (!result.ok) throw new Error(result.error.code)

From a shell:

sh
tenon-cli intent send filesystem.file.read.v1 --input '{}'

Ask your own build for this same contract with tenon-cli intent describe filesystem.file.read.v1.