# Table of Contents - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [Documentation - E2B](#documentation-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) - [SDK Reference - E2B](#sdk-reference-e2b) --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Getting Started E2B Documentation Here you’ll find all the guides, concepts, and SDK references for developing with E2B. JavaScript & TypeScript Python Copy Ask AI npm i @e2b/code-interpreter [​](https://e2b.dev/docs#what-is-e2b) What is E2B? ----------------------------------------------------- E2B is an [open-source](https://github.com/e2b-dev) infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [Python SDK](https://pypi.org/project/e2b/) or [JavaScript SDK](https://www.npmjs.com/package/e2b) . Some of the typical use cases for E2B are AI data analysis or visualization, running AI-generated code of various languages, playground for coding agents, environment for codegen evals, or running full AI-generated apps like in [Fragments](https://github.com/e2b-dev/fragments) . ### [​](https://e2b.dev/docs#under-the-hood) Under the hood The E2B Sandbox is a small isolated VM the can be started very quickly (~150ms). You can think of it as a small computer for the AI model. You can run many sandboxes at once. Typically, you run separate sandbox for each LLM, user, or AI agent session in your app. For example, if you were building an AI data analysis chatbot, you would start the sandbox for every user session. [​](https://e2b.dev/docs#quickstart) Quickstart -------------------------------------------------- [Running your first Sandbox\ --------------------------\ \ Learn how to start your first E2B Sandbox with our Python or JavaScript SDK.](https://e2b.dev/docs/quickstart) [Connecting LLMs to E2B\ ----------------------\ \ Connect your favorite LLM to E2B to run AI-generated code inside the Sandbox.](https://e2b.dev/docs/quickstart/connect-llms) [Uploading & downloading files\ -----------------------------\ \ A quick guide on how to upload and download files to and from the Sandbox.](https://e2b.dev/docs/quickstart/upload-download-files) [Install custom packages\ -----------------------\ \ Customize your Sandbox with third-party packages.](https://e2b.dev/docs/quickstart/install-custom-packages) [​](https://e2b.dev/docs#code-interpreting-with-ai) Code interpreting with AI -------------------------------------------------------------------------------- [Analyze data with AI\ --------------------\ \ Learn how to use E2B run AI-generated code to analyze yourdata.](https://e2b.dev/docs/code-interpreting/analyze-data-with-ai) [Create charts & visualizations\ ------------------------------\ \ Create interactive charts by running Python code in E2B.](https://e2b.dev/docs/code-interpreting/create-charts-visualizations) [​](https://e2b.dev/docs#learn-the-core-concepts) Learn the core concepts ---------------------------------------------------------------------------- [Sandbox lifecycle\ -----------------\ \ Learn about how to start the sandbox, manage its lifecycle, and interact with it.](https://e2b.dev/docs/sandbox) [Sandbox persistence\ -------------------\ \ Learn how to achieve data persistence by pausing and resuming sandboxes.](https://e2b.dev/docs/sandbox/persistence) [Filesystem\ ----------\ \ Sandbox has an isolated filesystem that you can use to create, read, write, and delete files.](https://e2b.dev/docs/filesystem) [Commands\ --------\ \ Run terminal commands inside the Sandbox and start any process inside the Sandbox.](https://e2b.dev/docs/commands) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs) [Running your first SandboxThis guide will show you how to start your first E2B Sandbox.\ \ Next](https://e2b.dev/docs/quickstart) ⌘I On this page * [What is E2B?](https://e2b.dev/docs#what-is-e2b) * [Under the hood](https://e2b.dev/docs#under-the-hood) * [Quickstart](https://e2b.dev/docs#quickstart) * [Code interpreting with AI](https://e2b.dev/docs#code-interpreting-with-ai) * [Learn the core concepts](https://e2b.dev/docs#learn-the-core-concepts) --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/api-key#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Getting Started API Key To use the API key, you can either: * **Set the API key as the `E2B_API_KEY` environment variable** to avoid passing it each time you create a sandbox. * Or pass it directly to the `Sandbox` constructor as shown below: JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create({ apiKey: 'YOUR_API_KEY' }) [​](https://e2b.dev/docs/api-key#where-to-find-api-key) Where to find API key -------------------------------------------------------------------------------- You can get your API key at [dashboard](https://e2b.dev/dashboard?tab=keys) . [​](https://e2b.dev/docs/api-key#access-token) Access Token ============================================================== The access token is used only in the CLI and is **not needed in the SDK**. There’s no need to set it when logging into the CLI using `e2b auth login`. To authenticate without the browser, you can set `E2B_ACCESS_TOKEN` as an environment variable. This is useful for CI/CD pipelines. [​](https://e2b.dev/docs/api-key#where-to-find-access-token) Where to find Access token ------------------------------------------------------------------------------------------ You can get your **Access token key** at the [dashboard](https://e2b.dev/dashboard/account) . Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/api-key.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/api-key) [Previous](https://e2b.dev/docs/quickstart/install-custom-packages) [Cookbook\ \ Next](https://e2b.dev/docs/cookbook) ⌘I On this page * [Where to find API key](https://e2b.dev/docs/api-key#where-to-find-api-key) * [Access Token](https://e2b.dev/docs/api-key#access-token) * [Where to find Access token](https://e2b.dev/docs/api-key#where-to-find-access-token) --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/byoc#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Deployment BYOC (Bring Your Own Cloud) BYOC (Bring Your Own Cloud) allows you to deploy E2B sandboxes to your own cloud infrastructure within your VPC. BYOC is currently only available for AWS. We are working on adding support for Google Cloud and Azure. BYOC is offered to enterprise customers only. If you’re interested in BYOC offering, please book a call with our team [here](https://e2b.dev/contact) or contact us at [enterprise@e2b.dev](mailto:enterprise@e2b.dev) . [​](https://e2b.dev/docs/byoc#architecture) Architecture ----------------------------------------------------------- Sandbox templates, snapshots, and runtime logs are stored within the customer’s BYOC VPC. Anonymized system metrics such as cluster memory and cpu are sent to the E2B Cloud for observability and cluster management purposes. All potentially sensitive traffic, such as sandbox template build source files, sandbox traffic, and logs, is transmitted directly from the client to the customer’s BYOC VPC without ever touching the E2B Cloud infrastructure. ### [​](https://e2b.dev/docs/byoc#glossary) Glossary * **BYOC VPC**: The customer’s Virtual Private Network where the E2B sandboxes are deployed. For example your AWS account. * **E2B Cloud**: The managed service that provides the E2B platform, observability and cluster management. * **OAuth Provider**: Customer-managed service that provides user and E2B Cloud with access to the cluster. ![](https://mintcdn.com/e2b/bga6ifW6jAKoRCaG/images/byoc-architecture-diagram.png?w=2500&fit=max&auto=format&n=bga6ifW6jAKoRCaG&q=85&s=131e234a6ba2d3149c20914f6b6082af) ### [​](https://e2b.dev/docs/byoc#byoc-cluster-components) BYOC Cluster Components * **Orchestrator**: Represents a node that is responsible for managing sandboxes and their lifecycle. Optionally, it can also run the template builder component. * **Edge Controller**: Routes traffic to sandboxes, exposes API for cluster management, and gRPC proxy used by E2B control plane to communicate with orchestrators. * **Monitoring**: Collector that receives sandbox and build logs and system metrics from orchestrators and edge controllers. Only anonymized metrics are sent to the E2B Cloud for observability purposes. * **Storage**: Persistent storage for sandbox templates, snapshots, and runtime logs. Image container repository for template images. [​](https://e2b.dev/docs/byoc#onboarding) Onboarding ------------------------------------------------------- Customers can initiate the onboarding process by reaching out to us. Customers need to have a dedicated AWS account and know the region they will use. After that, we will receive the IAM role needed for managing account resources. For AWS account quota limits may need to be increased. Terraform configuration and machine images will be used for provisioning BYOC cluster. When provisioning is done and running, we will create a new team under your E2B account that can be used by SDK/CLI the same way as it is hosted on E2B Cloud. [​](https://e2b.dev/docs/byoc#faq) FAQ ----------------------------------------- How Is Cluster Monitored? Cluster is forwarding anonymized metrics such as machine cpu/memory usage to E2B Control plane for advanced observability and alerting. The whole observability stack is anonymized and does not contain any sensitive information. Can cluster automatically scale? A cluster can be scaled horizontally by adding more orchestrators and edge controllers. The autoscaler is currently in V1 not capable of automatically scale orchestrator nodes that are needed for sandbox spawning. This feature is coming in the next versions. Are sandboxes accessible only from a customer’s private network? Yes. Load balancer that is handling all requests coming to sandbox can be configured as internal and VPC peering with additional customer’s VPC can be configured so sandbox traffic can stay in the private network. How control plane secure communication is ensured? Data sent between the E2B Cloud and your BYOC VPC is encrypted using TLS.VPC peering can be established to allow direct communication between the E2B Cloud and your BYOC VPC. When using VPC peering, the load balancer can be configured as private without a public IP address. Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/byoc.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/byoc) [Previous](https://e2b.dev/docs/cli/shutdown-sandboxes) [SDK v2 Migration Guide\ \ Next](https://e2b.dev/docs/migration/v2) ⌘I On this page * [Architecture](https://e2b.dev/docs/byoc#architecture) * [Glossary](https://e2b.dev/docs/byoc#glossary) * [BYOC Cluster Components](https://e2b.dev/docs/byoc#byoc-cluster-components) * [Onboarding](https://e2b.dev/docs/byoc#onboarding) * [FAQ](https://e2b.dev/docs/byoc#faq) --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/cli/auth#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation CLI Authentication in CLI You must authenticate with E2B CLI before using it. Run the following command to sign in into your E2B account: Terminal Copy Ask AI e2b auth login Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/cli/auth.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/cli/auth) [Previous](https://e2b.dev/docs/cli) [List sandboxes\ \ Next](https://e2b.dev/docs/cli/list-sandboxes) ⌘I --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/cli#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation CLI E2B CLI E2B CLI is a command line tool that allows you to list, kill running sandboxes, and manage [sandbox templates](https://e2b.dev/docs/template/quickstart) . [​](https://e2b.dev/docs/cli#installation) Installation ---------------------------------------------------------- **Using Homebrew (on macOS)** Terminal Copy Ask AI brew install e2b **Using NPM** You can install E2B CLI using the following command: Terminal Copy Ask AI npm i -g @e2b/cli ### [​](https://e2b.dev/docs/cli#beta-cli) Beta CLI The latest beta version of the CLI can be installed from NPM using the following command: Terminal Copy Ask AI npm i -g @e2b/cli@beta Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/cli.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/cli) [Previous](https://e2b.dev/docs/mcp/examples) [Authentication\ \ Next](https://e2b.dev/docs/cli/auth) ⌘I On this page * [Installation](https://e2b.dev/docs/cli#installation) * [Beta CLI](https://e2b.dev/docs/cli#beta-cli) --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/cli/list-sandboxes#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation CLI List sandboxes You can list all sandboxes using the following command: Terminal Copy Ask AI e2b sandbox list This will return running sandboxes, you can specify `--state` to get paused or both. ### [​](https://e2b.dev/docs/cli/list-sandboxes#filter-by-state) Filter by state To filter the sandboxes by their state you can specify the `--state` flag, which can either be “**running**”, “**paused**” or both. Copy Ask AI e2b sandbox list --state running,paused ### [​](https://e2b.dev/docs/cli/list-sandboxes#filter-by-metadata) Filter by metadata To filter the sandboxes by their metadata, use the `--metadata` flag. Copy Ask AI e2b sandbox list --metadata key1=value1,key2=value2 ### [​](https://e2b.dev/docs/cli/list-sandboxes#list-limit) List limit To limit the amount of sandboxes returned by the command, use the `--limit` flag. Copy Ask AI e2b sandbox list --limit 10 By default, the command will return all sandboxes. ### [​](https://e2b.dev/docs/cli/list-sandboxes#output-format) Output format To output the sandboxes in JSON format, use the `--format` flag. **Pretty print (default)** Copy Ask AI e2b sandbox list --format pretty **JSON** Copy Ask AI e2b sandbox list --format json Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/cli/list-sandboxes.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/cli/list-sandboxes) [Previous](https://e2b.dev/docs/cli/auth) [Shutdown running sandboxes\ \ Next](https://e2b.dev/docs/cli/shutdown-sandboxes) ⌘I On this page * [Filter by state](https://e2b.dev/docs/cli/list-sandboxes#filter-by-state) * [Filter by metadata](https://e2b.dev/docs/cli/list-sandboxes#filter-by-metadata) * [List limit](https://e2b.dev/docs/cli/list-sandboxes#list-limit) * [Output format](https://e2b.dev/docs/cli/list-sandboxes#output-format) --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) SDK Reference ============= This is the SDK reference for the [E2B CLI & Core SDK](https://github.com/e2b-dev/e2b) , [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter) , and [Desktop Sandbox SDK](https://github.com/e2b-dev/desktop) . The reference is intended to be limited to low-level descriptions of various programmatic functionality. If you’re just getting started with E2B, we would instead recommend looking at the [documentation](https://e2b.dev/docs) first or to get started quickly with an example. --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/create-charts-visualizations#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Charts & visualizations Create charts & visualizations E2B Sandbox allows you to create charts and visualizations by executing Python code inside the sandbox with `runCode()` method in JavaScript and `run_code()` method in Python. These charts and visualizations can be [static](https://e2b.dev/docs/code-interpreting/create-charts-visualizations/static-charts) or [interactive](https://e2b.dev/docs/code-interpreting/create-charts-visualizations/interactive-charts) plots. Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/create-charts-visualizations.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/create-charts-visualizations) [Previous](https://e2b.dev/docs/code-interpreting/analyze-data-with-ai/pre-installed-libraries) [Static charts\ \ Next](https://e2b.dev/docs/code-interpreting/create-charts-visualizations/static-charts) ⌘I --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/analyze-data-with-ai/pre-installed-libraries#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Analyze data with AI Pre-installed libraries The sandbox comes with a [set of pre-installed Python libraries](https://github.com/e2b-dev/code-interpreter/blob/main/template/requirements.txt) for data analysis but you can [install additional packages](https://e2b.dev/docs/quickstart/install-custom-packages) : * `aiohttp` (v3.9.3) * `beautifulsoup4` (v4.12.3) * `bokeh` (v3.3.4) * `gensim` (v4.3.2) * `imageio` (v2.34.0) * `joblib` (v1.3.2) * `librosa` (v0.10.1) * `matplotlib` (v3.8.3) * `nltk` (v3.8.1) * `numpy` (v1.26.4) * `opencv-python` (v4.9.0.80) * `openpyxl` (v3.1.2) * `pandas` (v1.5.3) * `plotly` (v5.19.0) * `pytest` (v8.1.0) * `python`\-docx (v1.1.0) * `pytz` (v2024.1) * `requests` (v2.26.0) * `scikit-image` (v0.22.0) * `scikit-learn` (v1.4.1.post1) * `scipy` (v1.12.0) * `seaborn` (v0.13.2) * `soundfile` (v0.12.1) * `spacy` (v3.7.4) * `textblob` (v0.18.0) * `tornado` (v6.4) * `urllib3` (v1.26.7) * `xarray` (v2024.2.0) * `xlrd` (v2.0.1) * `sympy` (v1.12) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/analyze-data-with-ai/pre-installed-libraries.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/analyze-data-with-ai/pre-installed-libraries) [Previous](https://e2b.dev/docs/code-interpreting/analyze-data-with-ai) [Overview\ \ Next](https://e2b.dev/docs/code-interpreting/create-charts-visualizations) ⌘I --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/create-charts-visualizations/static-charts#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Charts & visualizations Static charts Every time you run Python code with `runCode()` in JavaScript or `run_code()` method in Python, the code is executed in a headless Jupyter server inside the sandbox. E2B automatically detects any plots created with Matplotlib and sends them back to the client as images encoded in the base64 format. These images are directly accesible on the `result` items in the `execution.results` array. Here’s how to retrieve a static chart from the executed Python code that contains a Matplotlib plot. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' import fs from 'fs' const codeToRun = ` import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show() ` const sandbox = await Sandbox.create() // Run the code inside the sandbox const execution = await sandbox.runCode(codeToRun) // There's only one result in this case - the plot displayed with `plt.show()` const firstResult = execution.results[0] if (firstResult.png) { // Save the png to a file. The png is in base64 format. fs.writeFileSync('chart.png', firstResult.png, { encoding: 'base64' }) console.log('Chart saved as chart.png') } The code in the variable `codeToRun`/`code_to_run` will produce this following plot that we’re saving as `chart.png` file. ![](https://mintcdn.com/e2b/bga6ifW6jAKoRCaG/images/static-chart.png?w=2500&fit=max&auto=format&n=bga6ifW6jAKoRCaG&q=85&s=ff3d6b8778b16961d8f7b1c978f846d0) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/create-charts-visualizations/static-charts.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/create-charts-visualizations/static-charts) [Previous](https://e2b.dev/docs/code-interpreting/create-charts-visualizations) [Interactive charts\ \ Next](https://e2b.dev/docs/code-interpreting/create-charts-visualizations/interactive-charts) ⌘I --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/cli/shutdown-sandboxes#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation CLI Shutdown running sandboxes You can shutdown single or all running sandboxes with the E2B CLI. [​](https://e2b.dev/docs/cli/shutdown-sandboxes#shutdown-single-or-multiple-sandboxes) Shutdown single or multiple sandboxes ------------------------------------------------------------------------------------------------------------------------------- To shutdown a single or multiple sandboxes, run the following command: Terminal Copy Ask AI e2b sandbox kill [​](https://e2b.dev/docs/cli/shutdown-sandboxes#shutdown-all-sandboxes) Shutdown all sandboxes ------------------------------------------------------------------------------------------------- To shutdown all running sandboxes, run the following command: Terminal Copy Ask AI e2b sandbox kill --all Further, you can filter the sandboxes to be shutdown by state, metadata or both. Terminal Copy Ask AI e2b sandbox kill --all --state=running,paused Terminal Copy Ask AI e2b sandbox kill --all --metadata=key=value Terminal Copy Ask AI e2b sandbox kill --all --state=running,paused --metadata=key=value Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/cli/shutdown-sandboxes.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/cli/shutdown-sandboxes) [Previous](https://e2b.dev/docs/cli/list-sandboxes) [Bring Your Own Cloud\ \ Next](https://e2b.dev/docs/byoc) ⌘I On this page * [Shutdown single or multiple sandboxes](https://e2b.dev/docs/cli/shutdown-sandboxes#shutdown-single-or-multiple-sandboxes) * [Shutdown all sandboxes](https://e2b.dev/docs/cli/shutdown-sandboxes#shutdown-all-sandboxes) --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/streaming#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Code Interpreting Streaming Use E2B SDK allows you to stream the output, and results when executing code in the sandbox. [​](https://e2b.dev/docs/code-interpreting/streaming#stream-stdout-and-stderr) Stream `stdout` and `stderr` -------------------------------------------------------------------------------------------------------------- When using the `runCode()` method in JavaScript or `run_code()` in Python you can pass `onStdout`/`on_stdout` and `onStderr`/`on_stderr` callbacks to handle the output. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const codeToRun = ` import time import sys print("This goes first to stdout") time.sleep(3) print("This goes later to stderr", file=sys.stderr) time.sleep(3) print("This goes last") ` const sandbox = await Sandbox.create() sandbox.runCode(codeToRun, { // Use `onError` to handle runtime code errors onError: error => console.error('error:', error), onStdout: data => console.log('stdout:', data), onStderr: data => console.error('stderr:', data), }) The code above will print the following: JavaScript & TypeScript Python Copy Ask AI stdout: { error: false, line: "This goes first to stdout\n", timestamp: 1729049666861000, } stderr: { error: true, line: "This goes later to stderr\n", timestamp: 1729049669924000, } stdout: { error: false, line: "This goes last\n", timestamp: 1729049672664000, } [​](https://e2b.dev/docs/code-interpreting/streaming#stream-results) Stream `results` ---------------------------------------------------------------------------------------- When using the `runCode()` method in JavaScript or `run_code()` in Python you can pass `onResults`/`on_results` callback to receive results from the sandbox like charts, tables, text, and more. JavaScript & TypeScript Python Copy Ask AI const codeToRun = ` import matplotlib.pyplot as plt # Prepare data categories = ['Category A', 'Category B', 'Category C', 'Category D'] values = [10, 20, 15, 25] # Create and customize the bar chart plt.figure(figsize=(10, 6)) plt.bar(categories, values, color='green') plt.xlabel('Categories') plt.ylabel('Values') plt.title('Values by Category') # Display the chart plt.show() ` const sandbox = await Sandbox.create() await sandbox.runCode(codeToRun, { onResult: result => console.log('result:', result), }) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/streaming.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/streaming) [Previous](https://e2b.dev/docs/code-interpreting/create-charts-visualizations/interactive-charts) [Overview\ \ Next](https://e2b.dev/docs/code-interpreting/supported-languages) ⌘I On this page * [Stream stdout and stderr](https://e2b.dev/docs/code-interpreting/streaming#stream-stdout-and-stderr) * [Stream results](https://e2b.dev/docs/code-interpreting/streaming#stream-results) --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/auth#usage-5) e2b auth configure [options] CopyCopied! --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/create-charts-visualizations/interactive-charts#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Charts & visualizations Interactive charts E2B also allows you to create interactive charts with custom styling. E2B automatically detects charts when executing Python code with `runCode()` in JavaScript or `run_code()` in Python. The Python code must include Matplotlib charts. When a chart is detected, E2B sends the data of the chart back to the client. You can access the chart in the `execution.results` array where each item is a `Result` object with the `chart` property. Try out [AI Data Analyst](https://github.com/e2b-dev/ai-analyst/) - a Next.js app that uses E2B to create interactive charts. Here’s a simple example of bar chart: JavaScript & TypeScript Python Copy Ask AI import { Sandbox, BarChart } from '@e2b/code-interpreter' const code = ` import matplotlib.pyplot as plt # Prepare data authors = ['Author A', 'Author B', 'Author C', 'Author D'] sales = [100, 200, 300, 400] # Create and customize the bar chart plt.figure(figsize=(10, 6)) plt.bar(authors, sales, label='Books Sold', color='blue') plt.xlabel('Authors') plt.ylabel('Number of Books Sold') plt.title('Book Sales by Authors') # Display the chart plt.tight_layout() plt.show() ` const sandbox = await Sandbox.create() const result = await sandbox.runCode(code) const chart = result.results[0].chart as BarChart console.log('Type:', chart.type) console.log('Title:', chart.title) console.log('X Label:', chart.x_label) console.log('Y Label:', chart.y_label) console.log('X Unit:', chart.x_unit) console.log('Y Unit:', chart.y_unit) console.log('Elements:', chart.elements) The code above will output the following: JavaScript & TypeScript Python Copy Ask AI Type: bar Title: Book Sales by Authors X Label: Authors Y Label: Number of Books Sold X Unit: null Y Unit: null Elements: [\ {\ label: "Author A",\ group: "Books Sold",\ value: 100,\ }, {\ label: "Author B",\ group: "Books Sold",\ value: 200,\ }, {\ label: "Author C",\ group: "Books Sold",\ value: 300,\ }, {\ label: "Author D",\ group: "Books Sold",\ value: 400,\ }\ ] You can send this data to your frontend to create an interactive chart with your favorite charting library. * * * [​](https://e2b.dev/docs/code-interpreting/create-charts-visualizations/interactive-charts#supported-intertactive-charts) Supported intertactive charts ---------------------------------------------------------------------------------------------------------------------------------------------------------- The following charts are currently supported: * Line chart * Bar chart * Scatter plot * Pie chart * Box and whisker plot Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/create-charts-visualizations/interactive-charts.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/create-charts-visualizations/interactive-charts) [Previous](https://e2b.dev/docs/code-interpreting/create-charts-visualizations/static-charts) [Streaming\ \ Next](https://e2b.dev/docs/code-interpreting/streaming) ⌘I On this page * [Supported intertactive charts](https://e2b.dev/docs/code-interpreting/create-charts-visualizations/interactive-charts#supported-intertactive-charts) --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/supported-languages/bash#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Supported languages Run bash code Use the `runCode`/`run_code` method to run bash code inside the sandbox. You’ll need to pass the `language` parameter with value `bash`. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sbx = await Sandbox.create() const execution = await sbx.runCode('echo "Hello, world!"', { language: 'bash' }) console.log(execution) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/supported-languages/bash.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/supported-languages/bash) [Previous](https://e2b.dev/docs/code-interpreting/supported-languages/java) [Lifecycle\ \ Next](https://e2b.dev/docs/sandbox) ⌘I --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/supported-languages#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Supported languages Supported languages Typically you use Python to run AI-generated code for data analysis but you can use other languages as well. Out of the box E2B Sandbox supports: * [Python](https://e2b.dev/docs/code-interpreting/supported-languages/python) * [JavaScript and TypeScript](https://e2b.dev/docs/code-interpreting/supported-languages/javascript) * [R](https://e2b.dev/docs/code-interpreting/supported-languages/r) * [Java](https://e2b.dev/docs/code-interpreting/supported-languages/java) * [Bash](https://e2b.dev/docs/code-interpreting/supported-languages/bash) You can use any custom language runtime by creating a [custom sandbox template](https://e2b.dev/docs/template/quickstart) . Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/supported-languages.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/supported-languages) [Previous](https://e2b.dev/docs/code-interpreting/streaming) [Python\ \ Next](https://e2b.dev/docs/code-interpreting/supported-languages/python) ⌘I --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#e2b-template) ------------------------------------------------------------------------------------- manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#e2b-template-build) ------------------------------------------------------------------------------------------------- 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#e2b-template-list) ----------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#e2b-template-init) ----------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#e2b-template-delete) --------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#e2b-template-publish) ----------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#e2b-template-unpublish) --------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.4/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/filesystem#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Filesystem Filesystem Each E2B Sandbox has its own isolated filesystem. The [Hobby tier](https://e2b.dev/pricing) sandboxes come with 10 GB of the free disk space and [Pro tier](https://e2b.dev/pricing) sandboxes come with 20 GB. With E2B SDK you can: * [Read and write files to the sandbox.](https://e2b.dev/docs/filesystem/read-write) * [Watch directory for changes.](https://e2b.dev/docs/filesystem/watch) * [Upload data to the sandbox.](https://e2b.dev/docs/filesystem/upload) * [Download data from the sandbox.](https://e2b.dev/docs/filesystem/download) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/filesystem.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/filesystem) [Previous](https://e2b.dev/docs/sandbox-template/customize-cpu-ram) [Read & write\ \ Next](https://e2b.dev/docs/filesystem/read-write) ⌘I --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/commands/streaming#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Commands Streaming command output To stream command output as it is being executed, pass the `onStdout`, `onStderr` callbacks to the `commands.run()` method in JavaScript or the `on_stdout`, `on_stderr` callbacks to the `commands.run()` method in Python. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() const result = await sandbox.commands.run('echo hello; sleep 1; echo world', { onStdout: (data) => { console.log(data) }, onStderr: (data) => { console.log(data) }, }) console.log(result) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/commands/streaming.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/commands/streaming) [Previous](https://e2b.dev/docs/commands) [Run commands in background\ \ Next](https://e2b.dev/docs/commands/background) ⌘I --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.0/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/commands#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Commands Running commands in sandbox You can run terminal commands inside the sandbox using the `commands.run()` method. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() const result = await sandbox.commands.run('ls -l') console.log(result) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/commands.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/commands) [Previous](https://e2b.dev/docs/filesystem/download) [Streaming\ \ Next](https://e2b.dev/docs/commands/streaming) ⌘I --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/supported-languages/javascript#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Supported languages Run JavaScript and TypeScript code Use the `runCode`/`run_code` method to run JavaScript and TypeScript code inside the sandbox. You’ll need to pass the `language` parameter with value `javascript` or `js` for JavaScript and `typescript` or `ts` for TypeScript. The E2B Code Interpreter supports TypeScript, top-level await, ESM-style imports and automatic promises resolution. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from "@e2b/code-interpreter"; // Create a new sandbox const sbx = await Sandbox.create(); // Install the axios package await sbx.commands.run("npm install axios"); // Run the code const execution = await sbx.runCode(` import axios from "axios"; const url: string = "https://api.github.com/status"; const response = await axios.get(url); response.data; `, { language: "ts" } ); console.log(execution); // Execution { // results: [], // logs: { // stdout: [ "{ message: 'GitHub lives! (2025-05-28 10:49:55 -0700) (1)' }\n" ], // stderr: [], // }, // error: undefined, // executionCount: 1, // text: [Getter], // toJSON: [Function: toJSON], // } Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/supported-languages/javascript.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/supported-languages/javascript) [Previous](https://e2b.dev/docs/code-interpreting/supported-languages/python) [R\ \ Next](https://e2b.dev/docs/code-interpreting/supported-languages/r) ⌘I --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/commands/background#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Commands Running commands in background To run commands in background, pass the `background` option to the `commands.run()` method. This will return immediately and the command will continue to run in the sandbox. You can then later kill the command using the `commands.kill()` method. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() // Start the command in the background const command = await sandbox.commands.run('echo hello; sleep 10; echo world', { background: true, onStdout: (data) => { console.log(data) }, }) // Kill the command await command.kill() Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/commands/background.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/commands/background) [Previous](https://e2b.dev/docs/commands/streaming) [OverviewConnect to 200+ tools through the Model Context Protocol\ \ Next](https://e2b.dev/docs/mcp) ⌘I --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.5/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/supported-languages/python#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Supported languages Run Python code Use the `runCode`/`run_code` method to run Python code inside the sandbox. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sbx = await Sandbox.create() const execution = await sbx.runCode('print("Hello, world!")') console.log(execution) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/supported-languages/python.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/supported-languages/python) [Previous](https://e2b.dev/docs/code-interpreting/supported-languages) [JavaScript and TypeScript\ \ Next](https://e2b.dev/docs/code-interpreting/supported-languages/javascript) ⌘I --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/auth#e2b-auth) ------------------------------------------------------------------------- authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/auth#e2b-auth-login) ------------------------------------------------------------------------------------- log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/auth#e2b-auth-logout) --------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/auth#e2b-auth-info) ----------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/auth#e2b-auth-configure) --------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#e2b-sandbox) ---------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#e2b-sandbox-connect) -------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#e2b-sandbox-list) -------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#e2b-sandbox-kill) -------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#e2b-sandbox-spawn) ---------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#e2b-sandbox-logs) -------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.10/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.3/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#usage-7) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/sandbox#options-4) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.8/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#usage-7) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/sandbox#options-4) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/supported-languages/r#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Supported languages Run R code Use the `runCode`/`run_code` method to run R code inside the sandbox. You’ll need to pass the `language` parameter with value `r`. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sbx = await Sandbox.create() const execution = await sbx.runCode('print("Hello, world!")', { language: 'r' }) console.log(execution) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/supported-languages/r.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/supported-languages/r) [Previous](https://e2b.dev/docs/code-interpreting/supported-languages/javascript) [Java\ \ Next](https://e2b.dev/docs/code-interpreting/supported-languages/java) ⌘I --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/mcp/examples#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation MCP Gateway Examples [Claude Code\ -----------\ \ Claude Code with MCP integration](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/mcp-claude-code-js) [Browserbase\ -----------\ \ Web automation agent with Browserbase](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/mcp-browserbase-js) [Groq + Exa\ ----------\ \ AI research using Groq and Exa](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/mcp-groq-exa-js) [Research Agent\ --------------\ \ Research Agent using the OpenAI Agents framework](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/mcp-research-agent-js) [MCP Client\ ----------\ \ Basic MCP client connecting to an E2B Sandbox](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/mcp-client-js) [Custom MCP Server\ -----------------\ \ Use custom MCP servers installed from GitHub](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/mcp-custom-server-js) [Custom Template\ ---------------\ \ Create a custom E2B Sandbox with pre-installed MCP servers](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/mcp-custom-template-js) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/mcp/examples.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/mcp/examples) [Previous](https://e2b.dev/docs/mcp/custom-servers) [Installation\ \ Next](https://e2b.dev/docs/cli) ⌘I --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.7.0/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/code-interpreting/supported-languages/java#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Supported languages Run Java code Use the `runCode`/`run_code` method to run Java code inside the sandbox. You’ll need to pass the `language` parameter with value `java`. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sbx = await Sandbox.create() const execution = await sbx.runCode('System.out.println("Hello, world!");', { language: 'java' }) console.log(execution) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/code-interpreting/supported-languages/java.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/code-interpreting/supported-languages/java) [Previous](https://e2b.dev/docs/code-interpreting/supported-languages/r) [Bash\ \ Next](https://e2b.dev/docs/code-interpreting/supported-languages/bash) ⌘I --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.1/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.1/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.2/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.7/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.6.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#usage-7) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/sandbox#options-4) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.1/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.8.0/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.1/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/mcp/custom-servers#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation MCP Gateway Custom Servers In addition to the 200+ pre-built MCP servers from the [Docker MCP Catalog](https://hub.docker.com/mcp) , you can run custom MCP servers directly from public GitHub repositories. [​](https://e2b.dev/docs/mcp/custom-servers#how-it-works) How it works ------------------------------------------------------------------------- When you specify a GitHub repository, E2B will: 1. Clone the repository into the sandbox 2. Run the `installCmd` (optional) to install dependencies 3. Run the `runCmd` to start the MCP server with stdio transport The `runCmd` must start an MCP server that follows the [MCP specification](https://modelcontextprotocol.io/specification/2025-06-18) and communicates via stdio (standard input/output). [​](https://e2b.dev/docs/mcp/custom-servers#using-a-custom-mcp-server) Using a custom MCP server --------------------------------------------------------------------------------------------------- TypeScript Python Copy Ask AI import Sandbox from 'e2b' const sandbox = await Sandbox.create({ mcp: { 'github/modelcontextprotocol/servers': { installCmd: 'npm install', runCmd: 'sudo npx -y @modelcontextprotocol/server-filesystem /root', }, }, }); [​](https://e2b.dev/docs/mcp/custom-servers#configuration) Configuration --------------------------------------------------------------------------- [​](https://e2b.dev/docs/mcp/custom-servers#param-install-cmd) installCmd string Optional command to run before starting the MCP server. Use this to install dependencies (e.g., `npm install`, `pip install -r requirements.txt`). [​](https://e2b.dev/docs/mcp/custom-servers#param-run-cmd) runCmd string required Command to start the MCP server. Must launch a stdio-enabled MCP server. **Important for npx-based servers:** Always include `installCmd: 'npm install'` (or equivalent) when using `npx` in your `runCmd`. Without installing dependencies first, npx will try to use the local repository and fail. [​](https://e2b.dev/docs/mcp/custom-servers#troubleshooting) Troubleshooting ------------------------------------------------------------------------------- If your custom MCP server doesn’t work as expected: 1. Explore the sandbox either via the [dashboard](https://e2b.dev/dashboard) or by connecting to it via `e2b connect ` 2. Check the gateway log file with `sudo cat /var/log/mcp-gateway/gateway.log`. Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/mcp/custom-servers.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/mcp/custom-servers) [Previous](https://e2b.dev/docs/mcp/custom-templates) [ExamplesExample projects using MCP servers in E2B sandboxes\ \ Next](https://e2b.dev/docs/mcp/examples) ⌘I On this page * [How it works](https://e2b.dev/docs/mcp/custom-servers#how-it-works) * [Using a custom MCP server](https://e2b.dev/docs/mcp/custom-servers#using-a-custom-mcp-server) * [Configuration](https://e2b.dev/docs/mcp/custom-servers#configuration) * [Troubleshooting](https://e2b.dev/docs/mcp/custom-servers#troubleshooting) --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/filesystem/read-write#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Filesystem Read & write files [​](https://e2b.dev/docs/filesystem/read-write#reading-files) Reading files ------------------------------------------------------------------------------ You can read files from the sandbox filesystem using the `files.read()` method. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() const fileContent = await sandbox.files.read('/path/to/file') [​](https://e2b.dev/docs/filesystem/read-write#writing-single-files) Writing single files -------------------------------------------------------------------------------------------- You can write single files to the sandbox filesystem using the `files.write()` method. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() await sandbox.files.write('/path/to/file', 'file content') [​](https://e2b.dev/docs/filesystem/read-write#writing-multiple-files) Writing multiple files ------------------------------------------------------------------------------------------------ You can also write multiple files to the sandbox. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() await sandbox.files.write([\ { path: '/path/to/a', data: 'file content' },\ { path: '/another/path/to/b', data: 'file content' }\ ]) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/filesystem/read-write.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/filesystem/read-write) [Previous](https://e2b.dev/docs/filesystem) [File & directory metadata\ \ Next](https://e2b.dev/docs/filesystem/info) ⌘I On this page * [Reading files](https://e2b.dev/docs/filesystem/read-write#reading-files) * [Writing single files](https://e2b.dev/docs/filesystem/read-write#writing-single-files) * [Writing multiple files](https://e2b.dev/docs/filesystem/read-write#writing-multiple-files) --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.0/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#options-2) * `-a, --all: kill all running sandboxes` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#options-4) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#usage-7) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.0/sandbox#options-5) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.9.2/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.3/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.9/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/filesystem/download#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Filesystem Download data from sandbox You can download data from the sandbox using the `files.read()` method. JavaScript & TypeScript Python Copy Ask AI import fs from 'fs' import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() // Read file from sandbox const content = await sandbox.files.read('/path/in/sandbox') // Write file to local filesystem fs.writeFileSync('/local/path', content) [​](https://e2b.dev/docs/filesystem/download#download-with-pre-signed-url) Download with pre-signed URL ---------------------------------------------------------------------------------------------------------- Sometimes, you may want to let users from unauthorized environments, like a browser, download files from the sandbox. For this use case, you can use pre-signed URLs to let users download files securely. All you need to do is create a sandbox with the `secure: true` option. A download URL will then be generated with a signature that allows only authorized users to access files. You can optionally set an expiration time for the URL so that it will be valid only for a limited time. JavaScript & TypeScript Python Copy Ask AI import fs from 'fs' import { Sandbox } from '@e2b/code-interpreter' // Start a secured sandbox (all operations must be authorized by default) const sandbox = await Sandbox.create(template, { secure: true }) // Create a pre-signed URL for file download with a 10 second expiration const publicUrl = await sandbox.downloadUrl( 'demo.txt', { useSignatureExpiration: 10_000, // optional }, ) // Download a file with a pre-signed URL (this can be used in any environment, such as a browser) const res = await fetch(publicUrl) const content = await res.text() Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/filesystem/download.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/filesystem/download) [Previous](https://e2b.dev/docs/filesystem/upload) [Overview\ \ Next](https://e2b.dev/docs/commands) ⌘I On this page * [Download with pre-signed URL](https://e2b.dev/docs/filesystem/download#download-with-pre-signed-url) --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/mcp#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation MCP Gateway Overview E2B provides a batteries-included MCP gateway that runs inside sandboxes, giving you type-safe access to 200+ MCP tools from the [Docker MCP Catalog](https://hub.docker.com/mcp) or [custom MCPs](https://e2b.dev/docs/mcp/custom-servers) through a unified interface. This integration gives developers instant access to tools like [Browserbase](https://www.browserbase.com/) , [Exa](https://exa.ai/) , [Notion](https://www.notion.so/) , [Stripe](https://stripe.com/) , or [GitHub](https://github.com/) . The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro) is an open standard for connecting AI models to external tools and data sources. E2B sandboxes provide an ideal environment for running MCP tools, giving AI full access to an internet-connected Linux machine where it can safely install packages, write files, run terminal commands, and AI-generated code. ![](https://mintcdn.com/e2b/JsolbCWO7aAeiUpW/images/mcp-overview.png?w=2500&fit=max&auto=format&n=JsolbCWO7aAeiUpW&q=85&s=7219dd88ea643e98069149b149a873ad) TypeScript Python Copy Ask AI import Sandbox from 'e2b' const sbx = await Sandbox.create({ mcp: { browserbase: { apiKey: process.env.BROWSERBASE_API_KEY!, geminiApiKey: process.env.GEMINI_API_KEY!, projectId: process.env.BROWSERBASE_PROJECT_ID!, }, exa: { apiKey: process.env.EXA_API_KEY!, }, airtable: { airtableApiKey: process.env.AIRTABLE_API_KEY!, }, }, }); const mcpUrl = sbx.getMcpUrl(); const mcpToken = await sbx.getMcpToken(); // You can now connect the gateway to any MCP client, for example claude: // This also works for your local claude! await sbx.commands.run(`claude mcp add --transport http e2b-mcp-gateway ${mcpUrl} --header "Authorization: Bearer ${mcpToken}"`, { timeoutMs: 0, onStdout: console.log, onStderr: console.log }); await sbx.commands.run( `echo 'Use browserbase and exa to research open positions at e2b.dev. Collect your findings in Airtable.' | claude -p --dangerously-skip-permissions`, { timeoutMs: 0, onStdout: console.log, onStderr: console.log } ) [​](https://e2b.dev/docs/mcp#documentation) Documentation ------------------------------------------------------------ [Quickstart\ ----------\ \ Get started with MCP](https://e2b.dev/docs/mcp/quickstart) [Available Servers\ -----------------\ \ Browse 200+ pre-built MCP servers](https://e2b.dev/docs/mcp/available-servers) [Custom Templates\ ----------------\ \ Prepull MCP servers for faster runtime](https://e2b.dev/docs/mcp/custom-templates) [Custom Servers\ --------------\ \ Use custom MCP servers from GitHub](https://e2b.dev/docs/mcp/custom-servers) [Examples\ --------\ \ See examples](https://e2b.dev/docs/mcp/examples) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/mcp.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/mcp) [Previous](https://e2b.dev/docs/commands/background) [QuickstartGet started with MCP integration\ \ Next](https://e2b.dev/docs/mcp/quickstart) ⌘I On this page * [Documentation](https://e2b.dev/docs/mcp#documentation) --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/filesystem/info#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Filesystem Get information about a file or directory You can get information about a file or directory using the `files.getInfo()` / `files.get_info()` methods. Information such as file name, type, and path is returned. ### [​](https://e2b.dev/docs/filesystem/info#getting-information-about-a-file) Getting information about a file JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() // Create a new file await sandbox.files.write('test_file.txt', 'Hello, world!') // Get information about the file const info = await sandbox.files.getInfo('test_file.txt') console.log(info) // { // name: 'test_file.txt', // type: 'file', // path: '/home/user/test_file.txt', // size: 13, // mode: 0o644, // permissions: '-rw-r--r--', // owner: 'user', // group: 'user', // modifiedTime: '2025-05-26T12:00:00.000Z', // symlinkTarget: null // } ### [​](https://e2b.dev/docs/filesystem/info#getting-information-about-a-directory) Getting information about a directory JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() // Create a new directory await sandbox.files.makeDir('test_dir') // Get information about the directory const info = await sandbox.files.getInfo('test_dir') console.log(info) // { // name: 'test_dir', // type: 'dir', // path: '/home/user/test_dir', // size: 0, // mode: 0o755, // permissions: 'drwxr-xr-x', // owner: 'user', // group: 'user', // modifiedTime: '2025-05-26T12:00:00.000Z', // symlinkTarget: null // } Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/filesystem/info.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/filesystem/info) [Previous](https://e2b.dev/docs/filesystem/read-write) [Watch directory for changes\ \ Next](https://e2b.dev/docs/filesystem/watch) ⌘I On this page * [Getting information about a file](https://e2b.dev/docs/filesystem/info#getting-information-about-a-file) * [Getting information about a directory](https://e2b.dev/docs/filesystem/info#getting-information-about-a-directory) --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.2/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.3/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#options-2) * `-a, --all: kill all running sandboxes` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#options-4) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#usage-7) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.1/sandbox#options-5) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.2/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#options-2) * `-a, --all: kill all running sandboxes` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.0.6/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.2/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/auth#e2b-auth) ------------------------------------------------------------------------- authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/auth#e2b-auth-login) ------------------------------------------------------------------------------------- log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/auth#e2b-auth-logout) --------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/auth#e2b-auth-info) ----------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/auth#e2b-auth-configure) --------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#options-2) * `-a, --all: kill all running sandboxes` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#e2b-template) ------------------------------------------------------------------------------------- manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#e2b-template-build) ------------------------------------------------------------------------------------------------- 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template build-v2](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#e2b-template-build-v2) ------------------------------------------------------------------------------------------------------- build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#usage-3) e2b template build-v2 [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#options-2) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#e2b-template-list) ----------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#usage-4) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#options-3) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#e2b-template-init) ----------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#usage-5) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#options-4) * `-p, --path : change root directory where command is executed to directory` [e2b template init-v2](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#e2b-template-init-v2) ----------------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#usage-6) e2b template init-v2 [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#e2b-template-delete) --------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#usage-7) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#e2b-template-publish) ----------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#usage-8) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#e2b-template-unpublish) --------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#usage-9) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#options-8) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#e2b-template-migrate) ----------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#usage-10) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/template#options-9) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/mcp/custom-templates#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation MCP Gateway Custom Templates You can prepull MCP server Docker images during template build time to significantly improve runtime performance. [​](https://e2b.dev/docs/mcp/custom-templates#how-it-works) How it works --------------------------------------------------------------------------- When you build a template with prepulled MCP servers, the Docker images for those servers are downloaded and cached during the build process. This means when you create a sandbox from that template, the MCP servers are ready to use immediately without waiting for image downloads. You must use the MCP gateway enabled template (`mcp-gateway`) as your base template to use this feature. [​](https://e2b.dev/docs/mcp/custom-templates#building-a-template-with-mcp-servers) Building a template with MCP servers --------------------------------------------------------------------------------------------------------------------------- Use the `addMcpServer()` method (TypeScript) or `add_mcp_server()` method (Python) to prepull MCP server images during template build. You can pass a single server or an array of servers. The server names (like `"browserbase"` and `"exa"`) correspond to the keys defined in the [Available Servers](https://e2b.dev/docs/mcp/available-servers) documentation. JavaScript & TypeScript Python Copy Ask AI import "dotenv/config"; import { Template, defaultBuildLogger } from "e2b"; export const template = Template() .fromTemplate("mcp-gateway") .addMcpServer(["browserbase", "exa"]); await Template.build(template, { alias: "my-mcp-gateway", cpuCount: 8, memoryMB: 8192, onBuildLogs: defaultBuildLogger(), }); [​](https://e2b.dev/docs/mcp/custom-templates#using-the-template) Using the template --------------------------------------------------------------------------------------- Once built, create sandboxes from your template alias. You still need to provide the configuration for each MCP server. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from "e2b"; const sandbox = await Sandbox.create({ template: "my-mcp-gateway", mcp: { browserbase: { apiKey: process.env.BROWSERBASE_API_KEY!, geminiApiKey: process.env.GEMINI_API_KEY!, projectId: process.env.BROWSERBASE_PROJECT_ID!, }, exa: { apiKey: process.env.EXA_API_KEY!, }, }, }); [​](https://e2b.dev/docs/mcp/custom-templates#learn-more) Learn more ----------------------------------------------------------------------- For more information about working with templates, see: * [Template Quickstart](https://e2b.dev/docs/template/quickstart) - Get started with custom templates * [Defining Templates](https://e2b.dev/docs/template/defining-template) - Learn all template configuration options * [Template Build](https://e2b.dev/docs/template/build) - Understand the build process Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/mcp/custom-templates.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/mcp/custom-templates) [Previous](https://e2b.dev/docs/mcp/available-servers) [Custom ServersUse custom MCP servers from GitHub repositories\ \ Next](https://e2b.dev/docs/mcp/custom-servers) ⌘I On this page * [How it works](https://e2b.dev/docs/mcp/custom-templates#how-it-works) * [Building a template with MCP servers](https://e2b.dev/docs/mcp/custom-templates#building-a-template-with-mcp-servers) * [Using the template](https://e2b.dev/docs/mcp/custom-templates#using-the-template) * [Learn more](https://e2b.dev/docs/mcp/custom-templates#learn-more) --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/filesystem/watch#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Filesystem Watch sandbox directory for changes You can watch a directory for changes using the `files.watchDir()` method in JavaScript and `files.watch_dir()` method in Python. Since events are tracked asynchronously, their delivery may be delayed. It’s recommended not to collect or close watcher immediately after making a change. JavaScript & TypeScript Python Copy Ask AI import { Sandbox, FilesystemEventType } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() const dirname = '/home/user' // Start watching directory for changes const handle = await sandbox.files.watchDir(dirname, async (event) => { console.log(event) if (event.type === FilesystemEventType.WRITE) { console.log(`wrote to file ${event.name}`) } }) // Trigger file write event await sandbox.files.write(`${dirname}/my-file`, 'hello') [​](https://e2b.dev/docs/filesystem/watch#recursive-watching) Recursive Watching ----------------------------------------------------------------------------------- You can enable recursive watching using the parameter `recursive`. When rapidly creating new folders (e.g., deeply nested path of folders), events other than `CREATE` might not be emitted. To avoid this behavior, create the required folder structure in advance. JavaScript & TypeScript Python Copy Ask AI import { Sandbox, FilesystemEventType } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() const dirname = '/home/user' // Start watching directory for changes const handle = await sandbox.files.watchDir(dirname, async (event) => { console.log(event) if (event.type === FilesystemEventType.WRITE) { console.log(`wrote to file ${event.name}`) } }, { recursive: true }) // Trigger file write event await sandbox.files.write(`${dirname}/my-folder/my-file`, 'hello') Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/filesystem/watch.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/filesystem/watch) [Previous](https://e2b.dev/docs/filesystem/info) [Upload data\ \ Next](https://e2b.dev/docs/filesystem/upload) ⌘I On this page * [Recursive Watching](https://e2b.dev/docs/filesystem/watch#recursive-watching) --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.3.4/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#usage-8) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/template#options-7) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.2.0/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.2/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.1/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#usage-8) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/template#options-7) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template init-v2](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#e2b-template-init-v2) ---------------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#usage-5) e2b template init-v2 [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#e2b-sandbox) ---------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#e2b-sandbox-connect) -------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#e2b-sandbox-list) -------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#e2b-sandbox-kill) -------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#e2b-sandbox-create) ------------------------------------------------------------------------------------------------ create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#e2b-sandbox-spawn) ---------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#e2b-sandbox-logs) -------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#e2b-sandbox-metrics) -------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.10/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.0.3/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, table` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, table` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.1.0/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#usage-8) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/template#options-7) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.1/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template init-v2](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#e2b-template-init-v2) ---------------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#usage-5) e2b template init-v2 [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template create](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#e2b-template-create) -------------------------------------------------------------------------------------------------- build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#usage-2) e2b template create [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--no-cache: skip cache when building the template.` [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#usage-3) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#options-2) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#usage-4) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#options-3) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#usage-5) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all running sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#usage-3) e2b sandbox list [options] CopyCopied! [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#usage-4) e2b sandbox kill [options] [sandboxID] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#options) * `-a, --all: kill all running sandboxes` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- spawn sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#usage-5) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#options-2) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#usage-6) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.5.1/sandbox#options-3) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#usage-5) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#usage-6) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#usage-7) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v1.4.3/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.2/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.4/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#usage) e2b template [options] [command] CopyCopied! [e2b template create](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#e2b-template-create) -------------------------------------------------------------------------------------------------- build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#usage-2) e2b template create [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--no-cache: skip cache when building the template.` [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#usage-3) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#options-2) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#usage-4) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#options-3) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#e2b-template-init) ---------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#usage-5) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/filesystem/upload#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Filesystem Upload data to sandbox You can upload data to the sandbox using the `files.write()` method. [​](https://e2b.dev/docs/filesystem/upload#upload-single-file) Upload single file ------------------------------------------------------------------------------------ JavaScript & TypeScript Python Copy Ask AI import fs from 'fs' import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() // Read file from local filesystem const content = fs.readFileSync('/local/path') // Upload file to sandbox await sandbox.files.write('/path/in/sandbox', content) [​](https://e2b.dev/docs/filesystem/upload#upload-with-pre-signed-url) Upload with pre-signed URL ---------------------------------------------------------------------------------------------------- Sometimes, you may want to let users from unauthorized environments, like a browser, upload files to the sandbox. For this use case, you can use pre-signed URLs to let users upload files securely. All you need to do is create a sandbox with the `secure: true` option. An upload URL will then be generated with a signature that allows only authorized users to upload files. You can optionally set an expiration time for the URL so that it will be valid only for a limited time. JavaScript & TypeScript Python Copy Ask AI import fs from 'fs' import { Sandbox } from '@e2b/code-interpreter' // Start a secured sandbox (all operations must be authorized by default) const sandbox = await Sandbox.create(template, { secure: true }) // Create a pre-signed URL for file upload with a 10 second expiration const publicUploadUrl = await sandbox.uploadUrl( 'demo.txt', { useSignatureExpiration: 10_000, // optional }, ) // Upload a file with a pre-signed URL (this can be used in any environment, such as a browser) const form = new FormData() form.append('file', 'file content') await fetch(publicUploadUrl, { method: 'POST', body: form }) // File is now available in the sandbox and you can read it const content = fs.readFileSync('demo.txt') [​](https://e2b.dev/docs/filesystem/upload#upload-directory-/-multiple-files) Upload directory / multiple files ------------------------------------------------------------------------------------------------------------------ JavaScript & TypeScript Python Copy Ask AI const fs = require('fs'); const path = require('path'); import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() // Read all files in the directory and store their paths and contents in an array const readDirectoryFiles = (directoryPath) => { // Read all files in the local directory const files = fs.readdirSync(directoryPath); // Map files to objects with path and data const filesArray = files .filter(file => { const fullPath = path.join(directoryPath, file); // Skip if it's a directory return fs.statSync(fullPath).isFile(); }) .map(file => { const filePath = path.join(directoryPath, file); // Read the content of each file return { path: filePath, data: fs.readFileSync(filePath, 'utf8') }; }); return filesArray; }; // Usage example const files = readDirectoryContents('/local/dir'); console.log(files); // [\ // { path: '/local/dir/file1.txt', data: 'File 1 contents...' },\ // { path: '/local/dir/file2.txt', data: 'File 2 contents...' },\ // ...\ // ] await sandbox.files.write(files) Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/filesystem/upload.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/filesystem/upload) [Previous](https://e2b.dev/docs/filesystem/watch) [Download data\ \ Next](https://e2b.dev/docs/filesystem/download) ⌘I On this page * [Upload single file](https://e2b.dev/docs/filesystem/upload#upload-single-file) * [Upload with pre-signed URL](https://e2b.dev/docs/filesystem/upload#upload-with-pre-signed-url) * [Upload directory / multiple files](https://e2b.dev/docs/filesystem/upload#upload-directory-/-multiple-files) --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.5/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template init-v2](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#e2b-template-init-v2) ---------------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#usage-5) e2b template init-v2 [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.6/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#usage) e2b template [options] [command] CopyCopied! [e2b template create](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#e2b-template-create) -------------------------------------------------------------------------------------------------- build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#usage-2) e2b template create [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--no-cache: skip cache when building the template.` [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#usage-3) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#options-2) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#usage-4) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#options-3) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#e2b-template-init) ---------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#usage-5) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.3/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.0/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#usage) e2b template [options] [command] CopyCopied! [e2b template create](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#e2b-template-create) -------------------------------------------------------------------------------------------------- build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#usage-2) e2b template create [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--no-cache: skip cache when building the template.` [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#usage-3) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#options-2) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#usage-4) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#options-3) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#e2b-template-init) ---------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#usage-5) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template build-v2](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#e2b-template-build-v2) ------------------------------------------------------------------------------------------------------ build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#usage-3) e2b template build-v2 [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#options-2) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#usage-4) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#options-3) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#usage-5) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#options-4) * `-p, --path : change root directory where command is executed to directory` [e2b template init-v2](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#e2b-template-init-v2) ---------------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#usage-6) e2b template init-v2 [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#usage-7) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#usage-8) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#usage-9) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#options-8) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#usage-10) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/template#options-9) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.8/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.2/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.1/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [DEFAULT\_TIMEOUT\_MS](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/consts#default-timeout-ms) const DEFAULT_TIMEOUT_MS: 60000 = 60_000; CopyCopied! * * * ### [JUPYTER\_PORT](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/consts#jupyter-port) const JUPYTER_PORT: 49999 = 49999; CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [BarChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#bar-chart) Re-exports BarChart ### [BarData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#bar-data) Re-exports BarData ### [BoxAndWhiskerChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#box-and-whisker-chart) Re-exports BoxAndWhiskerChart ### [BoxAndWhiskerData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#box-and-whisker-data) Re-exports BoxAndWhiskerData ### [Chart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#chart) Re-exports Chart ### [ChartType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#chart-type) Re-exports ChartType ### [ChartTypes](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#chart-types) Re-exports ChartTypes ### [Context](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#context) Re-exports Context ### [CreateCodeContextOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#create-code-context-opts) Re-exports CreateCodeContextOpts ### [default](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#default) Renames and re-exports Sandbox ### [Execution](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#execution) Re-exports Execution ### [ExecutionError](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#execution-error) Re-exports ExecutionError ### [LineChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#line-chart) Re-exports LineChart ### [Logs](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#logs) Re-exports Logs ### [MIMEType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#mime-type) Re-exports MIMEType ### [OutputMessage](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#output-message) Re-exports OutputMessage ### [PieChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#pie-chart) Re-exports PieChart ### [PieData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#pie-data) Re-exports PieData ### [PointData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#point-data) Re-exports PointData ### [RawData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#raw-data) Re-exports RawData ### [Result](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#result) Re-exports Result ### [RunCodeOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#run-code-opts) Re-exports RunCodeOpts ### [Sandbox](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#sandbox) Re-exports Sandbox ### [ScaleType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#scale-type) Re-exports ScaleType ### [ScatterChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#scatter-chart) Re-exports ScatterChart ### [SuperChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/index#super-chart) Re-exports SuperChart --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [DEFAULT\_TIMEOUT\_MS](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/consts#default-timeout-ms) const DEFAULT_TIMEOUT_MS: 60000 = 60_000; CopyCopied! * * * ### [JUPYTER\_PORT](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/consts#jupyter-port) const JUPYTER_PORT: 49999 = 49999; CopyCopied! --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/quickstart#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Quickstart Running your first Sandbox 1 Create E2B account Every new E2B account get $100 in credits. You can sign up [here](https://e2b.dev/auth/sign-up) . 2 Set your environment variables 1. Navigate to the E2B Dashboard. 2. Copy your API key. 3. Paste your E2B API key into your .env file. .env Copy Ask AI E2B_API_KEY=e2b_*** 3 Install E2B SDK Install the E2B SDK to your project by running the following command in your terminal. JavaScript & TypeScript Python Copy Ask AI npm i @e2b/code-interpreter dotenv 4 Write code for starting Sandbox We’ll write the minimal code for starting Sandbox, executing Python inside it and listing all files inside the root directory. JavaScript & TypeScript Python Copy Ask AI // index.ts import 'dotenv/config' import { Sandbox } from '@e2b/code-interpreter' const sbx = await Sandbox.create() // By default the sandbox is alive for 5 minutes const execution = await sbx.runCode('print("hello world")') // Execute Python inside the sandbox console.log(execution.logs) const files = await sbx.files.list('/') console.log(files) 5 Start your first E2B Sandbox Run the code with the following command: JavaScript & TypeScript Python Copy Ask AI npx tsx ./index.ts Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/quickstart.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/quickstart) [Previous](https://e2b.dev/docs) [Connect LLMs to E2B\ \ Next](https://e2b.dev/docs/quickstart/connect-llms) ⌘I --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template build-v2](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#e2b-template-build-v2) ------------------------------------------------------------------------------------------------------ build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#usage-3) e2b template build-v2 [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#options-2) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#usage-4) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#options-3) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#usage-5) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#options-4) * `-p, --path : change root directory where command is executed to directory` [e2b template init-v2](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#e2b-template-init-v2) ---------------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#usage-6) e2b template init-v2 [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#usage-7) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#usage-8) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#usage-9) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#options-8) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#usage-10) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.9/template#options-9) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.3.3/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [BarChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#bar-chart) Re-exports BarChart ### [BarData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#bar-data) Re-exports BarData ### [BoxAndWhiskerChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#box-and-whisker-chart) Re-exports BoxAndWhiskerChart ### [BoxAndWhiskerData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#box-and-whisker-data) Re-exports BoxAndWhiskerData ### [Chart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#chart) Re-exports Chart ### [ChartType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#chart-type) Re-exports ChartType ### [ChartTypes](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#chart-types) Re-exports ChartTypes ### [Context](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#context) Re-exports Context ### [CreateCodeContextOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#create-code-context-opts) Re-exports CreateCodeContextOpts ### [default](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#default) Renames and re-exports Sandbox ### [Execution](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#execution) Re-exports Execution ### [ExecutionError](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#execution-error) Re-exports ExecutionError ### [LineChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#line-chart) Re-exports LineChart ### [Logs](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#logs) Re-exports Logs ### [MIMEType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#mime-type) Re-exports MIMEType ### [OutputMessage](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#output-message) Re-exports OutputMessage ### [PieChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#pie-chart) Re-exports PieChart ### [PieData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#pie-data) Re-exports PieData ### [PointData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#point-data) Re-exports PointData ### [RawData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#raw-data) Re-exports RawData ### [Result](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#result) Re-exports Result ### [RunCodeOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#run-code-opts) Re-exports RunCodeOpts ### [Sandbox](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#sandbox) Re-exports Sandbox ### [ScaleType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#scale-type) Re-exports ScaleType ### [ScatterChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#scatter-chart) Re-exports ScatterChart ### [SuperChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/index#super-chart) Re-exports SuperChart --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b auth](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/auth#e2b-auth) ------------------------------------------------------------------------ authentication commands ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/auth#usage) e2b auth [options] [command] CopyCopied! [e2b auth login](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/auth#e2b-auth-login) ------------------------------------------------------------------------------------ log in to CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/auth#usage-2) e2b auth login [options] CopyCopied! [e2b auth logout](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/auth#e2b-auth-logout) -------------------------------------------------------------------------------------- log out of CLI ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/auth#usage-3) e2b auth logout [options] CopyCopied! [e2b auth info](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/auth#e2b-auth-info) ---------------------------------------------------------------------------------- get information about the current user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/auth#usage-4) e2b auth info [options] CopyCopied! [e2b auth configure](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/auth#e2b-auth-configure) -------------------------------------------------------------------------------------------- configure user ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/auth#usage-5) e2b auth configure [options] CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [BarChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#bar-chart) Re-exports BarChart ### [BarData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#bar-data) Re-exports BarData ### [BoxAndWhiskerChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#box-and-whisker-chart) Re-exports BoxAndWhiskerChart ### [BoxAndWhiskerData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#box-and-whisker-data) Re-exports BoxAndWhiskerData ### [Chart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#chart) Re-exports Chart ### [ChartType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#chart-type) Re-exports ChartType ### [ChartTypes](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#chart-types) Re-exports ChartTypes ### [Context](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#context) Re-exports Context ### [CreateCodeContextOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#create-code-context-opts) Re-exports CreateCodeContextOpts ### [default](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#default) Renames and re-exports Sandbox ### [Execution](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#execution) Re-exports Execution ### [ExecutionError](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#execution-error) Re-exports ExecutionError ### [LineChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#line-chart) Re-exports LineChart ### [Logs](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#logs) Re-exports Logs ### [MIMEType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#mime-type) Re-exports MIMEType ### [OutputMessage](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#output-message) Re-exports OutputMessage ### [PieChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#pie-chart) Re-exports PieChart ### [PieData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#pie-data) Re-exports PieData ### [PointData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#point-data) Re-exports PointData ### [RawData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#raw-data) Re-exports RawData ### [Result](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#result) Re-exports Result ### [RunCodeOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#run-code-opts) Re-exports RunCodeOpts ### [Sandbox](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#sandbox) Re-exports Sandbox ### [ScaleType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#scale-type) Re-exports ScaleType ### [ScatterChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#scatter-chart) Re-exports ScatterChart ### [SuperChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/index#super-chart) Re-exports SuperChart --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/sandbox-template/customize-cpu-ram#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Legacy Docs Customize sandbox CPU & RAM You’re browsing a legacy version of the build system. Visit the [Build System 2.0 documentation](https://e2b.dev/docs/template/quickstart) . You can customize the CPU and RAM of your sandbox template via E2B CLI. You’ll need to create a sandbox [template first](https://e2b.dev/docs/sandbox-template) . During the build step, you can specify the CPU and RAM of your sandbox template. The following command will create a sandbox template with 2 CPUs and 2GB of RAM. Terminal Copy Ask AI e2b template build -c "/root/.jupyter/start-up.sh" --cpu-count 2 --memory-mb 2048 Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/sandbox-template/customize-cpu-ram.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/sandbox-template/customize-cpu-ram) [Previous](https://e2b.dev/docs/sandbox-template/ready-cmd) [Overview\ \ Next](https://e2b.dev/docs/filesystem) ⌘I --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/sandbox-template#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Legacy Docs Sandbox templates You’re browsing a legacy version of the build system. Visit the [Build System 2.0 documentation](https://e2b.dev/docs/template/quickstart) . Sandbox templates allow you to customize the sandbox environment to your needs. To create a sandbox template, you specify the `e2b.Dockerfile`. We then take this Dockerfile and create a new sandbox template from it and give you back a template ID. You can then use this template ID to create a new sandbox with the SDK based on the template you created. [​](https://e2b.dev/docs/sandbox-template#how-to-create-custom-sandbox) How to create custom sandbox ------------------------------------------------------------------------------------------------------- **Steps** 1. [Install E2B CLI](https://e2b.dev/docs/sandbox-template#1-install-e2b-cli) 2. [Initialize sandbox template](https://e2b.dev/docs/sandbox-template#2-initialize-sandbox-template) 3. [Customize `e2b.Dockerfile`](https://e2b.dev/docs/sandbox-template#3-customize-e2b-dockerfile) 4. [Build your sandbox template](https://e2b.dev/docs/sandbox-template#4-build-your-sandbox-template) 5. [Start your custom sandbox](https://e2b.dev/docs/sandbox-template#5-start-your-custom-sandbox) ### [​](https://e2b.dev/docs/sandbox-template#1-install-e2b-cli) 1\. Install E2B CLI **Using Homebrew (on macOS)** Homebrew Copy Ask AI brew install e2b **Using NPM** NPM Copy Ask AI npm i -g @e2b/cli ### [​](https://e2b.dev/docs/sandbox-template#2-initialize-sandbox-template) 2\. Initialize sandbox template The following command will create a basic `e2b.Dockerfile` in the current directory. bash Copy Ask AI e2b template init ### [​](https://e2b.dev/docs/sandbox-template#3-customize-e2b-dockerfile) 3\. Customize `e2b.Dockerfile` Now you can customize your sandbox template by editing the `e2b.Dockerfile` file. e2b.Dockerfile Copy Ask AI # Make sure to use this base image FROM e2bdev/code-interpreter:latest # Install some Python packages RUN pip install cowsay Only [Debian-based](https://en.wikipedia.org/wiki/List_of_Linux_distributions#Debian-based) images (e.g., Debian, Ubuntu, or [E2B images](https://hub.docker.com/u/e2bdev) ) are supported. ### [​](https://e2b.dev/docs/sandbox-template#4-build-your-sandbox-template) 4\. Build your sandbox template Now you can build your sandbox template. We’ll use Docker and the E2B CLI. What is going to happen is that E2B CLI will call Docker to build the image and then push it to the E2B cloud. Then we convert the Docker image to a micro VM that can be then launched as a sandbox with our SDK. bash Copy Ask AI e2b template build -c "/root/.jupyter/start-up.sh" This process will take a moment. In the end, you’ll see your template ID that you’ll need to use to create a sandbox with the SDK. ### [​](https://e2b.dev/docs/sandbox-template#5-start-your-custom-sandbox) 5\. Start your custom sandbox Now you can use the template ID to create a sandbox with the SDK. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' // Your template ID from the previous step const templateID = 'id-of-your-template' // Pass the template ID to the `Sandbox.create` method const sandbox = await Sandbox.create(templateID) // The template installed cowsay, so we can use it const execution = await sandbox.runCode(` import cowsay cowsay.say('Hello from E2B!') `) console.log(execution.stdout) [​](https://e2b.dev/docs/sandbox-template#how-it-works) How it works ----------------------------------------------------------------------- Every time you are building a sandbox template, we create a container based on the [`e2b.Dockerfile`](https://e2b.dev/docs/sandbox-template#3-customize-e2b-dockerfile) file you create in the process. We extract the container’s filesystem, do provisioning and configuration (e.g. installing required dependencies), and start a sandbox. Then, these steps happen: 1. We take the running sandbox. 2. (Only if you specified the [start command](https://e2b.dev/docs/sandbox-template/start-cmd) , otherwise this step is skipped) Execute the start command. 3. Wait for readiness (by default 20 seconds if start command is specified, otherwise immediately ready). Readiness check can be configured using [ready command](https://e2b.dev/docs/sandbox-template/ready-cmd) . 4. Snapshot the sandbox and make it ready for you to spawn it with the SDK. We call this sandbox snapshot a _sandbox template_. **Sandbox Snapshot**Snapshots are saved running sandboxes. We serialize and save the whole sandbox’s filesystem together with all the running processes in a way that can be loaded later.This allows us to load the sandbox in a few hundred milliseconds any time later with all the processes already running and the filesystem exactly as it was. Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/sandbox-template.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/sandbox-template) [Previous](https://e2b.dev/docs/template/migration-v2) [Start command\ \ Next](https://e2b.dev/docs/sandbox-template/start-cmd) ⌘I On this page * [How to create custom sandbox](https://e2b.dev/docs/sandbox-template#how-to-create-custom-sandbox) * [1\. Install E2B CLI](https://e2b.dev/docs/sandbox-template#1-install-e2b-cli) * [2\. Initialize sandbox template](https://e2b.dev/docs/sandbox-template#2-initialize-sandbox-template) * [3\. Customize e2b.Dockerfile](https://e2b.dev/docs/sandbox-template#3-customize-e2b-dockerfile) * [4\. Build your sandbox template](https://e2b.dev/docs/sandbox-template#4-build-your-sandbox-template) * [5\. Start your custom sandbox](https://e2b.dev/docs/sandbox-template#5-start-your-custom-sandbox) * [How it works](https://e2b.dev/docs/sandbox-template#how-it-works) --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [DEFAULT\_TIMEOUT\_MS](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/consts#default-timeout-ms) const DEFAULT_TIMEOUT_MS: 60000 = 60_000; CopyCopied! * * * ### [JUPYTER\_PORT](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/consts#jupyter-port) const JUPYTER_PORT: 49999 = 49999; CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#usage) e2b template [options] [command] CopyCopied! [e2b template create](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#e2b-template-create) -------------------------------------------------------------------------------------------------- build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#usage-2) e2b template create [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--no-cache: skip cache when building the template.` [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#usage-3) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#options-2) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#usage-4) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#options-3) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#e2b-template-init) ---------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#usage-5) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.0/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#usage) e2b template [options] [command] CopyCopied! [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#usage-2) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#usage-3) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#options-2) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#e2b-template-init) ---------------------------------------------------------------------------------------------- create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#usage-4) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#options-3) * `-p, --path : change root directory where command is executed to directory` [e2b template init-v2](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#e2b-template-init-v2) ---------------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#usage-5) e2b template init-v2 [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.2.7/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#usage) e2b template [options] [command] CopyCopied! [e2b template create](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#e2b-template-create) -------------------------------------------------------------------------------------------------- build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#usage-2) e2b template create [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--no-cache: skip cache when building the template.` [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#usage-3) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#options-2) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#usage-4) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#options-3) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#e2b-template-init) ---------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#usage-5) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [BarChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#bar-chart) Re-exports BarChart ### [BarData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#bar-data) Re-exports BarData ### [BoxAndWhiskerChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#box-and-whisker-chart) Re-exports BoxAndWhiskerChart ### [BoxAndWhiskerData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#box-and-whisker-data) Re-exports BoxAndWhiskerData ### [Chart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#chart) Re-exports Chart ### [ChartType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#chart-type) Re-exports ChartType ### [ChartTypes](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#chart-types) Re-exports ChartTypes ### [Context](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#context) Re-exports Context ### [CreateCodeContextOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#create-code-context-opts) Re-exports CreateCodeContextOpts ### [default](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#default) Renames and re-exports Sandbox ### [Execution](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#execution) Re-exports Execution ### [ExecutionError](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#execution-error) Re-exports ExecutionError ### [LineChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#line-chart) Re-exports LineChart ### [Logs](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#logs) Re-exports Logs ### [MIMEType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#mime-type) Re-exports MIMEType ### [OutputMessage](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#output-message) Re-exports OutputMessage ### [PieChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#pie-chart) Re-exports PieChart ### [PieData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#pie-data) Re-exports PieData ### [PointData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#point-data) Re-exports PointData ### [RawData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#raw-data) Re-exports RawData ### [Result](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#result) Re-exports Result ### [RunCodeOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#run-code-opts) Re-exports RunCodeOpts ### [Sandbox](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#sandbox) Re-exports Sandbox ### [ScaleType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#scale-type) Re-exports ScaleType ### [ScatterChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#scatter-chart) Re-exports ScatterChart ### [SuperChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/index#super-chart) Re-exports SuperChart --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [DEFAULT\_TIMEOUT\_MS](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/consts#default-timeout-ms) const DEFAULT_TIMEOUT_MS: 60000 = 60_000; CopyCopied! * * * ### [JUPYTER\_PORT](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/consts#jupyter-port) const JUPYTER_PORT: 49999 = 49999; CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [BarChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#bar-chart) Re-exports BarChart ### [BarData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#bar-data) Re-exports BarData ### [BoxAndWhiskerChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#box-and-whisker-chart) Re-exports BoxAndWhiskerChart ### [BoxAndWhiskerData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#box-and-whisker-data) Re-exports BoxAndWhiskerData ### [Chart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#chart) Re-exports Chart ### [ChartType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#chart-type) Re-exports ChartType ### [ChartTypes](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#chart-types) Re-exports ChartTypes ### [Context](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#context) Re-exports Context ### [CreateCodeContextOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#create-code-context-opts) Re-exports CreateCodeContextOpts ### [default](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#default) Renames and re-exports Sandbox ### [Execution](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#execution) Re-exports Execution ### [ExecutionError](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#execution-error) Re-exports ExecutionError ### [LineChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#line-chart) Re-exports LineChart ### [Logs](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#logs) Re-exports Logs ### [MIMEType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#mime-type) Re-exports MIMEType ### [OutputMessage](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#output-message) Re-exports OutputMessage ### [PieChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#pie-chart) Re-exports PieChart ### [PieData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#pie-data) Re-exports PieData ### [PointData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#point-data) Re-exports PointData ### [RawData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#raw-data) Re-exports RawData ### [Result](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#result) Re-exports Result ### [RunCodeOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#run-code-opts) Re-exports RunCodeOpts ### [Sandbox](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#sandbox) Re-exports Sandbox ### [ScaleType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#scale-type) Re-exports ScaleType ### [ScatterChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#scatter-chart) Re-exports ScatterChart ### [SuperChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/index#super-chart) Re-exports SuperChart --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [DEFAULT\_TIMEOUT\_MS](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/consts#default-timeout-ms) const DEFAULT_TIMEOUT_MS: 60000 = 60_000; CopyCopied! * * * ### [JUPYTER\_PORT](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/consts#jupyter-port) const JUPYTER_PORT: 49999 = 49999; CopyCopied! --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b sandbox](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#e2b-sandbox) --------------------------------------------------------------------------------- work with sandboxes ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#usage) e2b sandbox [options] [command] CopyCopied! [e2b sandbox connect](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#e2b-sandbox-connect) ------------------------------------------------------------------------------------------------- connect terminal to already running sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#usage-2) e2b sandbox connect [options] CopyCopied! [e2b sandbox list](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#e2b-sandbox-list) ------------------------------------------------------------------------------------------- list all sandboxes, by default it list only running ones ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#usage-3) e2b sandbox list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#options) * `-s, --state : filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : filter by metadata, eg. key1=value1` * `-l, --limit : limit the number of sandboxes returned` * `-f, --format : output format, eg. json, pretty` [e2b sandbox kill](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#e2b-sandbox-kill) ------------------------------------------------------------------------------------------- kill sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#usage-4) e2b sandbox kill [options] [sandboxIDs...] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#options-2) * `-a, --all: kill all sandboxes` * `-s, --state : when used with -a/--all flag, filter by state, eg. running, paused. Defaults to running` * `-m, --metadata : when used with -a/--all flag, filter by metadata, eg. key1=value1` [e2b sandbox create](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#e2b-sandbox-create) ----------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#usage-5) e2b sandbox create [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#options-3) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox spawn](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#e2b-sandbox-spawn) --------------------------------------------------------------------------------------------- create sandbox and connect terminal to it ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#usage-6) e2b sandbox spawn [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#options-4) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` [e2b sandbox logs](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#e2b-sandbox-logs) ------------------------------------------------------------------------------------------- show logs for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#usage-7) e2b sandbox logs [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#options-5) * `--level : filter logs by level (DEBUG, INFO, WARN, ERROR). The logs with the higher levels will be also shown. [default: INFO]` * `-f, --follow: keep streaming logs until the sandbox is closed` * `--format : specify format for printing logs (json, pretty) [default: pretty]` * `--loggers [loggers]: filter logs by loggers. Specify multiple loggers by separating them with a comma.` [e2b sandbox metrics](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#e2b-sandbox-metrics) ------------------------------------------------------------------------------------------------- show metrics for sandbox ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#usage-8) e2b sandbox metrics [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.1/sandbox#options-6) * `-f, --follow: keep streaming metrics until the sandbox is closed` * `--format : specify format for printing metrics (json, pretty) [default: pretty]` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [e2b template](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#e2b-template) ------------------------------------------------------------------------------------ manage sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#usage) e2b template [options] [command] CopyCopied! [e2b template create](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#e2b-template-create) -------------------------------------------------------------------------------------------------- build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#usage-2) e2b template create [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#options) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--no-cache: skip cache when building the template.` [e2b template build](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#e2b-template-build) ------------------------------------------------------------------------------------------------ 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. ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#usage-3) e2b template build [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#options-2) * `-p, --path : change root directory where command is executed to directory` * `-d, --dockerfile : specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.` * `-n, --name : specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.` * `-c, --cmd : specify command that will be executed when the sandbox is started.` * `--ready-cmd : specify command that will need to exit 0 for the template to be ready.` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `--cpu-count : specify the number of CPUs that will be used to run the sandbox. The default value is 2.` * `--memory-mb : specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.` * `--build-arg : specify additional build arguments for the build command. The format should be =.` * `--no-cache: skip cache when building the template.` [e2b template list](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#e2b-template-list) ---------------------------------------------------------------------------------------------- list sandbox templates ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#usage-4) e2b template list [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#options-3) * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-f, --format : output format, eg. json, pretty` [e2b template init](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#e2b-template-init) ---------------------------------------------------------------------------------------------- initialize a new sandbox template using the SDK ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#usage-5) e2b template init [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#options-4) * `-p, --path : change root directory where command is executed to directory` * `-n, --name : template name (alias)` * `-l, --language : target language: typescript, python-sync, python-async` [e2b template delete](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#e2b-template-delete) -------------------------------------------------------------------------------------------------- delete sandbox template and e2b.toml config ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#usage-6) e2b template delete [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#options-5) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual delete confirmation` [e2b template publish](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#e2b-template-publish) ---------------------------------------------------------------------------------------------------- publish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#usage-7) e2b template publish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#options-6) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual publish confirmation` [e2b template unpublish](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#e2b-template-unpublish) -------------------------------------------------------------------------------------------------------- unpublish sandbox template ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#usage-8) e2b template unpublish [options] [template] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#options-7) * `-p, --path : change root directory where command is executed to directory` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-s, --select: select sandbox template from interactive list` * `-t, --team : specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).` * `-y, --yes: skip manual unpublish confirmation` [e2b template migrate](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#e2b-template-migrate) ---------------------------------------------------------------------------------------------------- migrate e2b.Dockerfile and e2b.toml to new Template SDK format ### [Usage](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#usage-9) e2b template migrate [options] CopyCopied! ### [Options](https://e2b.dev/docs/sdk-reference/cli/v2.4.2/template#options-8) * `-d, --dockerfile : specify path to Dockerfile. Defaults to e2b.Dockerfile` * `--config : specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory.` * `-l, --language : specify target language: typescript, python-sync, python-async` * `-p, --path : change root directory where command is executed to directory` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [ChartType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#chart-type) Chart types #### Enumeration Members | Enumeration Member | Value | | --- | --- | | `BAR` | `"bar"` | | `BOX_AND_WHISKER` | `"box_and_whisker"` | | `LINE` | `"line"` | | `PIE` | `"pie"` | | `SCATTER` | `"scatter"` | | `SUPERCHART` | `"superchart"` | | `UNKNOWN` | `"unknown"` | * * * ### [ScaleType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#scale-type) Ax scale types #### Enumeration Members | Enumeration Member | Value | | --- | --- | | `ASINH` | `"asinh"` | | `CATEGORICAL` | `"categorical"` | | `DATETIME` | `"datetime"` | | `FUNCTION` | `"function"` | | `FUNCTIONLOG` | `"functionlog"` | | `LINEAR` | `"linear"` | | `LOG` | `"log"` | | `LOGIT` | `"logit"` | | `SYMLOG` | `"symlog"` | [Type Aliases](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#type-aliases) ------------------------------------------------------------------------------------------------------ ### [BarChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#bar-chart) type BarChart: Chart2D & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `BarData`\[\] | | `type` | `ChartType.BAR` | * * * ### [BarData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#bar-data) type BarData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `group` | `string` | | `label` | `string` | | `value` | `string` | * * * ### [BoxAndWhiskerChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#box-and-whisker-chart) type BoxAndWhiskerChart: Chart2D & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `BoxAndWhiskerData`\[\] | | `type` | `ChartType.BOX_AND_WHISKER` | * * * ### [BoxAndWhiskerData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#box-and-whisker-data) type BoxAndWhiskerData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `first_quartile` | `number` | | `label` | `string` | | `max` | `number` | | `median` | `number` | | `min` | `number` | | `outliers` | `number`\[\] | | `third_quartile` | `number` | * * * ### [Chart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#chart) type Chart: object; CopyCopied! Represents a chart. #### Type declaration | Name | Type | | --- | --- | | `elements` | `any`\[\] | | `title` | `string` | | `type` | `ChartType` | * * * ### [ChartTypes](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#chart-types) type ChartTypes: | LineChart | ScatterChart | BarChart | PieChart | BoxAndWhiskerChart | SuperChart; CopyCopied! * * * ### [LineChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#line-chart) type LineChart: PointChart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `type` | `ChartType.LINE` | * * * ### [PieChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#pie-chart) type PieChart: Chart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `PieData`\[\] | | `type` | `ChartType.PIE` | * * * ### [PieData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#pie-data) type PieData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `angle` | `number` | | `label` | `string` | | `radius` | `number` | * * * ### [PointData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#point-data) type PointData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `label` | `string` | | `points` | \[`number` \| `string`, `number` \| `string`\]\[\] | * * * ### [ScatterChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#scatter-chart) type ScatterChart: PointChart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `type` | `ChartType.SCATTER` | * * * ### [SuperChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#super-chart) type SuperChart: Chart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `Chart`\[\] | | `type` | `ChartType.SUPERCHART` | [Functions](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#functions) ------------------------------------------------------------------------------------------------ ### [deserializeChart()](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.5.0/charts#deserialize-chart) function deserializeChart(data: any): Chart CopyCopied! #### Parameters | Parameter | Type | | --- | --- | | `data` | `any` | #### Returns `Chart` --- # Documentation - E2B [Skip to main content](https://e2b.dev/docs/sandbox/metadata#content-area) [E2B Docs home page![light logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/light.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=b46f99ca671d766158b23ca43e300829)![dark logo](https://mintcdn.com/e2b/pduSmNOyhS35xRWk/logo/dark.svg?fit=max&auto=format&n=pduSmNOyhS35xRWk&q=85&s=fe02861017e93b6ad520ee0427c429ed)](https://e2b.dev/) Search... ⌘K Search... Navigation Sandbox Sandbox metadata Metadata is a way to attach arbitrary key-value pairs for a sandbox. This is useful in various scenarios, for example: * Associate a sandbox with a user session. * Store custom user data for a sandbox like API keys. * Associate a sandbox with a user ID and [connect to it later](https://e2b.dev/docs/sandbox/connect) . You specify metadata when creating a sandbox and can access it later through listing running sandboxes with `Sandbox.list()` method. JavaScript & TypeScript Python Copy Ask AI import { Sandbox } from '@e2b/code-interpreter' // Create sandbox with metadata. const sandbox = await Sandbox.create({ metadata: { userId: '123', }, }) // List running sandboxes and access metadata. const runningSandboxes = await Sandbox.list() // Will print: // { // 'userId': '123', // } console.log(runningSandboxes[0].metadata) [​](https://e2b.dev/docs/sandbox/metadata#filtering-sandboxes-by-metadata) Filtering sandboxes by metadata ------------------------------------------------------------------------------------------------------------- You can also filter sandboxes by metadata, you can find more about it [here](https://e2b.dev/docs/sandbox/list#filtering-sandboxes) . Was this page helpful? YesNo [Suggest edits](https://github.com/e2b-dev/docs/edit/main/docs/sandbox/metadata.mdx) [Raise issue](https://github.com/e2b-dev/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/docs/sandbox/metadata) [Previous](https://e2b.dev/docs/sandbox/metrics) [Environment variables\ \ Next](https://e2b.dev/docs/sandbox/environment-variables) ⌘I On this page * [Filtering sandboxes by metadata](https://e2b.dev/docs/sandbox/metadata#filtering-sandboxes-by-metadata) --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [ChartType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#chart-type) Chart types #### Enumeration Members | Enumeration Member | Value | | --- | --- | | `BAR` | `"bar"` | | `BOX_AND_WHISKER` | `"box_and_whisker"` | | `LINE` | `"line"` | | `PIE` | `"pie"` | | `SCATTER` | `"scatter"` | | `SUPERCHART` | `"superchart"` | | `UNKNOWN` | `"unknown"` | * * * ### [ScaleType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#scale-type) Ax scale types #### Enumeration Members | Enumeration Member | Value | | --- | --- | | `ASINH` | `"asinh"` | | `CATEGORICAL` | `"categorical"` | | `DATETIME` | `"datetime"` | | `FUNCTION` | `"function"` | | `FUNCTIONLOG` | `"functionlog"` | | `LINEAR` | `"linear"` | | `LOG` | `"log"` | | `LOGIT` | `"logit"` | | `SYMLOG` | `"symlog"` | [Type Aliases](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#type-aliases) ------------------------------------------------------------------------------------------------------ ### [BarChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#bar-chart) type BarChart: Chart2D & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `BarData`\[\] | | `type` | `ChartType.BAR` | * * * ### [BarData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#bar-data) type BarData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `group` | `string` | | `label` | `string` | | `value` | `string` | * * * ### [BoxAndWhiskerChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#box-and-whisker-chart) type BoxAndWhiskerChart: Chart2D & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `BoxAndWhiskerData`\[\] | | `type` | `ChartType.BOX_AND_WHISKER` | * * * ### [BoxAndWhiskerData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#box-and-whisker-data) type BoxAndWhiskerData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `first_quartile` | `number` | | `label` | `string` | | `max` | `number` | | `median` | `number` | | `min` | `number` | | `outliers` | `number`\[\] | | `third_quartile` | `number` | * * * ### [Chart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#chart) type Chart: object; CopyCopied! Represents a chart. #### Type declaration | Name | Type | | --- | --- | | `elements` | `any`\[\] | | `title` | `string` | | `type` | `ChartType` | * * * ### [ChartTypes](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#chart-types) type ChartTypes: | LineChart | ScatterChart | BarChart | PieChart | BoxAndWhiskerChart | SuperChart; CopyCopied! * * * ### [LineChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#line-chart) type LineChart: PointChart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `type` | `ChartType.LINE` | * * * ### [PieChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#pie-chart) type PieChart: Chart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `PieData`\[\] | | `type` | `ChartType.PIE` | * * * ### [PieData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#pie-data) type PieData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `angle` | `number` | | `label` | `string` | | `radius` | `number` | * * * ### [PointData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#point-data) type PointData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `label` | `string` | | `points` | \[`number` \| `string`, `number` \| `string`\]\[\] | * * * ### [ScatterChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#scatter-chart) type ScatterChart: PointChart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `type` | `ChartType.SCATTER` | * * * ### [SuperChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#super-chart) type SuperChart: Chart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `Chart`\[\] | | `type` | `ChartType.SUPERCHART` | [Functions](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#functions) ------------------------------------------------------------------------------------------------ ### [deserializeChart()](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/charts#deserialize-chart) function deserializeChart(data: any): Chart CopyCopied! #### Parameters | Parameter | Type | | --- | --- | | `data` | `any` | #### Returns `Chart` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [ChartType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#chart-type) Chart types #### Enumeration Members | Enumeration Member | Value | | --- | --- | | `BAR` | `"bar"` | | `BOX_AND_WHISKER` | `"box_and_whisker"` | | `LINE` | `"line"` | | `PIE` | `"pie"` | | `SCATTER` | `"scatter"` | | `SUPERCHART` | `"superchart"` | | `UNKNOWN` | `"unknown"` | * * * ### [ScaleType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#scale-type) Ax scale types #### Enumeration Members | Enumeration Member | Value | | --- | --- | | `ASINH` | `"asinh"` | | `CATEGORICAL` | `"categorical"` | | `DATETIME` | `"datetime"` | | `FUNCTION` | `"function"` | | `FUNCTIONLOG` | `"functionlog"` | | `LINEAR` | `"linear"` | | `LOG` | `"log"` | | `LOGIT` | `"logit"` | | `SYMLOG` | `"symlog"` | [Type Aliases](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#type-aliases) ------------------------------------------------------------------------------------------------------ ### [BarChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#bar-chart) type BarChart: Chart2D & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `BarData`\[\] | | `type` | `ChartType.BAR` | * * * ### [BarData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#bar-data) type BarData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `group` | `string` | | `label` | `string` | | `value` | `string` | * * * ### [BoxAndWhiskerChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#box-and-whisker-chart) type BoxAndWhiskerChart: Chart2D & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `BoxAndWhiskerData`\[\] | | `type` | `ChartType.BOX_AND_WHISKER` | * * * ### [BoxAndWhiskerData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#box-and-whisker-data) type BoxAndWhiskerData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `first_quartile` | `number` | | `label` | `string` | | `max` | `number` | | `median` | `number` | | `min` | `number` | | `outliers` | `number`\[\] | | `third_quartile` | `number` | * * * ### [Chart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#chart) type Chart: object; CopyCopied! Represents a chart. #### Type declaration | Name | Type | | --- | --- | | `elements` | `any`\[\] | | `title` | `string` | | `type` | `ChartType` | * * * ### [ChartTypes](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#chart-types) type ChartTypes: | LineChart | ScatterChart | BarChart | PieChart | BoxAndWhiskerChart | SuperChart; CopyCopied! * * * ### [LineChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#line-chart) type LineChart: PointChart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `type` | `ChartType.LINE` | * * * ### [PieChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#pie-chart) type PieChart: Chart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `PieData`\[\] | | `type` | `ChartType.PIE` | * * * ### [PieData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#pie-data) type PieData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `angle` | `number` | | `label` | `string` | | `radius` | `number` | * * * ### [PointData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#point-data) type PointData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `label` | `string` | | `points` | \[`number` \| `string`, `number` \| `string`\]\[\] | * * * ### [ScatterChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#scatter-chart) type ScatterChart: PointChart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `type` | `ChartType.SCATTER` | * * * ### [SuperChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#super-chart) type SuperChart: Chart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `Chart`\[\] | | `type` | `ChartType.SUPERCHART` | [Functions](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#functions) ------------------------------------------------------------------------------------------------ ### [deserializeChart()](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.0/charts#deserialize-chart) function deserializeChart(data: any): Chart CopyCopied! #### Parameters | Parameter | Type | | --- | --- | | `data` | `any` | #### Returns `Chart` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [ChartType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#chart-type) Chart types #### Enumeration Members | Enumeration Member | Value | | --- | --- | | `BAR` | `"bar"` | | `BOX_AND_WHISKER` | `"box_and_whisker"` | | `LINE` | `"line"` | | `PIE` | `"pie"` | | `SCATTER` | `"scatter"` | | `SUPERCHART` | `"superchart"` | | `UNKNOWN` | `"unknown"` | * * * ### [ScaleType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#scale-type) Ax scale types #### Enumeration Members | Enumeration Member | Value | | --- | --- | | `ASINH` | `"asinh"` | | `CATEGORICAL` | `"categorical"` | | `DATETIME` | `"datetime"` | | `FUNCTION` | `"function"` | | `FUNCTIONLOG` | `"functionlog"` | | `LINEAR` | `"linear"` | | `LOG` | `"log"` | | `LOGIT` | `"logit"` | | `SYMLOG` | `"symlog"` | [Type Aliases](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#type-aliases) ------------------------------------------------------------------------------------------------------ ### [BarChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#bar-chart) type BarChart: Chart2D & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `BarData`\[\] | | `type` | `ChartType.BAR` | * * * ### [BarData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#bar-data) type BarData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `group` | `string` | | `label` | `string` | | `value` | `string` | * * * ### [BoxAndWhiskerChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#box-and-whisker-chart) type BoxAndWhiskerChart: Chart2D & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `BoxAndWhiskerData`\[\] | | `type` | `ChartType.BOX_AND_WHISKER` | * * * ### [BoxAndWhiskerData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#box-and-whisker-data) type BoxAndWhiskerData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `first_quartile` | `number` | | `label` | `string` | | `max` | `number` | | `median` | `number` | | `min` | `number` | | `outliers` | `number`\[\] | | `third_quartile` | `number` | * * * ### [Chart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#chart) type Chart: object; CopyCopied! Represents a chart. #### Type declaration | Name | Type | | --- | --- | | `elements` | `any`\[\] | | `title` | `string` | | `type` | `ChartType` | * * * ### [ChartTypes](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#chart-types) type ChartTypes: | LineChart | ScatterChart | BarChart | PieChart | BoxAndWhiskerChart | SuperChart; CopyCopied! * * * ### [LineChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#line-chart) type LineChart: PointChart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `type` | `ChartType.LINE` | * * * ### [PieChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#pie-chart) type PieChart: Chart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `PieData`\[\] | | `type` | `ChartType.PIE` | * * * ### [PieData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#pie-data) type PieData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `angle` | `number` | | `label` | `string` | | `radius` | `number` | * * * ### [PointData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#point-data) type PointData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `label` | `string` | | `points` | \[`number` \| `string`, `number` \| `string`\]\[\] | * * * ### [ScatterChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#scatter-chart) type ScatterChart: PointChart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `type` | `ChartType.SCATTER` | * * * ### [SuperChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#super-chart) type SuperChart: Chart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `Chart`\[\] | | `type` | `ChartType.SUPERCHART` | [Functions](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#functions) ------------------------------------------------------------------------------------------------ ### [deserializeChart()](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/charts#deserialize-chart) function deserializeChart(data: any): Chart CopyCopied! #### Parameters | Parameter | Type | | --- | --- | | `data` | `any` | #### Returns `Chart` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [ChartType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#chart-type) Chart types #### Enumeration Members | Enumeration Member | Value | | --- | --- | | `BAR` | `"bar"` | | `BOX_AND_WHISKER` | `"box_and_whisker"` | | `LINE` | `"line"` | | `PIE` | `"pie"` | | `SCATTER` | `"scatter"` | | `SUPERCHART` | `"superchart"` | | `UNKNOWN` | `"unknown"` | * * * ### [ScaleType](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#scale-type) Ax scale types #### Enumeration Members | Enumeration Member | Value | | --- | --- | | `ASINH` | `"asinh"` | | `CATEGORICAL` | `"categorical"` | | `DATETIME` | `"datetime"` | | `FUNCTION` | `"function"` | | `FUNCTIONLOG` | `"functionlog"` | | `LINEAR` | `"linear"` | | `LOG` | `"log"` | | `LOGIT` | `"logit"` | | `SYMLOG` | `"symlog"` | [Type Aliases](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#type-aliases) ------------------------------------------------------------------------------------------------------ ### [BarChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#bar-chart) type BarChart: Chart2D & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `BarData`\[\] | | `type` | `ChartType.BAR` | * * * ### [BarData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#bar-data) type BarData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `group` | `string` | | `label` | `string` | | `value` | `string` | * * * ### [BoxAndWhiskerChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#box-and-whisker-chart) type BoxAndWhiskerChart: Chart2D & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `BoxAndWhiskerData`\[\] | | `type` | `ChartType.BOX_AND_WHISKER` | * * * ### [BoxAndWhiskerData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#box-and-whisker-data) type BoxAndWhiskerData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `first_quartile` | `number` | | `label` | `string` | | `max` | `number` | | `median` | `number` | | `min` | `number` | | `outliers` | `number`\[\] | | `third_quartile` | `number` | * * * ### [Chart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#chart) type Chart: object; CopyCopied! Represents a chart. #### Type declaration | Name | Type | | --- | --- | | `elements` | `any`\[\] | | `title` | `string` | | `type` | `ChartType` | * * * ### [ChartTypes](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#chart-types) type ChartTypes: | LineChart | ScatterChart | BarChart | PieChart | BoxAndWhiskerChart | SuperChart; CopyCopied! * * * ### [LineChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#line-chart) type LineChart: PointChart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `type` | `ChartType.LINE` | * * * ### [PieChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#pie-chart) type PieChart: Chart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `PieData`\[\] | | `type` | `ChartType.PIE` | * * * ### [PieData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#pie-data) type PieData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `angle` | `number` | | `label` | `string` | | `radius` | `number` | * * * ### [PointData](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#point-data) type PointData: object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `label` | `string` | | `points` | \[`number` \| `string`, `number` \| `string`\]\[\] | * * * ### [ScatterChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#scatter-chart) type ScatterChart: PointChart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `type` | `ChartType.SCATTER` | * * * ### [SuperChart](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#super-chart) type SuperChart: Chart & object; CopyCopied! #### Type declaration | Name | Type | | --- | --- | | `elements` | `Chart`\[\] | | `type` | `ChartType.SUPERCHART` | [Functions](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#functions) ------------------------------------------------------------------------------------------------ ### [deserializeChart()](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.2.0/charts#deserialize-chart) function deserializeChart(data: any): Chart CopyCopied! #### Parameters | Parameter | Type | | --- | --- | | `data` | `any` | #### Returns `Chart` --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [Sandbox](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#sandbox) E2B cloud sandbox is a secure and isolated cloud environment. The sandbox allows you to: * Access Linux OS * Create, list, and delete files and directories * Run commands * Run isolated code * Access the internet Check docs here. Use Sandbox.create to create a new sandbox. #### Example import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() CopyCopied! #### Methods ### [createCodeContext()](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#create-code-context) createCodeContext(opts?: CreateCodeContextOpts): Promise CopyCopied! Creates a new context to run code in. ###### Parameters | Parameter | Type | Description | | --- | --- | --- | | `opts`? | `CreateCodeContextOpts` | options for creating the context. | ###### Returns `Promise`<`Context`\> context object. ### [runCode()](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#run-code) ###### runCode(code, opts) runCode(code: string, opts?: RunCodeOpts & object): Promise CopyCopied! Run the code as Python. Specify the `language` or `context` option to run the code as a different language or in a different `Context`. You can reference previously defined variables, imports, and functions in the code. ###### Parameters | Parameter | Type | Description | | --- | --- | --- | | `code` | `string` | code to execute. | | `opts`? | `RunCodeOpts` & `object` | options for executing the code. | ###### Returns `Promise`<`Execution`\> `Execution` result object. ###### runCode(code, opts) runCode(code: string, opts?: RunCodeOpts & object): Promise CopyCopied! Run the code for the specified language. Specify the `language` or `context` option to run the code as a different language or in a different `Context`. If no language is specified, Python is used. You can reference previously defined variables, imports, and functions in the code. ###### Parameters | Parameter | Type | Description | | --- | --- | --- | | `code` | `string` | code to execute. | | `opts`? | `RunCodeOpts` & `object` | options for executing the code. | ###### Returns `Promise`<`Execution`\> `Execution` result object. ###### runCode(code, opts) runCode(code: string, opts?: RunCodeOpts & object): Promise CopyCopied! Runs the code in the specified context, if not specified, the default context is used. Specify the `language` or `context` option to run the code as a different language or in a different `Context`. You can reference previously defined variables, imports, and functions in the code. ###### Parameters | Parameter | Type | Description | | --- | --- | --- | | `code` | `string` | code to execute. | | `opts`? | `RunCodeOpts` & `object` | options for executing the code | ###### Returns `Promise`<`Execution`\> `Execution` result object [Interfaces](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#interfaces) --------------------------------------------------------------------------------------------------- ### [CreateCodeContextOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#create-code-context-opts) Options for creating a code context. #### Properties ### [cwd?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#cwd) optional cwd: string; CopyCopied! Working directory for the context. ###### Default /home/user CopyCopied! ### [language?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#language) optional language: string; CopyCopied! Language for the context. ###### Default python CopyCopied! ### [requestTimeoutMs?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#request-timeout-ms) optional requestTimeoutMs: number; CopyCopied! Timeout for the request in **milliseconds**. ###### Default 30_000 // 30 seconds CopyCopied! * * * ### [RunCodeOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#run-code-opts) Options for running code. #### Properties ### [envs?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#envs) optional envs: Record; CopyCopied! Custom environment variables for code execution. ###### Default {} CopyCopied! ### [onError()?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#on-error) optional onError: (error: ExecutionError) => any; CopyCopied! Callback for handling the `ExecutionError` object. ###### Parameters | Parameter | Type | | --- | --- | | `error` | `ExecutionError` | ###### Returns `any` ### [onResult()?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#on-result) optional onResult: (data: Result) => any; CopyCopied! Callback for handling the final execution result. ###### Parameters | Parameter | Type | | --- | --- | | `data` | `Result` | ###### Returns `any` ### [onStderr()?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#on-stderr) optional onStderr: (output: OutputMessage) => any; CopyCopied! Callback for handling stderr messages. ###### Parameters | Parameter | Type | | --- | --- | | `output` | `OutputMessage` | ###### Returns `any` ### [onStdout()?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#on-stdout) optional onStdout: (output: OutputMessage) => any; CopyCopied! Callback for handling stdout messages. ###### Parameters | Parameter | Type | | --- | --- | | `output` | `OutputMessage` | ###### Returns `any` ### [requestTimeoutMs?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#request-timeout-ms-2) optional requestTimeoutMs: number; CopyCopied! Timeout for the request in **milliseconds**. ###### Default 30_000 // 30 seconds CopyCopied! ### [timeoutMs?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#timeout-ms) optional timeoutMs: number; CopyCopied! Timeout for the code execution in **milliseconds**. ###### Default 60_000 // 60 seconds CopyCopied! [Type Aliases](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#type-aliases) ------------------------------------------------------------------------------------------------------- ### [Context](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.0.4/sandbox#context) type Context: object; CopyCopied! Represents a context for code execution. #### Type declaration | Name | Type | Description | | --- | --- | --- | | `cwd` | `string` | The working directory of the context. | | `id` | `string` | The ID of the context. | | `language` | `string` | The language of the context. | --- # SDK Reference - E2B [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) [](https://e2b.dev/) [Documentation](https://e2b.dev/docs) ### [Sandbox](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#sandbox) E2B cloud sandbox is a secure and isolated cloud environment. The sandbox allows you to: * Access Linux OS * Create, list, and delete files and directories * Run commands * Run isolated code * Access the internet Check docs here. Use Sandbox.create to create a new sandbox. #### Example import { Sandbox } from '@e2b/code-interpreter' const sandbox = await Sandbox.create() CopyCopied! #### Methods ### [createCodeContext()](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#create-code-context) createCodeContext(opts?: CreateCodeContextOpts): Promise CopyCopied! Creates a new context to run code in. ###### Parameters | Parameter | Type | Description | | --- | --- | --- | | `opts`? | `CreateCodeContextOpts` | options for creating the context. | ###### Returns `Promise`<`Context`\> context object. ### [runCode()](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#run-code) ###### runCode(code, opts) runCode(code: string, opts?: RunCodeOpts & object): Promise CopyCopied! Run the code as Python. Specify the `language` or `context` option to run the code as a different language or in a different `Context`. You can reference previously defined variables, imports, and functions in the code. ###### Parameters | Parameter | Type | Description | | --- | --- | --- | | `code` | `string` | code to execute. | | `opts`? | `RunCodeOpts` & `object` | options for executing the code. | ###### Returns `Promise`<`Execution`\> `Execution` result object. ###### runCode(code, opts) runCode(code: string, opts?: RunCodeOpts & object): Promise CopyCopied! Run the code for the specified language. Specify the `language` or `context` option to run the code as a different language or in a different `Context`. If no language is specified, Python is used. You can reference previously defined variables, imports, and functions in the code. ###### Parameters | Parameter | Type | Description | | --- | --- | --- | | `code` | `string` | code to execute. | | `opts`? | `RunCodeOpts` & `object` | options for executing the code. | ###### Returns `Promise`<`Execution`\> `Execution` result object. ###### runCode(code, opts) runCode(code: string, opts?: RunCodeOpts & object): Promise CopyCopied! Runs the code in the specified context, if not specified, the default context is used. Specify the `language` or `context` option to run the code as a different language or in a different `Context`. You can reference previously defined variables, imports, and functions in the code. ###### Parameters | Parameter | Type | Description | | --- | --- | --- | | `code` | `string` | code to execute. | | `opts`? | `RunCodeOpts` & `object` | options for executing the code | ###### Returns `Promise`<`Execution`\> `Execution` result object [Interfaces](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#interfaces) --------------------------------------------------------------------------------------------------- ### [CreateCodeContextOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#create-code-context-opts) Options for creating a code context. #### Properties ### [cwd?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#cwd) optional cwd: string; CopyCopied! Working directory for the context. ###### Default /home/user CopyCopied! ### [language?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#language) optional language: string; CopyCopied! Language for the context. ###### Default python CopyCopied! ### [requestTimeoutMs?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#request-timeout-ms) optional requestTimeoutMs: number; CopyCopied! Timeout for the request in **milliseconds**. ###### Default 30_000 // 30 seconds CopyCopied! * * * ### [RunCodeOpts](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#run-code-opts) Options for running code. #### Properties ### [envs?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#envs) optional envs: Record; CopyCopied! Custom environment variables for code execution. ###### Default {} CopyCopied! ### [onError()?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#on-error) optional onError: (error: ExecutionError) => any; CopyCopied! Callback for handling the `ExecutionError` object. ###### Parameters | Parameter | Type | | --- | --- | | `error` | `ExecutionError` | ###### Returns `any` ### [onResult()?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#on-result) optional onResult: (data: Result) => any; CopyCopied! Callback for handling the final execution result. ###### Parameters | Parameter | Type | | --- | --- | | `data` | `Result` | ###### Returns `any` ### [onStderr()?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#on-stderr) optional onStderr: (output: OutputMessage) => any; CopyCopied! Callback for handling stderr messages. ###### Parameters | Parameter | Type | | --- | --- | | `output` | `OutputMessage` | ###### Returns `any` ### [onStdout()?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#on-stdout) optional onStdout: (output: OutputMessage) => any; CopyCopied! Callback for handling stdout messages. ###### Parameters | Parameter | Type | | --- | --- | | `output` | `OutputMessage` | ###### Returns `any` ### [requestTimeoutMs?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#request-timeout-ms-2) optional requestTimeoutMs: number; CopyCopied! Timeout for the request in **milliseconds**. ###### Default 30_000 // 30 seconds CopyCopied! ### [timeoutMs?](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#timeout-ms) optional timeoutMs: number; CopyCopied! Timeout for the code execution in **milliseconds**. ###### Default 60_000 // 60 seconds CopyCopied! [Type Aliases](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#type-aliases) ------------------------------------------------------------------------------------------------------- ### [Context](https://e2b.dev/docs/sdk-reference/code-interpreter-js-sdk/v1.1.1/sandbox#context) type Context: object; CopyCopied! Represents a context for code execution. #### Type declaration | Name | Type | Description | | --- | --- | --- | | `cwd` | `string` | The working directory of the context. | | `id` | `string` | The ID of the context. | | `language` | `string` | The language of the context. | ---