Tomacco

Docs Operation reference files operations

files operations#

5 operations. Generated from assets/operations.json; all areas.

On this page (5)

files.list#

Show project files

List a project directory, folders first. Paths remain confined to the selected project root.

Annotations: read-only, idempotent, closed world.

ArgumentTypeRequiredDefaultDetails
pathstringyesnon-empty
directorystring""
hiddenbooleanfalse
generatedbooleanfalse
tomaccoctl call files.list '{"path":"<path>"}'

files.read#

Open source file

Read up to 1 MiB of UTF-8 source and its SHA-256 revision.

Annotations: read-only, idempotent, closed world.

ArgumentTypeRequiredDefaultDetails
pathstringyesnon-empty
filestringyesnon-empty
tomaccoctl call files.read '{"path":"<path>","file":"<file>"}'

files.write#

Save source file

Atomically save text when if_match equals the current SHA-256; use an empty revision only for new files.

Annotations: destructive, idempotent, closed world.

ArgumentTypeRequiredDefaultDetails
pathstringyesnon-empty
filestringyesnon-empty
textstringyesup to 1048576 characters
if_matchstringyesmatching ([a-f0-9]{64})?
tomaccoctl call files.write '{"path":"<path>","file":"<file>","text":"<text>","if_match":"<if_match>"}'

files.mkdir#

Create project folder

Create one new folder inside a project.

Annotations: writes, idempotent, closed world.

ArgumentTypeRequiredDefaultDetails
pathstringyesnon-empty
directorystringyesnon-empty
tomaccoctl call files.mkdir '{"path":"<path>","directory":"<directory>"}'

files.search#

Search project

Bounded source search, skipping generated trees and symlinks; returns file, line, column and matching text.

Annotations: read-only, idempotent, closed world.

ArgumentTypeRequiredDefaultDetails
pathstringyesnon-empty
querystringyesnon-empty, up to 1000 characters
regexbooleanfalse
case_sensitivebooleanfalse
hiddenbooleanfalse
limitinteger2001 to 1000
tomaccoctl call files.search '{"path":"<path>","query":"<query>"}'

View this page as Markdown on GitHub