the standard library
nika:read
Read a file · returns its text (or opaque bytes with binary: true). One of 28 builtins in the closed nika: namespace.
the file familyworkspace files: read, write, search (permits.fs-gated)
- filefamily5 tools
- 2argsdeclared contract
- 1requiredcheck teaches a miss
- 3skeletonsship this tool
the contract
2 args · 1 requiredA missing required arg is a nika check finding before anything runs; the vocabulary below comes from the binary itself (nika catalog --tools --json), not from prose.
- path*
stringfile path- binary
booleanreturn opaque bytes (default false)
in a real file
from the chain skeleton gather: invoke: # SLOT: the fact source · nika:read / nika:fetch / exec tool: "nika:read" args: { path: "${{ const.source }}" } on_error: # Offline rehearsal. A freshly scaffolded directory has no README, and a # skeleton that dies on its first run teaches nothing — so a not-found # recovers into a literal standing in for the real document. `on_codes:` # keeps that narrow: ONLY not-found is forgiven, a permission error # still fails loudly. Delete this block once the source really exists. # In an EMPTY directory check prints one [inputs] hint that this read # would fail — the run does not: this recover carries it (measured · # rc=0 · « 1 recovered »). The hint retires once your source exists. on_codes: [NIKA-BUILTIN-READ-001] recover: "REHEARSAL · no source document here yet."a verbatim excerpt, real line numbers from chain.nika.yaml, conformance-gated upstream on every spec push. open the full skeleton →
cross-references
the check gates
from the blog
the file family
5 toolsworkspace files: read, write, search (permits.fs-gated).
Machines read the same vocabulary at /tools/catalog.json; the contract lives in spec 06 · stdlib. Install and ask the binary itself: nika catalog --tools. Read the spec →