TypeScript SDK Reference
Installation
Section titled “Installation”npm install @runsynapse/sdkCell Class
Section titled “Cell Class”import { Cell } from '@runsynapse/sdk';Factory Methods
Section titled “Factory Methods”| Method | Description |
|---|---|
Cell.create(opts?) | Create a new cell |
Cell.connect(id, opts?) | Attach to existing cell |
Cell.list(opts?) | Returns SandboxPaginator |
Execution
Section titled “Execution”| Method | Description |
|---|---|
cell.run(code, opts?) | Execute code (blocking or SSE streaming) |
cell.command(cmd, opts?) | Shell command (or CommandHandle if background) |
cell.terminal() | Returns WebSocket for PTY |
Filesystem
Section titled “Filesystem”| Method | Description |
|---|---|
cell.writeFile(path, content) | Write a file |
cell.readFile(path) | Read a file |
cell.listFiles(path?) | List directory → EntryInfo[] |
cell.fileExists(path) | Check existence |
cell.fileInfo(path) | File metadata → EntryInfo |
cell.removeFile(path) | Remove file/dir |
cell.makeDir(path) | Create directory |
cell.renameFile(old, new) | Rename/move |
Lifecycle
Section titled “Lifecycle”| Method | Description |
|---|---|
cell.kill() | Destroy the cell |
cell.fetch(url, opts?) | HTTP proxy → FetchResult |
cell.info() | Raw cell info |
cell.getInfo() | Typed SandboxInfo |
Sandbox Class (E2B Compat)
Section titled “Sandbox Class (E2B Compat)”import { Sandbox } from '@runsynapse/sdk';
const sbx = await Sandbox.create();const result = await sbx.runCode("print(42)");await sbx.kill();CommandHandle
Section titled “CommandHandle”const handle = await cell.command('sleep 5', { background: true });await handle.wait(30000);console.log(await handle.stdout);console.log(await handle.exitCode);