a4e07a6ab2
Follow-up promised in #1524 (original attempt #1525, closed while blocked on the backend User-Agent parser, since fixed by e2b-dev/infra#3149, which now iterates User-Agent tokens and ignores unrecognized ones — so the extra tags are safe on template builds). Sets `ConnectionConfig.setIntegration('e2b-cli/<version>')` at the top of `src/api.ts` before the shared connection config is built at import time, and a commander `preAction` hook extends the tag with the canonical invoked command (alias `ls` reports as `list`), rebuilding the shared config and client since they capture the User-Agent at construction. Every CLI request then carries: ``` User-Agent: e2b-js-sdk/2.32.0 e2b-cli/2.13.1 e2b-cli-command/sandbox.list ``` Tests drive the built CLI (`sandbox list` and the `ls` alias) against a local stub API server and assert the received User-Agent, which also guards that the bundle keeps shipping the workspace SDK where `setIntegration` exists. Includes a patch changeset for `@e2b/cli`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 create.
Important
Note the distinction between
E2B_ACCESS_TOKENandE2B_API_KEY.
3. Check out docs
Visit our CLI documentation to learn more.
