4ebabfeaa1
<!-- CURSOR_SUMMARY --> > [!NOTE] > Adds the ability to execute commands inside a running sandbox from the CLI. > > - New `sandbox exec` command (`exec.ts`): runs a command in a specified sandbox, supports `--background`, `--cwd`, `--user`, and repeatable `--env` options; streams stdout/stderr; returns remote exit code; explicitly disallows stdin piping due to protocol limitations > - Signal handling utility (`utils/signal.ts`): installs/removes handlers to kill the remote process on termination signals > - Registers `exec` in `sandbox/index.ts` > - Updates `configOption` help in `options.ts` to recommend the new build system > - Adds changeset for `@e2b/cli` minor release > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit dcbc64211934c1f92ff033ff77ff6ad50497e8a7. 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.
