For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tenki

Tenki Cloud provider for ComputeSDK - microVM sandboxes with native filesystem, preview URLs, snapshots, and SSH.

Installation & Setup

npm install @computesdk/tenki

Requires Node.js 20 or later (the Tenki SDK's gRPC transport depends on it).

Add your Tenki credentials to a .env file:

TENKI_API_KEY=tk_your_api_key

Usage

import { tenki } from '@computesdk/tenki';

const compute = tenki({
  apiKey: process.env.TENKI_API_KEY,
});

// Create sandbox
const sandbox = await compute.sandbox.create();

// Run a command
const result = await sandbox.runCommand('echo "Hello from Tenki!"');
console.log(result.stdout); // "Hello from Tenki!"

// Clean up
await sandbox.destroy();

Configuration Options

Supported Operations

Method
Supported
Notes

create

Boots a microVM in the resolved workspace/project; accepts per-call cpuCores/memoryMb/diskSizeGb overrides.

getById

Resolves a session by id; returns null for unknown/invalid ids.

list

Lists sessions for the API key.

destroy

Closes the session (no-op if already gone).

runCommand

Wrapped in sh -lc so pipes, globs, and env expansion work; supports cwd, env, timeout, background, and stdout/stderr streaming.

getInfo

getUrl

Exposes a port and returns its public preview URL (e.g. https://<slug>.sb.tenki.sh).

filesystem

Native data-plane file API (readFile, writeFile, mkdir, readdir, remove); exists uses test -e for consistency.

Notes

  • Workspace API keys infer their workspace server-side. Set workspaceId, or TENKI_WORKSPACE_ID, only when using trusted service credentials that require explicit scope.

  • Background commands ({ background: true }) detach stdio automatically; a bare & would hold the exec output stream open.

  • Snapshots and pause/resume exist in the underlying @tenkicloud/sandbox SDK but are not yet wired to the provider's snapshot methods. For advanced features (SSH, volumes, tunnels, git, snapshots), use sandbox.getInstance() to reach the SDK Session directly.

Last updated

Was this helpful?