@opencomputer/sdk
v0.5.8
Published
TypeScript SDK for OpenComputer - cloud sandbox platform
Maintainers
Readme
@opencomputer/sdk
TypeScript SDK for OpenComputer — cloud sandbox platform.
Install
npm install @opencomputer/sdkQuick Start
import { Sandbox } from "@opencomputer/sdk";
const sandbox = await Sandbox.create({ template: "base" });
// Execute commands
const result = await sandbox.commands.run("echo hello");
console.log(result.stdout); // "hello\n"
// Read and write files
await sandbox.files.write("/tmp/test.txt", "Hello, world!");
const content = await sandbox.files.read("/tmp/test.txt");
// Clean up
await sandbox.kill();Configuration
| Option | Env Variable | Default |
|-----------|------------------------|--------------------------|
| apiUrl | OPENCOMPUTER_API_URL | https://app.opencomputer.dev |
| apiKey | OPENCOMPUTER_API_KEY | (none) |
License
MIT
