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
Docs | Website | Discord | Twitter
E2B (english2bits) is a cloud operating system for AI agents.
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 commandUsage: e2b template [options] [command]
Manage E2B sandbox templates
Options:
-h, --help display help for command
Commands:
build|bd [options] [id] Build sandbox template defined by ./e2b.Dockerfile or ./Dockerfile in root directory. By default the root directory is the current working directory. This command also creates e2b.toml config
list|ls List sandbox templates
shell|sh <id> Connect terminal to sandbox
init|it [options] Create basic E2B `e2b.Dockerfile` in root directory. You can then run `e2b template build` to build sandbox template from this Dockerfile
help [command] display help for command