Benchmarked
CreateOS
Last updated
Was this helpful?
Was this helpful?
npm install @computesdk/createos-sandboxCREATEOS_SANDBOX_API_KEY=your_createos_api_key
# Optional: override the control-plane base URL (defaults to https://api.sb.createos.sh)
CREATEOS_SANDBOX_BASE_URL=https://api.sb.createos.shimport { createosSandbox } from '@computesdk/createos-sandbox';
const compute = createosSandbox({
apiKey: process.env.CREATEOS_SANDBOX_API_KEY,
});
// Create sandbox
const sandbox = await compute.sandbox.create();
// Run a command
const result = await sandbox.runCommand('echo "Hello from CreateOS!"');
console.log(result.stdout); // "Hello from CreateOS!"
// Clean up
await sandbox.destroy();interface CreateosConfig {
/** createos-sandbox API key. Falls back to the CREATEOS_SANDBOX_API_KEY env var. */
apiKey?: string;
/** Control-plane base URL. Falls back to the CREATEOS_SANDBOX_BASE_URL env var, then the production control plane. */
baseUrl?: string;
/** Default shape when create options pin neither `shape` nor cpus/memoryMb. */
shape?: string;
/** Default rootfs catalog name or template id. Empty = host default. */
rootfs?: string;
/** Reported `getInfo().timeout` in ms. Informational only. */
timeout?: number;
}