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.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
path | string | yes | non-empty | |
directory | string | "" | ||
hidden | boolean | false | ||
generated | boolean | false |
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.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
path | string | yes | non-empty | |
file | string | yes | non-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.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
path | string | yes | non-empty | |
file | string | yes | non-empty | |
text | string | yes | up to 1048576 characters | |
if_match | string | yes | matching ([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.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
path | string | yes | non-empty | |
directory | string | yes | non-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.
| Argument | Type | Required | Default | Details |
|---|---|---|---|---|
path | string | yes | non-empty | |
query | string | yes | non-empty, up to 1000 characters | |
regex | boolean | false | ||
case_sensitive | boolean | false | ||
hidden | boolean | false | ||
limit | integer | 200 | 1 to 1000 |
tomaccoctl call files.search '{"path":"<path>","query":"<query>"}'