CreateOS Sandboxes with ComputeSDK
CreateOS provider for ComputeSDK — NodeOps VM sandboxes with pause/resume/fork snapshots.
Setup
npm install computesdk @computesdk/createos-sandbox
Set your credentials:
# .env
CREATEOS_SANDBOX_API_KEY=your_createos_sandbox_api_key
CREATEOS_SANDBOX_BASE_URL=your_createos_sandbox_base_url
Quick Start
import { compute } from 'computesdk';
import { createosSandbox } from '@computesdk/createos-sandbox';
compute.setConfig({
provider: createosSandbox({
apiKey: process.env.CREATEOS_SANDBOX_API_KEY,
baseUrl: process.env.CREATEOS_SANDBOX_BASE_URL,
}),
});
const sandbox = await compute.sandbox.create();
const result = await sandbox.runCommand('echo "Hello from CreateOS!"');
console.log(result.stdout);
await sandbox.destroy();
You can also call the provider factory directly:
import { createosSandbox } from '@computesdk/createos-sandbox';
const sdk = createosSandbox({
apiKey: process.env.CREATEOS_SANDBOX_API_KEY,
baseUrl: process.env.CREATEOS_SANDBOX_BASE_URL,
});
const sandbox = await sdk.sandbox.create();
CreateOS Configuration
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;
}
Full API
ComputeSDK exposes the same universal sandbox API across providers: sandbox.create(), sandbox.getById(), sandbox.destroy(), sandbox.runCommand(), sandbox.getInfo(), sandbox.getUrl(), and sandbox.filesystem.*.
Install the main skill for the complete reference:
npx skills add https://github.com/computesdk/sandbox-skills --skill computesdk