Install adapter package
- Official runtime support: Node.js 18+ (ESM)
- Bun is supported as a package manager for install
- Bun runtime execution is best-effort in v1 and not part of the official runtime guarantee
@shelv/adaptersis distributed under the Apache-2.0 license.- Source code: github.com/shelv-dev/shelv-adapters
Hydrate and snapshot
Set your API key as an environment variable (SHELV_API_KEY), then hydrate a sandbox and snapshot it:
archive-first with automatic fallback to tree when archive retrieval fails. Use tree-only for small shelves and archive-only for strictly snapshot-based workflows.
createShelvClient uses https://api.shelv.dev by default. Pass apiBaseUrl only when targeting a non-production Shelv API.
Checksum verification is built in for archive mode. If checksum or archive parsing fails, archive-first falls back to tree retrieval so your run can continue without custom recovery code.
Provider coverage
| Adapter | hydrate() | snapshot() |
|---|---|---|
createVercelAdapter() | Yes | Yes |
createDaytonaAdapter() | Yes | Yes |
createE2BAdapter() | Yes | Yes |
createCodeSandboxAdapter() | Yes | No |
createDenoAdapter() | Yes | No |
createJustBashAdapter() | Yes | No |
snapshot() method.
Just-Bash integration
Just-Bash is a sandboxed TypeScript bash interpreter with an in-memory virtual filesystem, designed for AI agents. Shelv provides three levels of integration depending on your use case.Adapter
Use the standard adapter when you already have a Just-BashSandbox instance:
Bash factory with lazy loading
UsecreateShelvBash when you want to pass files directly to the Bash constructor. This avoids creating a sandbox first and hydrating it separately.
Eager mode (default) fetches all file content upfront:
bash-tool helper
UsecreateShelvBashTool for the quickest integration with the AI SDK. It creates a bash-tool instance pre-loaded with shelf files:
bash-tool as a peer dependency:
