List Runtime files

View as Markdown

List files, directories, and symlinks in a live Runtime workspace. Paths are relative to the workspace root; absolute paths and .. segments are not allowed.

List workspace entries

1const result = await bctrl.tools.call("runtime.files.list", {
2 path: "reports",
3 limit: 100,
4}, { runtimeId: runtime.id });
5
6for (const entry of result.entries) {
7 console.log(entry.kind, entry.path, entry.size);
8}

The Runtime must be active. Omit path to list the workspace root.

Request parameters

ParameterTypeRequiredDescription
pathstringNoWorkspace-relative directory. Defaults to the workspace root.
cursorstringNoCursor returned by the previous page.
limitintegerNoResults per page. Defaults to 100; maximum 500.

Response

FieldTypeAlways presentDescription
entries[].pathstringYesWorkspace-relative entry path.
entries[].kind"file" | "directory" | "symlink"YesEntry type.
entries[].sizenumber | nullYesSize in bytes for a file, when available.
entries[].modifiedAtstring | nullYesLast modification time, when available.
nextCursorstring | nullYesCursor for the next page, or null when complete.

Next