Files
Runta file helpers move data between your local machine and one runtime. The REST API exposes raw single-file reads and writes. The CLI and SDKs build higher-level copy, upload, and download workflows on top of those file routes and command execution.
Copy Files
Section titled “Copy Files”The CLI uses <runtime>:<path> for remote paths:
runta cp ./app.py worker:/tmp/app.pyrunta cp worker:/tmp/result.json ./result.jsonrunta cp ./src worker:/tmp/srcUse absolute remote paths when possible. Relative local paths are resolved by your shell before the CLI sends the file.
SDK File Helpers
Section titled “SDK File Helpers”from runta import Runta
with Runta() as runta: runtime = runta.runtimes.create("file-demo")
runtime.files.write("/tmp/message.txt", "hello") print(runtime.files.read("/tmp/message.txt").decode())
runtime.files.upload("./local-file.txt", "/tmp/local-file.txt") runtime.files.download("/tmp/local-file.txt", "./downloaded-file.txt")import { Runta } from "@runta/runta-sdk";
const runta = new Runta();const runtime = await runta.runtimes.create("file-demo");
await runtime.files.write("/tmp/message.txt", "hello");console.log(await runtime.files.readText("/tmp/message.txt"));
await runtime.files.upload("./local-file.txt", "/tmp/local-file.txt");await runtime.files.download("/tmp/local-file.txt", "./downloaded-file.txt");Python read() returns bytes. TypeScript read() returns Uint8Array, and
readText() decodes the bytes as text.
Direct REST Access
Section titled “Direct REST Access”The REST routes operate on one regular file at a time:
curl -sS "$RUNTA_ENDPOINT/v1/runtimes/worker/files?path=/tmp/message.txt" \ -H "Authorization: Bearer $RUNTA_TOKEN"curl -sS -X PUT "$RUNTA_ENDPOINT/v1/runtimes/worker/files?path=/tmp/message.txt" \ -H "Authorization: Bearer $RUNTA_TOKEN" \ -H "Content-Type: application/octet-stream" \ --data-binary @message.txtThe response for a successful write is 204 No Content.
Directory Uploads
Section titled “Directory Uploads”Directory upload support is SDK-implemented:
| Interface | Behavior |
|---|---|
| CLI | Copies directories through runta cp using the CLI transfer implementation. |
| Python SDK | Archives the directory as a tar stream and extracts it inside the runtime through exec. |
| TypeScript SDK | Walks the directory and writes each file to the matching remote path. |
| REST API | Supports single-file raw byte read and write routes only. |
If a runtime does not have standard shell utilities available, prefer single
file writes through the REST route or SDK write() method.