Here's what it will look like. This highlights that the files are no
longer used.
```
🔄 Migrating template configuration to SDK format...
Using language: TypeScript
✅ Generated TypeScript template files:
./template.ts
./build.dev.ts
./build.prod.ts
📁 Old template files no longer needed:
./e2b.Dockerfile → ./e2b.Dockerfile.old
./e2b.toml → ./e2b.toml.old
🎉 Migration completed successfully!
🔨 You can now build your template using:
npx tsx build.dev.ts (for development)
npx tsx build.prod.ts (for production)
Learn more about Template SDK: https://e2b.dev/docs
```
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Post-migration, the CLI renames `e2b.Dockerfile` and `e2b.toml` to
`.old` and refactors migration to use Dockerfile content directly.
>
> - **CLI Template Migration
(`packages/cli/src/commands/template/migrate.ts`)**
> - **Refactor**: `migrateToLanguage` now accepts `dockerfileContent`
(string) instead of a path; Dockerfile retrieval moved to the command
action via `getDockerfile`.
> - **Post-migration cleanup**: Renames `e2b.Dockerfile` and `e2b.toml`
to `*.old` if present and logs old→new paths.
> - Minor output tweaks (status messages/icons).
> - **Tests (`packages/cli/tests/commands/template/migrate.test.ts`)**
> - Add checks ensuring `e2b.Dockerfile.old` and `e2b.toml.old` exist
and originals are removed across fixtures/languages.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5fc1add2ac8e688b7509c299211b53ac6b09188e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Set default user for Dockerfiles. Includes also small migrate fixes.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Defaults Dockerfile-based templates to user 'user' and workdir
'/home/user', updates CLI templates (sudo start/ready, relative Python
import), and allows template migration without a config file.
>
> - **SDKs (Dockerfile parsing)**:
> - JS (`packages/js-sdk/src/template/dockerfileParser.ts`) and Python
(`packages/python-sdk/e2b/template/dockerfile_parser.py`): after
parsing, set defaults `setUser('user')` and `setWorkdir('/home/user')`.
> - **CLI Templates**:
> - Python build scripts: switch to relative import `from .template
import template`.
> - Generated template hbs: start/ready commands now prefixed with
`sudo`; removed explicit root/workdir before start/ready.
> - **CLI Migrate**:
> - Supports migration without `e2b.toml`; uses default config values
and prints a warning instead of exiting.
> - Initializes default config when missing; success messaging adjusted.
> - **Tests**:
> - Update fixtures to reflect new defaults (`set_user('user')`,
`set_workdir('/home/user')`, `sudo` start/ready, relative imports).
> - Relax error case to succeed with warning when config is missing.
> - Comment out stacktrace tests for `fromDockerfile` in JS/Python until
fixed.
> - **Changesets**: Patch bumps for `@e2b/cli`, `@e2b/python-sdk`, and
`e2b`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
934dc3b23b5607f70d4a4f5b7a9413a9d04df28a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds beta MCP support to JS/Python SDKs with template auto-selection,
config POST, MCP URL helpers, and codegen for MCP types/schemas.
>
> - **SDKs (Beta MCP support)**:
> - **JS SDK**:
> - Add `McpServer` types and export; extend `Sandbox.betaCreate` with
`mcp` option that auto-selects `mcp-gateway-v0`, configures MCP via POST
`/config` on port `50005` with retries, and expose `betaGetMcpUrl()`.
> - Add `wait(ms)` util; generate MCP types from `spec/mcp-server.json`;
new `generate:mcp` script and dev dep `json-schema-to-typescript`.
> - **Python SDK**:
> - Generate and export `McpServer` (TypedDict); extend sync/async
`beta_create` with `mcp` option, auto-select default MCP template, POST
MCP config with retries, and add `beta_get_mcp_url()`; define `mcp_port`
and `default_mcp_template`.
> - Makefile: add `generate-mcp` target; include
`datamodel-code-generator` in tooling; update lockfile/pyproject deps.
> - **Tooling**:
> - Add `spec/mcp-server.json` schema; update codegen Dockerfile to
install `datamodel-code-generator`.
> -
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
cf3f175d310d4c242cd2e867efd801f5c04f2099. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Jonas Scholz <Jonas.Scholz@bbscholz.de>
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Unifies Template APIs across JS/Python with PathLike support, new
copyItems, option/name tweaks, and simpler registry auth via
credentials; updates parser, exports, and tests.
>
> - **Template API (JS + Python)**
> - Add PathLike support for paths in `copy`, `remove`, `rename`,
`makeDir`, `makeSymlink`, `setWorkdir`, and `gitClone`.
> - Introduce `copyItems` and corresponding `CopyItem` typing; adjust
Dockerfile parser to use `copyItems` overload.
> - Simplify registry auth: `fromImage(baseImage, credentials)` accepts
`{username,password}`; remove `fromRegistry`; update
`fromAWSRegistry`/`fromGCPRegistry` to take credentials and set config
internally.
> - Rename options: `ignoreFilePaths` -> `fileIgnorePatterns`;
`fileContextPath` can be `PathLike`.
> - Ensure internal hashing/upload use stringified paths; minor
enum/type tweaks (e.g., `InstructionType` as string enum, `forceUpload?:
true`).
> - **Exports**
> - Export `CopyItem` from JS `index.ts` and Python `__init__.py`.
> - **Tests**
> - Update stacktrace and build tests to new method names/signatures
(e.g., registry via `fromImage` credentials, new `copyItems` tests,
optional `skipCache` param).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
95391030550a340fe99ebaac4494867b3e3e9507. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Jakub Dobry <jakub.dobry8@gmail.com>
Add template `build-v2` command that uses template SDK
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduce `template build-v2` command that builds templates directly
from a Dockerfile via the Template SDK and wire it into the CLI.
>
> - **CLI - Template**:
> - **New Command**: `template build-v2`
(`packages/cli/src/commands/template/build-v2.ts`)
> - Builds from Dockerfile using SDK:
`Template(...).fromDockerfile(...)` and `Template.build(...)`.
> - Options: `--dockerfile`, `--cmd`, `--ready-cmd`, `--cpu-count`,
`--memory-mb`, `--no-cache`, path via `--path`; alias `bd-v2`.
> - Validations: template name format, even `memory-mb`.
> - Auth/config: uses access token, API key, domain; streams build logs;
prints success examples.
> - **Wiring**: Add `buildV2Command` to
`packages/cli/src/commands/template/index.ts`.
> - **Release**: Changeset adds patch for `@e2b/cli`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
33578b56dfbcd76c3bb2ecf7fdf6f2cb80c3d0dd. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
This PR fixes 2 bugs that made the follow option in `e2b sbx logs` not
work:
1. `e2b sbx logs -f <id>` failed to follow because the `isRunning`
function was always returning false due to the API call being
unauthenticated if you dont have the `E2B_API_KEY` environment variable
set.
This follows the existing pattern from other API calls:
https://github.com/e2b-dev/E2B/blob/c4ce97e9b9a1809e3419d64499c1e56f9138e3d0/packages/cli/src/commands/sandbox/list.ts#L138-L152
Eventually it would make sense to handle the error here, for now just a
hotfix to fix the --follow usage
2. Once it actually followed, it never stopped following because
`isRunning` was not inside the loop and always true. Now when you kill
the sandbox follow actually stops following
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Fixes `e2b sbx logs -f` by authenticating `isRunning` and re-checking
sandbox state each loop so following works and stops when closed.
>
> - **CLI — `packages/cli/src/commands/sandbox`**:
> - **Logs follow behavior (`logs.ts`)**:
> - Re-check `isRunning(sandboxID)` inside the loop (`isSandboxRunning`)
instead of using a cached promise, ensuring follow stops when sandbox is
closed or not found.
> - **Sandbox state check auth (`utils.ts`)**:
> - Use `ensureAPIKey()` and pass `apiKey` to
`Sandbox.getInfo(getShortID(sandboxID), { apiKey })` so `isRunning` is
authenticated.
> - **Release**:
> - Changeset adds patch for `@e2b/cli` with note: fix sbx logs follow
option.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5fbd87166b70aca7229ccc1ff8fa2c27f12b1641. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Follow up my last PR, improves DX consistency and added docs.
Changelog
- format "table" > "pretty" to match other commands (metrics, logs)
- added doc section
**Changelog**
- Added ability to pass multiple sandbox ids to "sbx kill id1 id2 id3"
- Added ability to filter sandboxes to be killed by metadata and by
state using --state, --metadata (requires --all)
- Fixed metadata parser and moved to utils
Adds a deprecated `spawn` command to the CLI, ensuring backward
compatibility and guiding users toward the preferred `create` command.
```
$ e2b sandbox
Usage: index sandbox|sbx [options] [command]
work with sandboxes
Options:
-h, --help display help for command
Commands:
connect|cn <sandboxID> connect terminal to already running sandbox
list|ls [options] list all sandboxes, by default it list only running ones
kill|kl [options] [sandboxID] kill sandbox
create|cr [options] [template] create sandbox and connect terminal to it
logs|lg [options] <sandboxID> show logs for sandbox
metrics|mt [options] <sandboxID> show metrics for sandbox
help [command] display help for command
```
```
$ sbx sp base
Warning: The 'spawn' command is deprecated and will be removed in future releases. Please use 'e2b sandbox create' instead.
Terminal connecting to template base with sandbox ID in897x2dqs7aws8h1x0in
```
Introduce beta submodule with beta features - pause and resume
Update Sandbox list to also return paused sandboxes
---------
Co-authored-by: Tomas Valenta <valenta.and.thomas@gmail.com>