SandboxMove from Daytona

Move from Daytona

This guide maps Daytona calls and settings to Tangle Sandbox and shows a typical Daytona program on Tangle.

What maps to what

DaytonaTangle Sandbox (TypeScript)Python
new Daytona() with DAYTONA_API_KEYnew Sandbox({ apiKey, baseUrl: "https://sandbox.tangle.tools" })Sandbox(api_key=..., base_url=...)
daytona.create()client.create()client.create(), then wait_for(SandboxStatus.RUNNING)
sandbox.process.executeCommand(cmd)box.exec(cmd); read exitCode and stdoutbox.exec(cmd)
sandbox.process.codeRun(code)box.runCode("python", code)box.exec("python3 -c ...")
Process sessions and log streamingbox.process.spawn(cmd), then proc.logs()Not available; use the TypeScript SDK, or tangle process spawn and tangle process logs
PTY sessionsbox.terminals; see Shells and terminalsNot available
sandbox.fs.uploadFile, downloadFilebox.fs.upload(localPath, remotePath), box.fs.download(remotePath, localPath)box.write(path, text), box.read(path)
sandbox.git.clone(url)git: { url } on create, then box.git for status, commit and pushgit=GitConfig(url=...) on create, then box.git
sandbox.getPreviewLink(port)box.previewLinks.create(port)client.fetch("POST", f"/v1/sandboxes/{box.id}/runtime/preview-links", json={"port": port})
sandbox.stop(), sandbox.start()box.stop(), box.resume()box.stop(), box.resume()
sandbox.delete()box.delete()box.delete()
Auto-stop intervalidleTimeoutSecondsidle_timeout_seconds
Auto-delete intervaldeleteAfterStoppedSecondsNot a Python option; create through client.fetch
Auto-archive intervalcoldTimeoutSeconds: when a stopped sandbox’s compute is released. Resume still works and takes longer.Not a Python option
Snapshots (images)Environments and templates; see Templates and imagesenvironment=, template_id=
Forkbox.fork(count) or box.branch(count)Not available; call POST /v1/sandboxes/{id}/branch
Network limitsegressPolicy on create, or box.egress.update()egress_policy= on create, or box.egress_update()
VolumesNo equivalent. Keep data in a snapshot, a git remote or your own object storage.

Timers are in seconds, not minutes. A stopped sandbox keeps its files until you delete it or deleteAfterStoppedSeconds passes.

The same program on Tangle

Clone a repository, install and test it, and delete the sandbox:

from-daytona.mts
import { Sandbox } from "@tangle-network/sandbox";
 
const client = new Sandbox({
  apiKey: process.env.TANGLE_API_KEY!,
  baseUrl: "https://sandbox.tangle.tools",
});
 
const box = await client.create({
  git: { url: "https://github.com/tangle-network/sandbox-demo" },
  idleTimeoutSeconds: 900,
});
try {
  const install = await box.exec("npm ci", { timeoutMs: 300_000 });
  if (install.exitCode !== 0) throw new Error(install.stderr);
  const test = await box.exec("npm test", { timeoutMs: 300_000 });
  console.log(test.exitCode, test.stdout);
} finally {
  await box.delete();
}

Coding agents

Daytona guides install a coding agent in the sandbox. A Tangle sandbox already has one; give it a task with box.prompt(), or pick Claude Code, Codex or another agent with backend.type. See Run a coding agent.

Next steps