<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adjusts `skipCache` to return `this` in types and aligns
implementation for proper fluent chaining.
>
> - **JS SDK – `template`**:
> - **Types**: Change `skipCache` return type from `TemplateBuilder` to
`this` in `types.ts` (`TemplateFromImage`, `TemplateBuilder`).
> - **Implementation**: Align `skipCache` in `index.ts` by removing
explicit return type annotation to match `this` chaining.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
58131d1e5c8caaddc3a23523f99c069ac00a32a7. 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 -->
Disable stdin (setting it to `/dev/null` for `command.run()`, but enable
to setting it to pipe, which you can send the input via
`command.sendStdin()`
This fixes issues with tools checking for stdin and then hanging
indefinitely
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Disables stdin by default and introduces a new `StartRequest.stdin`
flag to opt-in to stdin piping, updating JS/Python SDKs, version gating,
and tests.
>
> - **Spec/Protobuf**:
> - Add `optional bool stdin` to `process.StartRequest` in
`spec/envd/process/process.proto` and regenerate JS/Python protos.
> - **JS SDK**:
> - Add `ENVD_COMMANDS_STDIN = '0.3.0'` and version check; error if
`stdin === false` on older envd.
> - Extend `CommandStartOpts` with `stdin` (default `false`); pass
`stdin` to `rpc.start`.
> - **Python SDK**:
> - Add `ENVD_COMMANDS_STDIN = Version("0.3.0")` and version check
mirroring JS.
> - Extend async/sync `commands.run()` with `stdin` (default `False`);
pass to `StartRequest`.
> - Update generated `process_pb2`/`.pyi` with `StartRequest.stdin`.
> - **Tests**:
> - Update send-stdin tests to run commands with `stdin:
true`/`stdin=True`.
> - **Changeset**:
> - Minor bump for `@e2b/python-sdk` and `e2b`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
458a15187e6eadccd43540e6b8972c4d45e1bb78. 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