Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@e2b/cli

Package Overview
Dependencies
Maintainers
3
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@e2b/cli

CLI for managing e2b sandbox templates

  • 0.1.16
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

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/cli

Then you can use the CLI like this:

e2b --help

Getting started

  1. Authenticate with e2b login

To authenticate without the ability to open browser, you can provide E2B_ACCESS_TOKEN as an environment variable. Get your E2B_ACCESS_TOKEN from e2b.dev/docs. Then use the CLI like this: E2B_ACCESS_TOKEN=sk_e2b_... e2b build

  1. Create a Dockerfile where 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 minimal Dockerfile for E2B sandbox template:
FROM ubuntu:22.04
  1. Run e2b build inside the directory with the Dockerfile to 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 template

  2. Use the template ID that you got during the e2b build with the Python or JS/TS SDK as the id to create sandbox

  3. Rebuild the sandbox template by running e2b build <id-of-the-template> in the directory with the Dockerfile

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
Usage: e2b template [options] [command]

Create sandbox templates from Dockerfiles by running e2b build then use our SDKs to create sandboxes from these templates.

Visit E2B docs (https://e2b.dev/docs) to learn how to create sandbox templates and start sandboxes.

Options:
  -V, --version             Display E2B CLI version
  -h, --help                display help for command

Commands:
  login                     Log in to CLI

  logout                    Log out of CLI

  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 [options] [id]   Connect terminal to sandbox

  init|it [options]         Create basic E2B Dockerfile (`./e2b.Dockerfile`) in root directory. You can then run e2b build to build sandbox template from this Dockerfile

  delete|dl [options] [id]  Delete sanbdox template and e2b.toml config

  help [command]            display help for command

FAQs

Package last updated on 24 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc