Installation

Updated at:

The E2B command-line interface (CLI) lets you create, view, connect to, and terminate FC Agent Sandbox instances. FC Agent Sandbox keeps your existing E2B CLI sandbox commands and templates working, and extends some template management capabilities.

Install the CLI

On macOS, install the CLI with Homebrew:

brew install e2b

Alternatively, install it with npm:

npm i -g @e2b/cli@2.20.0

After installation, verify the version:

e2b --version

Configure connection parameters

The E2B CLI uses E2B_API_KEY for authentication. When you connect to FC Agent Sandbox, you also need to configure the API URL and domain. For information about how to create and manage an API key, see Create an API Key.

export E2B_API_KEY="<your-api-key>"
export E2B_API_URL="https://api.cn-beijing.e2b.fc.aliyuncs.com"
export E2B_DOMAIN="cn-beijing.e2b.fc.aliyuncs.com"

E2B_ACCESS_TOKEN is a deprecated E2B authentication variable. New CLI versions should use E2B_API_KEY. Do not rely on E2B_ACCESS_TOKEN for new integrations.

Check the configuration

After you complete the configuration, list sandboxes to verify that the CLI can access FC Agent Sandbox:

e2b sandbox list

If authentication fails, check the following:

  • The API key was created as described in Create an API Key.

  • The API key is enabled and has not expired.

  • E2B_API_URL is https://api.cn-beijing.e2b.fc.aliyuncs.com.

  • E2B_DOMAIN is cn-beijing.e2b.fc.aliyuncs.com.

  • The E2B CLI version supports E2B_API_KEY authentication.

  • The current account has the permissions required for Function Compute operations.