a0b6104320
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 -->
E2B CLI
This CLI tool allows you to build manager your running E2B sandbox and sandbox templates. Learn more in our documentation.
1. Install the CLI
Using Homebrew (on macOS)
brew install e2b
Using NPM
npm install -g @e2b/cli
2. Authenticate
e2b auth login
Note
To authenticate without the ability to open the browser, provide
E2B_ACCESS_TOKENas an environment variable. You can find your token in Account Settings under the Team selector at e2b.dev/dashboard. Then use the CLI like this:E2B_ACCESS_TOKEN=sk_e2b_... e2b template build.
Important
Note the distinction between
E2B_ACCESS_TOKENandE2B_API_KEY.
3. Check out docs
Visit our CLI documentation to learn more.
