Run Files

View as Markdown

A run collects the files produced during a session - downloads, screenshots, agent outputs. List them, or export them as a single archive.

List run files

1const files = await bctrl.runs.files.list(runId);
2
3for await (const file of bctrl.runs.files.iter(runId)) {
4 console.log(file.name, file.sizeBytes, file.contentType);
5}

Filter by type to narrow the set.

Export an archive

1const archive = await bctrl.runs.files.export(runId, {
2 // optional: name, type filters
3});
4
5console.log(archive.id, archive.path);

Export is idempotent - pass an idempotency key so retries do not create duplicate archives. See Idempotency.

Moving files in and out of a runtime

To stage durable files into a live runtime or collect runtime files back to storage, use the runtime files namespace (bctrl.runtimes.files.stage / .collect).

Next