Skip to main content
You are currently viewing documentation for version 2.21.0 of the E2B CLI.View the latest version of this page.

e2b template

manage sandbox templates

Usage

e2b template create

build Dockerfile as a Sandbox template. This command reads a Dockerfile and builds it directly.

Usage

Options

  • -p, --path <path>: change root directory where command is executed to <path> directory
  • -d, --dockerfile <file>: specify path to Dockerfile. By default E2B tries to find e2b.Dockerfile or Dockerfile in root directory.
  • -c, --cmd <start-command>: specify command that will be executed when the sandbox is started.
  • --ready-cmd <ready-command>: specify command that will need to exit 0 for the template to be ready.
  • --cpu-count <cpu-count>: specify the number of CPUs that will be used to run the sandbox. The default value is 2.
  • --memory-mb <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 1024.
  • --min-free-disk-mb <min-free-disk-mb>: requested minimum free space after build steps, in MiB. Omit for the team default or use 0 for no minimum growth. Growth is best effort and never shrinks the filesystem.
  • --no-cache: skip cache when building the template.

e2b template list

list sandbox templates

Usage

Options

  • -t, --project <project-id>: specify the project ID that the operation will be associated with. You can find project ID in the project settings in the E2B dashboard (https://e2b.dev/dashboard?tab=general).
  • --team <project-id>: [deprecated] use --project instead
  • -f, --format <format>: output format, eg. json, pretty

e2b template init

initialize a new sandbox template using the SDK

Usage

Options

  • -p, --path <path>: change root directory where command is executed to <path> directory
  • -n, --name <name>: template name
  • -l, --language <language>: target language: typescript, python-sync, python-async

e2b template delete

delete sandbox template

Usage

Options

  • -s, --select: select sandbox template from interactive list
  • -t, --project <project-id>: specify the project ID that the operation will be associated with. You can find project ID in the project settings in the E2B dashboard (https://e2b.dev/dashboard?tab=general).
  • --team <project-id>: [deprecated] use --project instead
  • --config <e2b-toml>: [deprecated] e2b.toml is no longer read here
  • -y, --yes: skip manual delete confirmation

e2b template publish

publish sandbox template

Usage

Options

  • -s, --select: select sandbox template from interactive list
  • -t, --project <project-id>: specify the project ID that the operation will be associated with. You can find project ID in the project settings in the E2B dashboard (https://e2b.dev/dashboard?tab=general).
  • --team <project-id>: [deprecated] use --project instead
  • --config <e2b-toml>: [deprecated] e2b.toml is no longer read here
  • -y, --yes: skip manual publish confirmation

e2b template unpublish

unpublish sandbox template

Usage

Options

  • -s, --select: select sandbox template from interactive list
  • -t, --project <project-id>: specify the project ID that the operation will be associated with. You can find project ID in the project settings in the E2B dashboard (https://e2b.dev/dashboard?tab=general).
  • --team <project-id>: [deprecated] use --project instead
  • --config <e2b-toml>: [deprecated] e2b.toml is no longer read here
  • -y, --yes: skip manual unpublish confirmation

e2b template migrate

migrate e2b.Dockerfile and e2b.toml to new Template SDK format

Usage

Options

  • -d, --dockerfile <file>: specify path to Dockerfile. Defaults to e2b.Dockerfile
  • --config <e2b-toml>: specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory. We recommend using the new build system (https://e2b.dev/docs/template/defining-template) that does not use config files.
  • -n, --name <name>: override the template name used in the generated files. Defaults to the template name or ID from the config file.
  • -c, --cmd <start-command>: override the command that will be executed when the sandbox is started.
  • --ready-cmd <ready-command>: override the command that will need to exit 0 for the template to be ready.
  • --cpu-count <cpu-count>: override the number of CPUs that will be used to run the sandbox.
  • --memory-mb <memory-mb>: override the amount of memory in megabytes that will be used to run the sandbox. Must be an even number.
  • -l, --language <language>: specify target language: typescript, python-sync, python-async
  • -p, --path <path>: change root directory where command is executed to <path> directory