{
  "id": 21322477,
  "title": "Getting code into a sandbox and results out: files, folders and change lists",
  "url": "https://urgent.news/2026/11/23/getting-code-into-a-sandbox-and-results-out-files-folders-and-change",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-23T00:50:38.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sandscale/getting-code-into-a-sandbox-and-results-out-files-folders-and-change-lists-2ldf"
  },
  "original_language": "en",
  "account": "Starting a sandbox is straightforward. The primary challenge lies in getting the code into the sandbox and retrieving the results. Simply copying a repository file by file is inefficient and potentially risky. The entire repository, including .env and node_modules, is unnecessary and can be unsafe. The Sandscale API provides tools for these tasks. This article explains each step using the TypeScript SDK, curl, and the Sandboxes API reference. For single files, such as a script or configuration file, write them directly in REST with base64-encoded content. The SDK handles encoding and accepts strings or bytes. For a complete folder, send everything in a single gzip tar archive via POST /instances/{id}/project. The server responds with details about the unpack process, including skipped files and reasons. To retrieve results, GET /instances/{id}/files?path=... reads a single file, or lists a directory if the path is a directory. The SDK's listFiles returns entries with path, name, isDir, and size, while readFile returns the bytes. To determine which files changed, use GET /instances/{id}/project/changes after the agent has finished. This returns the files changed since the project was uploaded. After reading the changed files, stop the sandbox.",
  "summary": "Starting a sandbox is the easy part. The first real question in any agent integration is how to get the code in, and how to get the result out. Copying a repository one file at a time is slow and fiddly. Copying it all, including .env and node_modules , is wasteful and sometimes dangerous. And at the end you usually want one thing: which files did the agent change? Sandscale's API has a tool for…",
  "key_points": [
    "Getting code into sandbox: use Sandscale API with TypeScript SDK or curl",
    "Sending folder: gzip tar archive via POST /instances/{id}/project",
    "Retrieving results: GET /instances/{id}/files?path=... or GET /instances/{id}/files/changes"
  ],
  "editors_take": "Streamlining the transfer of code and results through specialized APIs replaces inefficient file copying with secure, automated workflows that manage entire repositories and track specific changes during sandbox execution.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}