Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
[skip ci] Release new versions
github-actions[bot]65257df48e2a
diff --git a/.changeset/soft-rings-clean.md b/.changeset/soft-rings-clean.mddeleted file mode 100644index 2e155633f..000000000--- a/.changeset/soft-rings-clean.md+++ /dev/null@@ -1,5 +0,0 @@-----'@e2b/cli': patch------Fix link in docsdiff --git a/apps/web/src/app/(docs)/docs/sdk-reference/cli/v1.0.6/auth/page.mdx b/apps/web/src/app/(docs)/docs/sdk-reference/cli/v1.0.6/auth/page.mdxnew file mode 100644index 000000000..2c82afa69--- /dev/null+++ b/apps/web/src/app/(docs)/docs/sdk-reference/cli/v1.0.6/auth/page.mdx@@ -0,0 +1,58 @@+## e2b auth+++authentication commands++### Usage++```bash+e2b auth [options] [command]+```+## e2b auth login+++log in to CLI++### Usage++```bash+e2b auth login [options]+```+++## e2b auth logout+++log out of CLI++### Usage++```bash+e2b auth logout [options]+```+++## e2b auth info+++get information about the current user++### Usage++```bash+e2b auth info [options]+```+++## e2b auth configure+++configure user++### Usage++```bash+e2b auth configure [options]+```++diff --git a/apps/web/src/app/(docs)/docs/sdk-reference/cli/v1.0.6/sandbox/page.mdx b/apps/web/src/app/(docs)/docs/sdk-reference/cli/v1.0.6/sandbox/page.mdxnew file mode 100644index 000000000..53c9a5b35--- /dev/null+++ b/apps/web/src/app/(docs)/docs/sdk-reference/cli/v1.0.6/sandbox/page.mdx@@ -0,0 +1,89 @@+## e2b sandbox+++work with sandboxes++### Usage++```bash+e2b sandbox [options] [command]+```+## e2b sandbox connect+++connect terminal to already running sandbox++### Usage++```bash+e2b sandbox connect [options] <sandboxID>+```+++## e2b sandbox list+++list all running sandboxes++### Usage++```bash+e2b sandbox list [options]+```+++## e2b sandbox kill+++kill sandbox++### Usage++```bash+e2b sandbox kill [options] [sandboxID]+```++### Options+++ - `-a, --all: kill all running sandboxes `+++## e2b sandbox spawn+++spawn sandbox and connect terminal to it++### Usage++```bash+e2b sandbox spawn [options] [template]+```++### Options+++ - `-p, --path <path>: change root directory where command is executed to <path> directory `+ - `--config <e2b-toml>: specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory. `+++## e2b sandbox logs+++show logs for sandbox++### Usage++```bash+e2b sandbox logs [options] <sandboxID>+```++### Options+++ - `--level <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 <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. `++diff --git a/apps/web/src/app/(docs)/docs/sdk-reference/cli/v1.0.6/template/page.mdx b/apps/web/src/app/(docs)/docs/sdk-reference/cli/v1.0.6/template/page.mdxnew file mode 100644index 000000000..96e83c629--- /dev/null+++ b/apps/web/src/app/(docs)/docs/sdk-reference/cli/v1.0.6/template/page.mdx@@ -0,0 +1,90 @@+## e2b template+++manage sandbox templates++### Usage++```bash+e2b template [options] [command]+```+## 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++```bash+e2b template build [options] [template]+```++### 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. `+ - `-n, --name <template-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 <start-command>: specify command that will be executed when the sandbox is started. `+ - `-t, --team <team-id>: specify the team ID that the 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 <e2b-toml>: specify path to the E2B config toml. By default E2B tries to find ./e2b.toml in root directory. `+ - `--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 512. `+ - `--build-arg <args...>: specify additional build arguments for the build command. The format should be <varname>=<value>. `+++## e2b template list+++list sandbox templates++### Usage++```bash+e2b template list [options]+```++### Options+++ - `-t, --team <team-id>: specify the team ID that the 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+++create basic E2B Dockerfile (./e2b.Dockerfile) in root directory. You can then run e2b template build to build sandbox template from this Dockerfile++### Usage++```bash+e2b template init [options]+```++### Options+++ - `-p, --path <path>: change root directory where command is executed to <path> directory `+++## e2b template delete+++delete sandbox template and e2b.toml config++### Usage++```bash+e2b template delete [options] [template]+```++### Options+++ - `-p, --path <path>: change root directory where command is executed to <path> directory `+ - `--config <e2b-toml>: 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 <team-id>: specify the team ID that the 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 `++diff --git a/apps/web/src/app/(docs)/docs/sdk-reference/python-sdk/v1.0.4/sandbox_async/page.mdx b/apps/web/src/app/(docs)/docs/sdk-reference/python-sdk/v1.0.4/sandbox_async/page.mdxindex e0973fd00..6804bc08a 100644--- a/apps/web/src/app/(docs)/docs/sdk-reference/python-sdk/v1.0.4/sandbox_async/page.mdx+++ b/apps/web/src/app/(docs)/docs/sdk-reference/python-sdk/v1.0.4/sandbox_async/page.mdx@@ -1,24 +1,264 @@-## AsyncWatchHandle+++## AsyncSandbox```python-class AsyncWatchHandle()+class AsyncSandbox(SandboxSetup, SandboxApi)```-Handle for watching a directory in the sandbox filesystem.+E2B cloud sandbox is a secure and isolated cloud environment.-Use `.stop()` to stop watching the directory.+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](https://e2b.dev/docs).+Use the `AsyncSandbox.create()` to create a new sandbox.-### stop+**Example**:```python-async def stop()+from e2b import AsyncSandbox++sandbox = await AsyncSandbox.create()```-Stop watching the directory.++### files++```python+@property+def files() -> Filesystem+```++Module for interacting with the sandbox filesystem.+++### commands++```python+@property+def commands() -> Commands+```++Module for running commands in the sandbox.+++### pty++```python+@property+def pty() -> Pty+```++Module for interacting with the sandbox pseudo-terminal.+++### sandbox\_id++```python+@property+def sandbox_id() -> str+```++Unique identifier of the sandbox.+++### \_\_init\_\_++```python+def __init__(**opts: Unpack[AsyncSandboxOpts])+```++Use `AsyncSandbox.create()` to create a new sandbox instead.+++### is\_running++```python+async def is_running(request_timeout: Optional[float] = None) -> bool+```++Check if the sandbox is running.++**Arguments**:++- `request_timeout`: Timeout for the request in **seconds**++**Returns**:++`True` if the sandbox is running, `False` otherwise+Example+```python+sandbox = await AsyncSandbox.create()+await sandbox.is_running() # Returns True++await sandbox.kill()+await sandbox.is_running() # Returns False+```+++### create++```python+@classmethod+async def create(cls,+ template: Optional[str] = None,+ timeout: Optional[int] = None,+ metadata: Optional[Dict[str, str]] = None,+ envs: Optional[Dict[str, str]] = None,+ api_key: Optional[str] = None,+ domain: Optional[str] = None,+ debug: Optional[bool] = None,+ request_timeout: Optional[float] = None)+```++Create a new sandbox.++By default, the sandbox is created from the default `base` sandbox template.++**Arguments**:++- `template`: Sandbox template name or ID+- `timeout`: Timeout for the sandbox in **seconds**, default to 300 seconds. Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.+- `metadata`: Custom metadata for the sandbox+- `envs`: Custom environment variables for the sandbox+- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable+- `request_timeout`: Timeout for the request in **seconds**++**Returns**:++sandbox instance for the new sandbox+Use this method instead of using the constructor to create a new sandbox.+++### connect++```python+@classmethod+async def connect(cls,+ sandbox_id: str,+ api_key: Optional[str] = None,+ domain: Optional[str] = None,+ debug: Optional[bool] = None)+```++Connect to an existing sandbox.++With sandbox ID you can connect to the same sandbox from different places or environments (serverless functions, etc).++**Arguments**:++- `sandbox_id`: Sandbox ID+- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable++**Returns**:++sandbox instance for the existing sandbox+@example+```python+sandbox = await AsyncSandbox.create()+sandbox_id = sandbox.sandbox_id++same_sandbox = await AsyncSandbox.connect(sandbox_id)+++### kill++```python+@overload+async def kill(request_timeout: Optional[float] = None) -> bool+```++Kill the sandbox.++**Arguments**:++- `request_timeout`: Timeout for the request in **seconds**++**Returns**:++`True` if the sandbox was killed, `False` if the sandbox was not found+++### kill++```python+@overload+@staticmethod+async def kill(sandbox_id: str,+ api_key: Optional[str] = None,+ domain: Optional[str] = None,+ debug: Optional[bool] = None,+ request_timeout: Optional[float] = None) -> bool+```++Kill the sandbox specified by sandbox ID.++**Arguments**:++- `sandbox_id`: Sandbox ID+- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable+- `request_timeout`: Timeout for the request in **seconds**++**Returns**:++`True` if the sandbox was killed, `False` if the sandbox was not found+++### set\_timeout++```python+@overload+async def set_timeout(timeout: int,+ request_timeout: Optional[float] = None) -> None+```++Set the timeout of the sandbox.++After the timeout expires the sandbox will be automatically killed.+This method can extend or reduce the sandbox timeout set when creating the sandbox or from the last call to `.set_timeout`.++Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.++**Arguments**:++- `timeout`: Timeout for the sandbox in **seconds**+- `request_timeout`: Timeout for the request in **seconds**+++### set\_timeout++```python+@overload+@staticmethod+async def set_timeout(sandbox_id: str,+ timeout: int,+ api_key: Optional[str] = None,+ domain: Optional[str] = None,+ debug: Optional[bool] = None,+ request_timeout: Optional[float] = None) -> None+```++Set the timeout of the specified sandbox.++After the timeout expires the sandbox will be automatically killed.+This method can extend or reduce the sandbox timeout set when creating the sandbox or from the last call to `.set_timeout`.++Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.++**Arguments**:++- `sandbox_id`: Sandbox ID+- `timeout`: Timeout for the sandbox in **seconds**+- `request_timeout`: Timeout for the request in **seconds**@@ -266,36 +506,24 @@ Watch directory for filesystem events.---## SandboxApi+## AsyncWatchHandle```python-class SandboxApi(SandboxApiBase)+class AsyncWatchHandle()```+Handle for watching a directory in the sandbox filesystem.-### list--```python-@classmethod-async def list(cls,- api_key: Optional[str] = None,- domain: Optional[str] = None,- debug: Optional[bool] = None,- request_timeout: Optional[float] = None) -> List[SandboxInfo]-```--List all running sandboxes.+Use `.stop()` to stop watching the directory.-**Arguments**:-- `api_key`: API key to use for authentication, defaults to `E2B_API_KEY` environment variable-- `request_timeout`: Timeout for the request in **seconds**+### stop-**Returns**:+```python+async def stop()+```-List of running sandboxes+Stop watching the directory.@@ -461,115 +689,6 @@ You can use `AsyncCommandHandle.wait()` to wait for the command to finish and ge-## AsyncCommandHandle--```python-class AsyncCommandHandle()-```--Command execution handle.--It provides methods for waiting for the command to finish, retrieving stdout/stderr, and killing the command.---### pid--```python-@property-def pid()-```--Command process ID.---### stdout--```python-@property-def stdout()-```--Command stdout output.---### stderr--```python-@property-def stderr()-```--Command stderr output.---### error--```python-@property-def error()-```--Command execution error message.---### exit\_code--```python-@property-def exit_code()-```--Command execution exit code.--`0` if the command finished successfully.--It is `None` if the command is still running.---### disconnect--```python-async def disconnect() -> None-```--Disconnects from the command.--The command is not killed, but SDK stops receiving events from the command.-You can reconnect to the command using `sandbox.commands.connect` method.---### wait--```python-async def wait() -> CommandResult-```--Wait for the command to finish and return the result.--If the command exits with a non-zero exit code, it throws a `CommandExitException`.--**Returns**:--`CommandResult` result of command execution---### kill--```python-async def kill() -> bool-```--Kills the command.--It uses `SIGKILL` signal to kill the command--**Returns**:--`True` if the command was killed successfully, `False` if the command was not found----## Pty```python@@ -665,260 +784,141 @@ Call this when the terminal window is resized and the number of columns and rows-## AsyncSandbox+## AsyncCommandHandle```python-class AsyncSandbox(SandboxSetup, SandboxApi)+class AsyncCommandHandle()```-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+Command execution handle.-Check docs [here](https://e2b.dev/docs).+It provides methods for waiting for the command to finish, retrieving stdout/stderr, and killing the command.-Use the `AsyncSandbox.create()` to create a new sandbox.-**Example**:+### pid```python-from e2b import AsyncSandbox--sandbox = await AsyncSandbox.create()+@property+def pid()```+Command process ID.-### files++### stdout```python@property-def files() -> Filesystem+def stdout()```-Module for interacting with the sandbox filesystem.+Command stdout output.-### commands+### stderr```python@property-def commands() -> Commands+def stderr()```-Module for running commands in the sandbox.+Command stderr output.-### pty+### error```python@property-def pty() -> Pty+def error()```-Module for interacting with the sandbox pseudo-terminal.+Command execution error message.-### sandbox\_id+### exit\_code```python@property-def sandbox_id() -> str+def exit_code()```-Unique identifier of the sandbox.---### \_\_init\_\_+Command execution exit code.-```python-def __init__(**opts: Unpack[AsyncSandboxOpts])-```+`0` if the command finished successfully.-Use `AsyncSandbox.create()` to create a new sandbox instead.+It is `None` if the command is still running.-### is\_running+### disconnect```python-async def is_running(request_timeout: Optional[float] = None) -> bool+async def disconnect() -> None```-Check if the sandbox is running.--**Arguments**:--- `request_timeout`: Timeout for the request in **seconds**--**Returns**:--`True` if the sandbox is running, `False` otherwise-Example-```python-sandbox = await AsyncSandbox.create()-await sandbox.is_running() # Returns True+Disconnects from the command.-await sandbox.kill()-await sandbox.is_running() # Returns False-```+The command is not killed, but SDK stops receiving events from the command.+You can reconnect to the command using `sandbox.commands.connect` method.-### create+### wait```python-@classmethod-async def create(cls,- template: Optional[str] = None,- timeout: Optional[int] = None,- metadata: Optional[Dict[str, str]] = None,- envs: Optional[Dict[str, str]] = None,- api_key: Optional[str] = None,- domain: Optional[str] = None,- debug: Optional[bool] = None,- request_timeout: Optional[float] = None)+async def wait() -> CommandResult```-Create a new sandbox.--By default, the sandbox is created from the default `base` sandbox template.--**Arguments**:+Wait for the command to finish and return the result.-- `template`: Sandbox template name or ID-- `timeout`: Timeout for the sandbox in **seconds**, default to 300 seconds. Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.-- `metadata`: Custom metadata for the sandbox-- `envs`: Custom environment variables for the sandbox-- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable-- `request_timeout`: Timeout for the request in **seconds**+If the command exits with a non-zero exit code, it throws a `CommandExitException`.**Returns**:-sandbox instance for the new sandbox-Use this method instead of using the constructor to create a new sandbox.+`CommandResult` result of command execution-### connect+### kill```python-@classmethod-async def connect(cls,- sandbox_id: str,- api_key: Optional[str] = None,- domain: Optional[str] = None,- debug: Optional[bool] = None)+async def kill() -> bool```-Connect to an existing sandbox.--With sandbox ID you can connect to the same sandbox from different places or environments (serverless functions, etc).--**Arguments**:+Kills the command.-- `sandbox_id`: Sandbox ID-- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable+It uses `SIGKILL` signal to kill the command**Returns**:-sandbox instance for the existing sandbox-@example-```python-sandbox = await AsyncSandbox.create()-sandbox_id = sandbox.sandbox_id+`True` if the command was killed successfully, `False` if the command was not found-same_sandbox = await AsyncSandbox.connect(sandbox_id)-### kill++## SandboxApi```python-@overload-async def kill(request_timeout: Optional[float] = None) -> bool+class SandboxApi(SandboxApiBase)```-Kill the sandbox.--**Arguments**:--- `request_timeout`: Timeout for the request in **seconds**--**Returns**:--`True` if the sandbox was killed, `False` if the sandbox was not found--### kill+### list```python-@overload-@staticmethod-async def kill(sandbox_id: str,+@classmethod+async def list(cls,api_key: Optional[str] = None,domain: Optional[str] = None,debug: Optional[bool] = None,- request_timeout: Optional[float] = None) -> bool+ request_timeout: Optional[float] = None) -> List[SandboxInfo]```-Kill the sandbox specified by sandbox ID.+List all running sandboxes.**Arguments**:-- `sandbox_id`: Sandbox ID-- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable+- `api_key`: API key to use for authentication, defaults to `E2B_API_KEY` environment variable- `request_timeout`: Timeout for the request in **seconds****Returns**:-`True` if the sandbox was killed, `False` if the sandbox was not found---### set\_timeout--```python-@overload-async def set_timeout(timeout: int,- request_timeout: Optional[float] = None) -> None-```--Set the timeout of the sandbox.--After the timeout expires the sandbox will be automatically killed.-This method can extend or reduce the sandbox timeout set when creating the sandbox or from the last call to `.set_timeout`.--Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.--**Arguments**:--- `timeout`: Timeout for the sandbox in **seconds**-- `request_timeout`: Timeout for the request in **seconds**---### set\_timeout--```python-@overload-@staticmethod-async def set_timeout(sandbox_id: str,- timeout: int,- api_key: Optional[str] = None,- domain: Optional[str] = None,- debug: Optional[bool] = None,- request_timeout: Optional[float] = None) -> None-```--Set the timeout of the specified sandbox.--After the timeout expires the sandbox will be automatically killed.-This method can extend or reduce the sandbox timeout set when creating the sandbox or from the last call to `.set_timeout`.--Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.--**Arguments**:--- `sandbox_id`: Sandbox ID-- `timeout`: Timeout for the sandbox in **seconds**-- `request_timeout`: Timeout for the request in **seconds**+List of running sandboxesdiff --git a/apps/web/src/app/(docs)/docs/sdk-reference/python-sdk/v1.0.4/sandbox_sync/page.mdx b/apps/web/src/app/(docs)/docs/sdk-reference/python-sdk/v1.0.4/sandbox_sync/page.mdxindex 85edf462c..7c7256794 100644--- a/apps/web/src/app/(docs)/docs/sdk-reference/python-sdk/v1.0.4/sandbox_sync/page.mdx+++ b/apps/web/src/app/(docs)/docs/sdk-reference/python-sdk/v1.0.4/sandbox_sync/page.mdx@@ -1,39 +1,269 @@-## WatchHandle+## Sandbox```python-class WatchHandle()+class Sandbox(SandboxSetup, SandboxApi)```-Handle for watching filesystem events.-It is used to get the latest events that have occurred in the watched directory.+E2B cloud sandbox is a secure and isolated cloud environment.-Use `.stop()` to stop watching the directory.+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](https://e2b.dev/docs).-### stop+Use the `Sandbox()` to create a new sandbox.++**Example**:```python-def stop()+from e2b import Sandbox++sandbox = Sandbox()```-Stop watching the directory.-After you stop the watcher you won't be able to get the events anymore.+### files-### get\_new\_events+```python+@property+def files() -> Filesystem+```++Module for interacting with the sandbox filesystem.+++### commands```python-def get_new_events() -> List[FilesystemEvent]+@property+def commands() -> Commands```-Get the latest events that have occurred in the watched directory since the last call, or from the beginning of the watching, up until now.+Module for running commands in the sandbox.+++### pty++```python+@property+def pty() -> Pty+```++Module for interacting with the sandbox pseudo-terminal.+++### sandbox\_id++```python+@property+def sandbox_id() -> str+```++Unique identifier of the sandbox+++### \_\_init\_\_++```python+def __init__(template: Optional[str] = None,+ timeout: Optional[int] = None,+ metadata: Optional[Dict[str, str]] = None,+ envs: Optional[Dict[str, str]] = None,+ api_key: Optional[str] = None,+ domain: Optional[str] = None,+ debug: Optional[bool] = None,+ sandbox_id: Optional[str] = None,+ request_timeout: Optional[float] = None)+```++Create a new sandbox.++By default, the sandbox is created from the default `base` sandbox template.++**Arguments**:++- `template`: Sandbox template name or ID+- `timeout`: Timeout for the sandbox in **seconds**, default to 300 seconds. Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users+- `metadata`: Custom metadata for the sandbox+- `envs`: Custom environment variables for the sandbox+- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable+- `request_timeout`: Timeout for the request in **seconds****Returns**:-List of filesystem events+sandbox instance for the new sandbox+++### is\_running++```python+def is_running(request_timeout: Optional[float] = None) -> bool+```++Check if the sandbox is running.++**Arguments**:++- `request_timeout`: Timeout for the request in **seconds**++**Returns**:++`True` if the sandbox is running, `False` otherwise+Example+```python+sandbox = Sandbox()+sandbox.is_running() # Returns True++sandbox.kill()+sandbox.is_running() # Returns False+```+++### connect++```python+@classmethod+def connect(cls,+ sandbox_id: str,+ api_key: Optional[str] = None,+ domain: Optional[str] = None,+ debug: Optional[bool] = None)+```++Connects to an existing Sandbox.++With sandbox ID you can connect to the same sandbox from different places or environments (serverless functions, etc).++**Arguments**:++- `sandbox_id`: Sandbox ID+- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable++**Returns**:++sandbox instance for the existing sandbox+@example+```python+sandbox = Sandbox()+sandbox_id = sandbox.sandbox_id++same_sandbox = Sandbox.connect(sandbox_id)+++### kill++```python+@overload+def kill(request_timeout: Optional[float] = None) -> bool+```++Kill the sandbox.++**Arguments**:++- `request_timeout`: Timeout for the request in **seconds**++**Returns**:++`True` if the sandbox was killed, `False` if the sandbox was not found+++### kill++```python+@overload+@staticmethod+def kill(sandbox_id: str,+ api_key: Optional[str] = None,+ domain: Optional[str] = None,+ debug: Optional[bool] = None,+ request_timeout: Optional[float] = None) -> bool+```++Kill the sandbox specified by sandbox ID.++**Arguments**:++- `sandbox_id`: Sandbox ID+- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable+- `request_timeout`: Timeout for the request in **seconds**++**Returns**:++`True` if the sandbox was killed, `False` if the sandbox was not found+++### kill++```python+@class_method_variant("_cls_kill")+def kill(request_timeout: Optional[float] = None) -> bool+```++Kill the sandbox.++**Arguments**:++- `request_timeout`: Timeout for the request++**Returns**:++`True` if the sandbox was killed, `False` if the sandbox was not found+++### set\_timeout++```python+@overload+def set_timeout(timeout: int, request_timeout: Optional[float] = None) -> None+```++Set the timeout of the sandbox.++After the timeout expires the sandbox will be automatically killed.+This method can extend or reduce the sandbox timeout set when creating the sandbox or from the last call to `.set_timeout`.++Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.++**Arguments**:++- `timeout`: Timeout for the sandbox in **seconds**+- `request_timeout`: Timeout for the request in **seconds**+++### set\_timeout++```python+@overload+@staticmethod+def set_timeout(sandbox_id: str,+ timeout: int,+ api_key: Optional[str] = None,+ domain: Optional[str] = None,+ debug: Optional[bool] = None,+ request_timeout: Optional[float] = None) -> None+```++Set the timeout of the sandbox specified by sandbox ID.++After the timeout expires the sandbox will be automatically killed.+This method can extend or reduce the sandbox timeout set when creating the sandbox or from the last call to `.set_timeout`.++Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.++**Arguments**:++- `sandbox_id`: Sandbox ID+- `timeout`: Timeout for the sandbox in **seconds**+- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable+- `request_timeout`: Timeout for the request in **seconds**@@ -274,34 +504,39 @@ Watch directory for filesystem events.-## SandboxApi+## WatchHandle```python-class SandboxApi(SandboxApiBase)+class WatchHandle()```+Handle for watching filesystem events.+It is used to get the latest events that have occurred in the watched directory.-### list+Use `.stop()` to stop watching the directory.+++### stop```python-@classmethod-def list(cls,- api_key: Optional[str] = None,- domain: Optional[str] = None,- debug: Optional[bool] = None,- request_timeout: Optional[float] = None) -> List[SandboxInfo]+def stop()```-List all running sandboxes.+Stop watching the directory.+After you stop the watcher you won't be able to get the events anymore.-**Arguments**:-- `api_key`: API key to use for authentication, defaults to `E2B_API_KEY` environment variable-- `request_timeout`: Timeout for the request in **seconds**+### get\_new\_events++```python+def get_new_events() -> List[FilesystemEvent]+```++Get the latest events that have occurred in the watched directory since the last call, or from the beginning of the watching, up until now.**Returns**:-List of sandbox info+List of filesystem events@@ -457,92 +692,6 @@ You can use `CommandHandle.wait()` to wait for the command to finish and get exe-## CommandHandle--```python-class CommandHandle()-```--Command execution handle.--It provides methods for waiting for the command to finish, retrieving stdout/stderr, and killing the command.---### pid--```python-@property-def pid()-```--Command process ID.---### \_\_iter\_\_--```python-def __iter__()-```--Iterate over the command output.--**Returns**:--Generator of command outputs---### disconnect--```python-def disconnect() -> None-```--Disconnect from the command.--The command is not killed, but SDK stops receiving events from the command.-You can reconnect to the command using `sandbox.commands.connect` method.---### wait--```python-def wait(on_pty: Optional[Callable[[PtyOutput], None]] = None,- on_stdout: Optional[Callable[[str], None]] = None,- on_stderr: Optional[Callable[[str], None]] = None) -> CommandResult-```--Wait for the command to finish and returns the result.--If the command exits with a non-zero exit code, it throws a `CommandExitException`.--**Arguments**:--- `on_pty`: Callback for pty output-- `on_stdout`: Callback for stdout output-- `on_stderr`: Callback for stderr output--**Returns**:--`CommandResult` result of command execution---### kill--```python-def kill() -> bool-```--Kills the command.--It uses `SIGKILL` signal to kill the command.--**Returns**:--Whether the command was killed successfully----## Pty```python@@ -635,267 +784,118 @@ Call this when the terminal window is resized and the number of columns and rows-## Sandbox+## CommandHandle```python-class Sandbox(SandboxSetup, SandboxApi)+class CommandHandle()```-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](https://e2b.dev/docs).--Use the `Sandbox()` to create a new sandbox.--**Example**:--```python-from e2b import Sandbox+Command execution handle.-sandbox = Sandbox()-```+It provides methods for waiting for the command to finish, retrieving stdout/stderr, and killing the command.-### files+### pid```python@property-def files() -> Filesystem+def pid()```-Module for interacting with the sandbox filesystem.+Command process ID.-### commands+### \_\_iter\_\_```python-@property-def commands() -> Commands+def __iter__()```-Module for running commands in the sandbox.---### pty+Iterate over the command output.-```python-@property-def pty() -> Pty-```+**Returns**:-Module for interacting with the sandbox pseudo-terminal.+Generator of command outputs-### sandbox\_id+### disconnect```python-@property-def sandbox_id() -> str+def disconnect() -> None```-Unique identifier of the sandbox+Disconnect from the command.++The command is not killed, but SDK stops receiving events from the command.+You can reconnect to the command using `sandbox.commands.connect` method.-### \_\_init\_\_+### wait```python-def __init__(template: Optional[str] = None,- timeout: Optional[int] = None,- metadata: Optional[Dict[str, str]] = None,- envs: Optional[Dict[str, str]] = None,- api_key: Optional[str] = None,- domain: Optional[str] = None,- debug: Optional[bool] = None,- sandbox_id: Optional[str] = None,- request_timeout: Optional[float] = None)+def wait(on_pty: Optional[Callable[[PtyOutput], None]] = None,+ on_stdout: Optional[Callable[[str], None]] = None,+ on_stderr: Optional[Callable[[str], None]] = None) -> CommandResult```-Create a new sandbox.+Wait for the command to finish and returns the result.-By default, the sandbox is created from the default `base` sandbox template.+If the command exits with a non-zero exit code, it throws a `CommandExitException`.**Arguments**:-- `template`: Sandbox template name or ID-- `timeout`: Timeout for the sandbox in **seconds**, default to 300 seconds. Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users-- `metadata`: Custom metadata for the sandbox-- `envs`: Custom environment variables for the sandbox-- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable-- `request_timeout`: Timeout for the request in **seconds**+- `on_pty`: Callback for pty output+- `on_stdout`: Callback for stdout output+- `on_stderr`: Callback for stderr output**Returns**:-sandbox instance for the new sandbox+`CommandResult` result of command execution-### is\_running+### kill```python-def is_running(request_timeout: Optional[float] = None) -> bool+def kill() -> bool```-Check if the sandbox is running.--**Arguments**:+Kills the command.-- `request_timeout`: Timeout for the request in **seconds**+It uses `SIGKILL` signal to kill the command.**Returns**:-`True` if the sandbox is running, `False` otherwise-Example-```python-sandbox = Sandbox()-sandbox.is_running() # Returns True--sandbox.kill()-sandbox.is_running() # Returns False-```---### connect--```python-@classmethod-def connect(cls,- sandbox_id: str,- api_key: Optional[str] = None,- domain: Optional[str] = None,- debug: Optional[bool] = None)-```--Connects to an existing Sandbox.--With sandbox ID you can connect to the same sandbox from different places or environments (serverless functions, etc).--**Arguments**:--- `sandbox_id`: Sandbox ID-- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable--**Returns**:+Whether the command was killed successfully-sandbox instance for the existing sandbox-@example-```python-sandbox = Sandbox()-sandbox_id = sandbox.sandbox_id-same_sandbox = Sandbox.connect(sandbox_id)-### kill+## SandboxApi```python-@overload-def kill(request_timeout: Optional[float] = None) -> bool+class SandboxApi(SandboxApiBase)```-Kill the sandbox.--**Arguments**:--- `request_timeout`: Timeout for the request in **seconds**--**Returns**:--`True` if the sandbox was killed, `False` if the sandbox was not found--### kill+### list```python-@overload-@staticmethod-def kill(sandbox_id: str,+@classmethod+def list(cls,api_key: Optional[str] = None,domain: Optional[str] = None,debug: Optional[bool] = None,- request_timeout: Optional[float] = None) -> bool+ request_timeout: Optional[float] = None) -> List[SandboxInfo]```-Kill the sandbox specified by sandbox ID.+List all running sandboxes.**Arguments**:-- `sandbox_id`: Sandbox ID-- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable+- `api_key`: API key to use for authentication, defaults to `E2B_API_KEY` environment variable- `request_timeout`: Timeout for the request in **seconds****Returns**:-`True` if the sandbox was killed, `False` if the sandbox was not found---### kill--```python-@class_method_variant("_cls_kill")-def kill(request_timeout: Optional[float] = None) -> bool-```--Kill the sandbox.--**Arguments**:--- `request_timeout`: Timeout for the request--**Returns**:--`True` if the sandbox was killed, `False` if the sandbox was not found---### set\_timeout--```python-@overload-def set_timeout(timeout: int, request_timeout: Optional[float] = None) -> None-```--Set the timeout of the sandbox.--After the timeout expires the sandbox will be automatically killed.-This method can extend or reduce the sandbox timeout set when creating the sandbox or from the last call to `.set_timeout`.--Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.--**Arguments**:--- `timeout`: Timeout for the sandbox in **seconds**-- `request_timeout`: Timeout for the request in **seconds**---### set\_timeout--```python-@overload-@staticmethod-def set_timeout(sandbox_id: str,- timeout: int,- api_key: Optional[str] = None,- domain: Optional[str] = None,- debug: Optional[bool] = None,- request_timeout: Optional[float] = None) -> None-```--Set the timeout of the sandbox specified by sandbox ID.--After the timeout expires the sandbox will be automatically killed.-This method can extend or reduce the sandbox timeout set when creating the sandbox or from the last call to `.set_timeout`.--Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.--**Arguments**:--- `sandbox_id`: Sandbox ID-- `timeout`: Timeout for the sandbox in **seconds**-- `api_key`: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable-- `request_timeout`: Timeout for the request in **seconds**+List of sandbox infodiff --git a/packages/cli/package.json b/packages/cli/package.jsonindex 712938547..3110627e1 100644--- a/packages/cli/package.json+++ b/packages/cli/package.json@@ -1,6 +1,6 @@{"name": "@e2b/cli",- "version": "1.0.5",+ "version": "1.0.6","description": "CLI for managing e2b sandbox templates","homepage": "https://e2b.dev","license": "MIT",