Skip to content
Cloud & Infrastructure
Skill

/computesdk-sdk

Write code that drives ComputeSDK sandboxes — the hosted platform via `@computesdk/platform`, or BYOK with the `computesdk` SDK plus a provider package. Use when the user wants a script or app that controls sandboxes outside the chat.

From plugin
computesdk
2926 skills1 MCP

Claude Code

$ npx -y skills add computesdk/computesdk --skill computesdk-sdk --agent claude-code

SKILL.md

computesdk-sdk.SKILL.md
name: computesdk-sdk
description: Write code that drives ComputeSDK sandboxes — the hosted platform via `@computesdk/platform`, or BYOK with the `computesdk` SDK plus a provider package. Use when the user wants a script or app that controls sandboxes outside the chat.

Driving ComputeSDK sandboxes from code

Two paths, depending on who provides the compute.

First-party: `@computesdk/platform`

`npm install computesdk @computesdk/platform` — the provider talks to the hosted platform (the same API the `compute` CLI uses), authenticated with an org API key or a `compute login` session:

import { compute } from 'computesdk';
import { platform } from '@computesdk/platform';

// Reads the org API key from COMPUTE_API_KEY (or a `compute login` session).
compute.setConfig({ provider: platform({}) });

// Creates are idempotent — the SDK mints an idempotency key per call
const sandbox = await compute.sandbox.create({ label: 'my-job', timeout: 30 * 60 * 1000 });

// Run a command (buffered; ~290s cap — longer work uses { background: true })
const { stdout, stderr, exitCode } = await sandbox.runCommand('python -c "print(1+1)"');

// Files (absolute paths, ~4 MB per call)
await sandbox.filesystem.writeFile('/tmp/out.txt', stdout);
const entries = await sandbox.filesystem.readdir('/tmp');

// Always clean up — wrap real programs in try/finally
await sandbox.destroy();

Auth precedence: `apiKey` > `COMPUTE_API_KEY` > `BENCHMARKS_PLATFORM_API_KEY` > a `compute login` session (needs `@benchsdk/cli` installed). Hosted sandboxes place on the org's provider order — the org's own provider keys, or ComputeSDK's managed accounts billed from prepaid credit; see the package README for `size` and the error codes (`insufficient_credits`, …) on `err.code`.

BYOK: the `computesdk` SDK + provider package

`npm install computesdk` + a provider package, e.g. `@computesdk/e2b`:

import { compute } from 'computesdk';
import { e2b } from '@computesdk/e2b';

// Reads the provider key from its environment variable (E2B_API_KEY here).
compute.setConfig({ provider: e2b({}) });

const sandbox = await compute.sandbox.create();
const result = await sandbox.runCommand('python -c "print(\'Hello\')"');
await sandbox.filesystem.writeFile('/tmp/out.txt', result.stdout);
await sandbox.destroy();

Other providers swap in the same way (`@computesdk/modal`, `@computesdk/blaxel`, `@computesdk/namespace`, `@computesdk/tensorlake`, `@computesdk/archil`, …) — but each takes its own config fields (Modal uses `tokenId`/`tokenSecret`; blaxel wants `apiKey` + `workspace`; namespace a `token`). Check the provider's package for its config shape.

Rules for generated code

  • Read keys from the environment (`COMPUTE_API_KEY` — the same env var the

`compute` CLI uses — provider env vars) — never write a key, token, or secret into generated source.

  • Always destroy sandboxes — `DELETE /sandboxes/{id}` or `sandbox.destroy()`,

in try/finally for real programs.

  • `runCommand`/commands return stdout, stderr, and an exit code — check the

exit code before treating output as success.

Read more
@computesdk
Ships withcomputesdk

A free and open-source toolkit for running other people's code in your applications.

2926 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
292
Star history of computesdk/computesdk on GitHub, a chart by star-history.com

Other skills on computesdk.

add-sandbox-provider

add-sandbox-provider

Guide a provider author through adding their **sandbox** compute provider to ComputeSDK and opening a PR. Use when someone wants…

actions

actions

Work with the org's ComputeSDK Actions CI runs — list connected repos and workflows, dispatch workflow runs, watch runs, read job…

benchmarks

benchmarks

Read ComputeSDK benchmark results — list benchmarks, runs and per-provider results, reliability and uptime, per-iteration…

providers

providers

Check and manage the org's own provider (BYOK) keys and custom reporting rates in ComputeSDK — see which providers have a key,…

sandboxes

sandboxes

Run real code in ComputeSDK cloud sandboxes — create environments, write and read files, execute commands, run long-lived…

More skills from other plugins.

container

container

Use when running, building, or managing Linux containers on macOS, or when a task involves Docker, docker compose, Lima, Colima,…

@apple@appleInstall Skill
agent-advisor

agent-advisor

Entry point for AI-agent work on AWS: pick a runtime, plan a migration for existing workloads, and build an executable POC — one…

@aws@awsInstall Skill
agents-sdk
Auto-invoked

agents-sdk

Build, debug, or review Cloudflare Agents SDK applications using the agents package.

@cloudflare@cloudflareInstall Skill

Questions about computesdk-sdk.

Which coding agents can use computesdk-sdk?
computesdk-sdk installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.