Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

upstash-box-js

БесплатноБез исполняемых скриптовНе проверен

Work with the @upstash/box TypeScript/JavaScript SDK for sandboxed cloud containers with AI agents, shell, filesystem, git, cron schedules, snapshots, and a…

upstashот upstash★ 37 звёзд на GitHub

Об этом скилле

@upstash/box SDK

Sandboxed cloud containers with built-in AI agents, shell, filesystem, git, cron schedules, and an optional headless browser.

The Python SDK (upstash-box) mirrors this API with snake_case names — see the upstash-box-py skill for the Python spelling of everything below.

Bundled docs and source

Before writing or debugging SDK code, check node_modules/@upstash/box/docs/ for bundled docs and node_modules/@upstash/box/src/ for readable TypeScript source. Read and search the relevant files when present; otherwise use the references in this skill.

Install & Setup

npm install @upstash/box
npm install zod   # peer dependency, only needed for responseSchema / browser schemas

Set UPSTASH_BOX_API_KEY env var or pass apiKey to constructors.

A read-only key (created with Read Only in the console) can get and list boxes, read logs, files and git status, and run box.exec.command() as a restricted user that can't write to the workspace. Every write, exec.stream() and any call that would wake a paused box throw BoxError with statusCode 403 ("This API key is read-only") or 409 for a paused box; ask for a full-access key instead of retrying.

Anonymous telemetry headers are sent by default. Opt out with the UPSTASH_DISABLE_TELEMETRY env var, or enableTelemetry: false in the config (the only option on runtimes without process.env, e.g. Cloudflare Workers).

Box Lifecycle

import { Box, Agent, ClaudeCode, BoxApiKey } from "@upstash/box"

// Create with agent + git + env vars
const box = await Box.create({
  name: "my-box",
  runtime: "node", // "node" | "python" | "golang" | "ruby" | "rust" (+ "-alpine" variants)
  size: "small",   // "small" (2 CPU/4GB/10GB disk) | "medium" (4/8/20) | "large" (8/16/30)
  labels: ["beta", "x-team"], // max 5, ≤20 chars each
  keepAlive: true,            // don't idle-pause the box
  initCommand: "npm install && npm run dev", // runs after create and on every resume
  browser: true,              // provision headless Chromium for box.browser
  agent: {
    harness: Agent.ClaudeCode, // Agent.Codex | Agent.OpenCode | Agent.Cursor | Agent.Custom
    model: ClaudeCode.Sonnet_4_5,
    // apiKey options:
    //   omit                 → key saved in the Upstash Console, if any
    //   BoxApiKey.StoredKey  → same, but create fails if no key is saved
    //   "sk-..."             → direct API key string
    // Agent runs fail until the box or the account has a key.
    apiKey: BoxApiKey.StoredKey,
  },
  git: { // all fields optional
    token: process.env.GITHUB_TOKEN, // alternatively link your GitHub account via Upstash Console
    userName: "Bot",
    userEmail: "[email protected]",
  },
  env: { DATABASE_URL: "..." },
  skills: ["upstash/qstash-js/qstash-js"], // owner/repo/skill-name
  timeout: 600_000, // request timeout in ms
  debug: false,
})

// Reconnect, list, delete, pause/resume
// Box.get / Box.getByName take { apiKey, baseUrl, gitToken, timeout, debug }
const same = await Box.get(box.id, { gitToken: process.env.GITHUB_TOKEN })
const byName = await Box.getByName("my-box")
const all = await Box.list()
const beta = await Box.list({ label: "beta" }) // filter by label
await box.pause()   // throws on keep-alive boxes — they are never idle-paused
await box.resume()
await box.delete()  // irreversible
const { status } = await box.getStatus()

box.id; box.size; box.keepAlive; box.cwd; box.networkPolicy

// Init command: works on any box. On a paused box the change applies on the next resume.
await box.setInitCommand("npm run dev")
const script = await box.getInitCommand()
await box.deleteInitCommand()

// Bulk delete (static, by ID). An empty or blank id list throws — it is never
// read as "everything". Omit snapshotIds entirely to delete all snapshots.
await Box.delete({ boxIds: ["box_1", "box_2"] })
const { deleted } = await Box.deleteSnapshots({ snapshotIds: ["snap_1"] })
await Box.deleteSnapshots() // delete all

Account-level env vars

Injected into every box you create.

await Box.setEnv("API_TOKEN", "secret")
const env = await Box.listEnv()          // values are masked
await Box.setAllEnv({ A: "1", B: "2" })  // full replace — unlisted keys are removed
await Box.deleteEnv("API_TOKEN")

Agent Runs

import { z } from "zod"

// Structured output with Zod schema
const run = await box.agent.run({
  prompt: "Review the code for security issues",
  responseSchema: z.object({
    verdict: z.enum(["approved", "changes_requested"]),
    findings: z.array(z.object({
      severity: z.enum(["high", "medium", "low"]),
      file: z.string(),
      issue: z.string(),
    })),
  }),
  timeout: 120_000,
  maxRetries: 2,
  options: { maxTurns: 20, maxBudgetUsd: 1.0, effort: "high" }, // harness-specific
  onToolUse: (tool) => console.log(tool.name, tool.input),
  onToolResult: (result) => console.log(result.toolCallId, result.output),
})

run.status  // "running" | "completed" | "failed" | "can
Полный SKILL.md на GitHub

Установить upstash-box-js в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл upstash-box-js?

Work with the @upstash/box TypeScript/JavaScript SDK for sandboxed cloud containers with AI agents, shell, filesystem, git, cron schedules, snapshots, and a headless browser. Use when building with Upstash Box, creating a sandbox or isolated environment to run untrusted or agent-generated code, running AI coding agents in containers, giving an agent a cloud dev environment with a shell and repository, browser automation from a box, scheduling recurring jobs inside a box, saving and restoring snapshots, or orchestrating parallel boxes.

Как установить скилл upstash-box-js?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл upstash-box-js запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить upstash-box-js с