Getting Started
Local
For local development, run Sandbox Agent directly on your machine.
With the CLI
Section titled “With the CLI”# Installcurl -fsSL https://releases.rivet.dev/sandbox-agent/0.4.x/install.sh | sh
# Runsandbox-agent server --no-token --host 127.0.0.1 --port 2468Or with npm/Bun:
With the TypeScript SDK
Section titled “With the TypeScript SDK”The SDK can spawn and manage the server as a subprocess using the local provider:
import { SandboxAgent } from "sandbox-agent";import { local } from "sandbox-agent/local";
const sdk = await SandboxAgent.start({ sandbox: local(),});
const session = await sdk.createSession({ agent: "claude",});
await session.prompt([ { type: "text", text: "Summarize this repository." },]);
await sdk.destroySandbox();This starts the server on an available local port and connects automatically.
Pass options to customize the local provider:
const sdk = await SandboxAgent.start({ sandbox: local({ port: 3000, log: "inherit", env: { ANTHROPIC_API_KEY: process.env.MY_ANTHROPIC_KEY, }, }),});