Add or upgrade a curated, immutable managed CLI for Sim Function sandboxes, including client-safe catalog metadata, a pinned server-only installation recipe, checksum and executable verification, provider compatibility, PATH propagation, content-addressed image identity, and tests. Use when adding a CLI to the Sandbox managed-CLI selector or changing an existing managed CLI version or recipe.
73
90%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Add CLIs through the curated registry. Never turn this surface into arbitrary commands or package names: system packages already cover validated Debian/APT coordinates, while managed CLIs require immutable artifacts and reproducible recipes.
Read these live sources before editing; do not copy their current entries into this skill:
apps/sim/lib/execution/remote-sandbox/cli-tools.ts — persisted IDs and client-safe metadata.apps/sim/lib/execution/remote-sandbox/cli-tools.server.ts — server-only recipes and recipe helpers.apps/sim/lib/execution/remote-sandbox/cli-tools.test.ts — catalog and supply-chain invariants.apps/sim/lib/execution/remote-sandbox/cli-tools-boundary.test.ts — client/server import boundary.apps/sim/lib/execution/remote-sandbox/sandbox-spec.ts — content-addressed hash inputs.Read resolve.ts and e2b.ts only when changing provisioning mechanics. A normal catalog addition should not require UI, API, database, resolver, or provider edits; those paths derive from the registries.
Do not modify the dedicated Function base image or the separate Mothership Shell template for a normal managed CLI addition. Managed recipes layer on the Function base image. Do not change MAX_SANDBOX_CLI_TOOLS from ten unless the user separately requests a product-limit change.
Use primary upstream release documentation and official artifacts. Establish all of the following before writing code:
latest, mutable redirects, or an unversioned installer./opt/sim-cli.When the user does not name a version, select the current stable upstream release from primary sources and state the exact version chosen. Do not silently choose a prerelease or infer a version from an unverified secondary source.
Reject curl-to-shell installers, npm install, pip install, distro package repositories, arbitrary user commands, and artifacts from unofficial mirrors. Never place credentials, tokens, login commands, or account configuration in an image recipe or build log; authentication is runtime-only.
Use <tool>@<upstream-version>-r<recipe-revision>.
-r1.-r2, -r3, and so on.selectable: false. Only the newest version keeps the public label selectable.Before shipping the first upgrade for a tool family, verify that editing a sandbox cannot leave both the retired and replacement IDs selected. If the generic selector and API validation do not already replace or reject colliding versions, address that once at the generic registry boundary with focused UI and contract tests; never special-case the individual CLI or silently install two versions that expose the same executable.
Recipe identity includes the ID, revision, and SHA-256 in the sandbox image hash. Keeping old entries is what makes that identity reproducible rather than merely cache-busting.
In cli-tools.ts:
SANDBOX_CLI_TOOL_IDS in the same order used by the metadata and recipe registries.SANDBOX_CLI_TOOLS entry whose key and id exactly match.label, concise description, existing category, and useful executable/vendor aliases in searchTerms.Keep this file safe for client bundles. It must not contain artifact URLs, checksums, install commands, verification commands, PATH recipes, provider SDKs, or imports from cli-tools.server.ts.
The API enum and searchable grouped selector derive from this registry. Do not add parallel option arrays or route-local wire types.
In cli-tools.server.ts, use the narrowest existing helper:
defineBinaryRecipe for one downloaded binary.defineTarGzipRecipe or defineZipRecipe for archives containing binaries.defineVerifiedRecipe for a vendor archive or installer layout that needs explicit commands.Provide every field the recipe contract requires:
version, artifactUrl, artifactName, and lowercase 64-character sha256.executable and a corresponding verificationCommands entry./opt/sim-cli; quote fixed paths and clean temporary artifacts.pathEntries when the executable is not installed into the helper's default bin directory.supportedProviders only when it differs from the E2B-and-Daytona default.revision when it differs from 1; it must agree with the ID suffix.Verification must prove the command is discoverable through sandboxCliEnvironment, not authenticate or contact a user account. Recipe commands run as root during both prebuilt image creation and runtime provisioning.
If the artifact host is new, add only the exact official hostname to the officialHosts allowlist in cli-tools.test.ts. Treat that as a supply-chain review, not a way to silence the test.
Confirm the existing generic paths remain sufficient:
sandboxCliToolRecipes canonicalizes and resolves the recipe.sandboxCliEnvironment propagates PATH to Python subprocesses, JavaScript subprocesses, and Shell.hashSandboxSpec includes recipe ID, revision, and checksum while preserving the legacy hash for an empty CLI list.Do not special-case a CLI in those layers unless the registry contract cannot express a genuine provider requirement. Extend the registry contract generically when multiple CLIs need the same new behavior.
Extend tests when the new entry introduces behavior not already covered:
Never commit downloaded artifacts or credentials.
From apps/sim:
bunx vitest run \
lib/execution/remote-sandbox/cli-tools.test.ts \
lib/execution/remote-sandbox/cli-tools-boundary.test.ts \
lib/execution/remote-sandbox/sandbox-spec.test.ts \
lib/execution/remote-sandbox/resolve.test.ts \
lib/api/contracts/sandboxes.test.ts \
'app/workspace/[workspaceId]/settings/components/sandboxes/utils.test.ts' \
'app/workspace/[workspaceId]/settings/components/sandboxes/components/sandbox-editor.test.tsx'From the repository root:
bun run type-check
bun run check:api-validation
bunx biome check \
apps/sim/lib/execution/remote-sandbox/cli-tools.ts \
apps/sim/lib/execution/remote-sandbox/cli-tools.server.ts \
apps/sim/lib/execution/remote-sandbox/cli-tools.test.ts
git diff --checkFor a new recipe, also exercise its install and every verification command in an actual E2B or Daytona sandbox when credentials and network access are available. Report clearly when only registry/unit validation ran.
7945b29
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.