New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@withruntime/cloud

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@withruntime/cloud

Runtime Cloud: one client, CLI and MCP bridge for every Runtime product. Sandboxes first.

npmnpm
Version
0.2.2
Version published
Weekly downloads
26
-90.11%
Maintainers
1
Weekly downloads
 
Created
Source

Runtime Cloud SDK and CLI

One client for every Runtime Cloud product, and the runtime CLI. No dependencies; Node.js 22 or later, or Bun.

npm install @withruntime/cloud

The client uses RUNTIME_API_KEY when it is set, and otherwise the connection this machine saved when the CLI connected it (one browser approval, no key to copy). On a server, set RUNTIME_API_KEY from your secret manager (create a key at https://withruntime.com/account/keys). Never put a key in browser code, a URL or a command-line argument.

import { Sandbox } from "@withruntime/cloud";

await using sbx = await Sandbox.create();
const result = await sbx.exec("python3 -c 'print(6 * 7)'");
console.log(result.exitCode, result.stdout);

Sandbox.create() needs no arguments and returns once the sandbox is running; await using stops it when the block ends (Node 24, Bun or TypeScript; on Node 22 call await sbx.stop()). With no arguments you get the free trial while it lasts (20 hours, up to three sandboxes at once), 2 vCPU, 4 GiB of memory and a 4 GiB disk.

The sandbox object does the rest:

  • exec, execStream, spawn and processes for commands and background work, with cwd, env (the place for secrets), stdin and timeoutMs;
  • terminal() for an interactive terminal over a WebSocket;
  • files to read, write, list, glob, stat, move and remove, and to copy whole directories with upload and download;
  • pause, wake, extend, fork and snapshot;
  • interpreter, network, previews and desktop for the other products.

The client has sandboxes, images, volumes, snapshots, feedback and support. Every write carries an idempotency key, made for you, so the SDK's own retries (timeouts, 429, 503) never do anything twice. Errors are typed and carry a code, a hint and a requestId.

CLI

npx @withruntime/cloud run -- python3 -c 'print(6 * 7)'   # connects on first use
npx @withruntime/cloud sandbox create
npx @withruntime/cloud help

Installed with npm i -g @withruntime/cloud, the command is runtime: runtime sandbox exec <id> -- ls, runtime sandbox shell <id>, runtime image build --pip pandas, and --json on every command.

MCP

claude mcp add --scope user runtime -- npx -y @withruntime/cloud mcp
codex mcp add runtime -- npx -y @withruntime/cloud mcp

The bridge serves Runtime's MCP tools on stdio over the saved connection; not connected yet, it offers runtime_connect, which walks you through the browser approval. Remote agents use https://api.withruntime.com/mcp with a bearer key.

Docs: https://withruntime.com/docs/javascript and https://withruntime.com/docs/cli.

Keywords

sandbox

FAQs

Package last updated on 23 Sep 2026

Related posts