Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@e2b/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
E2B CLI
This CLI tool allows you to build and manage E2B sandbox templates from your terminal.
You define your sandbox template in a Dockerfile and then use the CLI to build
the sandbox template. You can then connect to the sandbox template via SDKs and
run your AI agents.
The Dockerfile is the same as for Docker, but you can only use Debian based
linux distros as the base image.
Installation
npm install -g @e2b/cliThen you can use the CLI like this:
e2b --helpGetting started
- Authenticate with
e2b login
To authenticate without the ability to open browser, you can provide
E2B_ACCESS_TOKENas an environment variable. Get yourE2B_ACCESS_TOKENfrom e2b.dev/docs. Then use the CLI like this:E2B_ACCESS_TOKEN=sk_e2b_... e2b build
- Create a
Dockerfilewhere you describe how your custom E2B sandbox template should look like. Majority of Debian based linux distros should work as the base image. Here is an example of a minimalDockerfilefor E2B sandbox template:
FROM ubuntu:22.04Run
e2b buildinside the directory with theDockerfileto create and build the sandbox template. You will get template ID that you use for connecting to the sandbox via SDKs and for rebuilding the sandbox templateUse the template ID that you got during the
e2b buildwith the Python or JS/TS SDK as theidto create sandboxRebuild the sandbox template by running
e2b build <id-of-the-template>in the directory with theDockerfile
Commands
All commands can be called with a --path <path-to-dir> flag that changes the
directory where the command will be called, without the need to call cd.
-V, --version Display E2B CLI version
-h, --help display help for command