{"owner":"e2b-dev","repo":"E2B","hasSkills":true,"totalSkillsCount":12,"totalTokensCount":10341,"categories":["root-instruction","claude-rule","plugin-manifest","anthropic-skill"],"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md","CLAUDE.md","packages/cli/README.md","packages/code-interpreter-js/README.md","packages/code-interpreter-python/README.md","packages/desktop-js/README.md","packages/desktop-python/README.md","packages/dockerfile-utils-js/README.md","packages/dockerfile-utils-python/README.md","packages/js-sdk/README.md","packages/python-sdk/README.md","skills/stripe-projects/SKILL.md"],"skills":{"AGENTS.md":"CLAUDE.md","CLAUDE.md":"Use pnpm for node and uv for python to install and update dependencies.\nRun `pnpm run format`, `pnpm run lint` and `pnpm run typecheck` before committing changes.\nWhen modifying the SDK packages, ensure equivalent changes are applied to both JS as well as sync and async Python implementations.\nNever edit the API, envd, or volume-content specs in spec/ by hand; they are synced with Copybara from e2b-dev/runtime and e2b-dev/belt at the commits pinned in spec/runtime-ref and spec/belt-ref (see copy.bara.sky and spec/README.md). To update the specs, bump the pins and re-run `make codegen`, which re-fetches them before generating.\nCreate or update tests covering affected codepaths and run them using `pnpm run test`.\nGenerate a changeset with `pnpm changeset` in the repository root when changing the public surface of packages/cli, packages/js-sdk, or packages/python-sdk; internal scripts, devtools, and tests don't need one.\nWhen creating a pull request, add usage examples for user-facing changes to the PR description.\nWhen opening a new pull request, use the Linear MCP if available to link to related issues, or create a new issue from the PR description.\nKeep PR descriptions up-to-date with changes.\nDefault credentials are stored in .env.local in the repository root or inside ~/.e2b/config.json.\n","packages/cli/README.md":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n# E2B CLI\n\nThis CLI tool allows you to build manager your running E2B sandbox and sandbox templates. Learn more in [our documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli).\n\n### 1. Install the CLI\n\n**Using Homebrew (on macOS)**\n\n```bash\nbrew install e2b\n```\n\n**Using NPM**\n\n```bash\nnpm install -g @e2b/cli\n```\n\n### 2. Authenticate\n\n```bash\ne2b auth login\n```\n\n> [!NOTE]\n> To authenticate without the ability to open the browser (e.g. in CI/CD),\n> provide `E2B_API_KEY` as an environment variable. You can find your API key\n> in the [API Keys](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli) tab in the E2B dashboard.\n> Then use the CLI like this: `E2B_API_KEY=e2b_... e2b template create`.\n\n### 3. Check out docs\n\nVisit our [CLI documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli) to learn more.\n","packages/code-interpreter-js/README.md":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://www.npmjs.com/package/e2b\">\n    <img alt=\"Last 1 month downloads for the JavaScript SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/npm/dm/e2b?label=NPM%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter) is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).\n\nSource: [packages/code-interpreter-js](https://github.com/e2b-dev/E2B/tree/main/packages/code-interpreter-js)\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\nnpm i @e2b/code-interpreter\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n3. Set environment variable with your API key.\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Execute code with code interpreter inside Sandbox\n\n```ts\nimport { Sandbox } from '@e2b/code-interpreter'\n\nconst sbx = await Sandbox.create()\nawait sbx.runCode('x = 1')\n\nconst execution = await sbx.runCode('x+=1; x')\nconsole.log(execution.text)  // outputs 2\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```ts\nimport { E2B } from '@e2b/code-interpreter'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst sbx = await client.Sandbox.create()\nconst execution = await sbx.runCode('x = 1; x += 1; x')\n\n// The core resources are bound to the client's configuration as well.\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n\n### 6. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","packages/code-interpreter-python/README.md":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://pypi.org/project/e2b/\">\n    <img alt=\"Last 1 month downloads for the Python SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/pypi/dm/e2b?label=PyPI%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter) is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).\n\nSource: [packages/code-interpreter-python](https://github.com/e2b-dev/E2B/tree/main/packages/code-interpreter-python)\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\npip install e2b-code-interpreter\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n3. Set environment variable with your API key.\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Execute code with code interpreter inside Sandbox\n\n```py\nfrom e2b_code_interpreter import Sandbox\n\nwith Sandbox.create() as sandbox:\n    sandbox.run_code(\"x = 1\")\n    execution = sandbox.run_code(\"x+=1; x\")\n    print(execution.text)  # outputs 2\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` and `AsyncSandbox` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```py\nfrom e2b_code_interpreter import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\nwith client.Sandbox.create() as sandbox:\n    execution = sandbox.run_code(\"x = 1; x += 1; x\")\n\n# The async variant is exposed as well.\nasync_sandbox = await client.AsyncSandbox.create()\n\n# The core resources are bound to the client's configuration as well.\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n\n### 6. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","packages/desktop-js/README.md":"# E2B Desktop Sandbox - Virtual Computer for Computer Use\n\nE2B Desktop Sandbox is a secure virtual desktop ready for Computer Use. Powered by [E2B](https://e2b.dev).\n\nEach sandbox is isolated from the others and can be customized with any dependencies you want.\n\n![Desktop Sandbox](https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/packages/desktop-python/screenshot.png)\n\nSource: [packages/desktop-js](https://github.com/e2b-dev/E2B/tree/main/packages/desktop-js)\n\n## Examples\n\nCheck out the [example open-source app](https://github.com/e2b-dev/open-computer-use) in a separate repository.\n\n## 🚀 Getting started\n\nThe E2B Desktop Sandbox is built on top of [E2B Sandbox](https://e2b.dev/docs).\n\n### 1. Get E2B API key\n\nSign up at [E2B](https://e2b.dev) and get your API key.\nSet environment variable `E2B_API_KEY` with your API key.\n\n### 2. Install SDK\n\n```bash\nnpm install @e2b/desktop\n```\n\n### 3. Create Desktop Sandbox\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\n// Start a new desktop sandbox\nconst desktop = await Sandbox.create()\n\n// Launch an application\nawait desktop.launch('google-chrome') // or vscode, firefox, etc.\n\n// Wait 10s for the application to open\nawait desktop.wait(10000)\n\n// Stream the application's window\n// Note: there can be only one stream at a time\n// You need to stop the current stream before streaming another application\nawait desktop.stream.start({\n  windowId: await desktop.getCurrentWindowId(), // if not provided the whole desktop will be streamed\n  requireAuth: true,\n})\n\n// Get the stream auth key\nconst authKey = desktop.stream.getAuthKey()\n\n// Print the stream URL\nconsole.log('Stream URL:', desktop.stream.getUrl({ authKey }))\n\n// Kill the sandbox after the tasks are finished\n// await desktop.kill()\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```javascript\nimport { E2B } from '@e2b/desktop'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst desktop = await client.Sandbox.create()\nawait desktop.stream.start()\n\n// The core resources are bound to the client's configuration as well.\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n## Features\n\n### Streaming desktop's screen\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Start the stream\nawait desktop.stream.start()\n\n// Get stream URL\nconst url = desktop.stream.getUrl()\nconsole.log(url)\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Streaming with password protection\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Start the stream\nawait desktop.stream.start({\n  requireAuth: true, // Enable authentication with an auto-generated key\n})\n\n// Retrieve the authentication key\nconst authKey = await desktop.stream.getAuthKey()\n\n// Get stream URL\nconst url = desktop.stream.getUrl({ authKey })\nconsole.log(url)\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Streaming specific application\n\n> [!WARNING]\n>\n> - Will throw an error if the desired application is not open yet\n> - The stream will close once the application closes\n> - Creating multiple streams at the same time is not supported, you may have to stop the current stream and start a new one for each application\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Get current (active) window ID\nconst windowId = await desktop.getCurrentWindowId()\n\n// Get all windows of the application\nconst windowIds = await desktop.getApplicationWindows('Firefox')\n\n// Start the stream\nawait desktop.stream.start({ windowId: windowIds[0] })\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Mouse control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\nawait desktop.doubleClick()\nawait desktop.leftClick()\nawait desktop.leftClick(100, 200)\nawait desktop.rightClick()\nawait desktop.rightClick(100, 200)\nawait desktop.middleClick()\nawait desktop.middleClick(100, 200)\nawait desktop.scroll(10) // Scroll by the amount. Positive for up, negative for down.\nawait desktop.moveMouse(100, 200) // Move to x, y coordinates\nawait desktop.drag([100, 100], [200, 200]) // Drag using the mouse\nawait desktop.mousePress('left') // Press the mouse button\nawait desktop.mouseRelease('left') // Release the mouse button\n```\n\n### Keyboard control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Write text at the current cursor position with customizable typing speed\nawait desktop.write('Hello, world!')\nawait desktop.write('Fast typing!', { chunkSize: 50, delayInMs: 25 }) // Faster typing\n\n// Press keys\nawait desktop.press('enter')\nawait desktop.press('space')\nawait desktop.press('backspace')\nawait desktop.press(['ctrl', 'c']) // Key combination\n```\n\n### Window control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Get current (active) window ID\nconst windowId = await desktop.getCurrentWindowId()\n\n// Get all windows of the application\nconst windowIds = await desktop.getApplicationWindows('Firefox')\n\n// Get window title\nconst title = await desktop.getWindowTitle(windowId)\n```\n\n### Screenshot\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\nconst image = await desktop.screenshot()\n// Save the image to a file\nfs.writeFileSync('screenshot.png', image)\n```\n\n### Open file\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Open file with default application\nawait desktop.files.write('/home/user/index.js', \"console.log('hello')\") // First create the file\nawait desktop.open('/home/user/index.js') // Then open it\n```\n\n### Launch applications\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Launch the application\nawait desktop.launch('google-chrome')\n```\n\n### Run any bash commands\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Run any bash command\nconst out = await desktop.commands.run('ls -la /home/user')\nconsole.log(out)\n```\n\n### Wait\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\nawait desktop.wait(1000) // Wait for 1 second\n```\n\n## Under the hood\n\nThe desktop-like environment is based on Linux and [Xfce](https://www.xfce.org/) at the moment. We chose Xfce because it's a fast and lightweight environment that's also popular and actively supported. However, this Sandbox template is fully customizable and you can create your own desktop environment.\nCheck out the sandbox template's code [here](https://github.com/e2b-dev/desktop/tree/main/template).\n","packages/desktop-python/README.md":"# E2B Desktop Sandbox - Virtual Computer for Computer Use\n\nE2B Desktop Sandbox is a secure virtual desktop ready for Computer Use. Powered by [E2B](https://e2b.dev).\n\nEach sandbox is isolated from the others and can be customized with any dependencies you want.\n\n![Desktop Sandbox](https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/packages/desktop-python/screenshot.png)\n\nSource: [packages/desktop-python](https://github.com/e2b-dev/E2B/tree/main/packages/desktop-python)\n\n## Examples\n\nCheck out the [example open-source app](https://github.com/e2b-dev/open-computer-use) in a separate repository.\n\n## 🚀 Getting started\n\nThe E2B Desktop Sandbox is built on top of [E2B Sandbox](https://e2b.dev/docs).\n\n### 1. Get E2B API key\n\nSign up at [E2B](https://e2b.dev) and get your API key.\nSet environment variable `E2B_API_KEY` with your API key.\n\n### 2. Install SDK\n\n```bash\npip install e2b-desktop\n```\n\n### 3. Create Desktop Sandbox\n\n```python\nfrom e2b_desktop import Sandbox\n\n# Create a new desktop sandbox\ndesktop = Sandbox.create()\n\n# Launch an application\ndesktop.launch('google-chrome')  # or vscode, firefox, etc.\n\n# Wait 10s for the application to open\ndesktop.wait(10000)\n\n# Stream the application's window\n# Note: There can be only one stream at a time\n# You need to stop the current stream before streaming another application\ndesktop.stream.start(\n    window_id=desktop.get_current_window_id(), # if not provided the whole desktop will be streamed\n    require_auth=True\n)\n\n# Get the stream auth key\nauth_key = desktop.stream.get_auth_key()\n\n# Print the stream URL\nprint('Stream URL:', desktop.stream.get_url(auth_key=auth_key))\n\n# Kill the sandbox after the tasks are finished\n# desktop.kill()\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```python\nfrom e2b_desktop import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\ndesktop = client.Sandbox.create()\ndesktop.stream.start()\n\n# The core resources are bound to the client's configuration as well.\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n## Features\n\n### Streaming desktop's screen\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Start the stream\ndesktop.stream.start()\n\n# Get stream URL\nurl = desktop.stream.get_url()\nprint(url)\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Streaming with password protection\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Start the stream\ndesktop.stream.start(\n    require_auth=True  # Enable authentication with an auto-generated key\n)\n\n# Retrieve the authentication key\nauth_key = desktop.stream.get_auth_key()\n\n# Get stream URL\nurl = desktop.stream.get_url(auth_key=auth_key)\nprint(url)\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Streaming specific application\n\n> [!WARNING]\n>\n> - Will raise an error if the desired application is not open yet\n> - The stream will close once the application closes\n> - Creating multiple streams at the same time is not supported, you may have to stop the current stream and start a new one for each application\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Get current (active) window ID\nwindow_id = desktop.get_current_window_id()\n\n# Get all windows of the application\nwindow_ids = desktop.get_application_windows(\"Firefox\")\n\n# Start the stream\ndesktop.stream.start(window_id=window_ids[0])\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Mouse control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\ndesktop.double_click()\ndesktop.left_click()\ndesktop.left_click(x=100, y=200)\ndesktop.right_click()\ndesktop.right_click(x=100, y=200)\ndesktop.middle_click()\ndesktop.middle_click(x=100, y=200)\ndesktop.scroll(10) # Scroll by the amount. Positive for up, negative for down.\ndesktop.move_mouse(100, 200) # Move to x, y coordinates\ndesktop.drag((100, 100), (200, 200)) # Drag using the mouse\ndesktop.mouse_press(\"left\") # Press the mouse button\ndesktop.mouse_release(\"left\") # Release the mouse button\n```\n\n### Keyboard control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Write text at the current cursor position with customizable typing speed\ndesktop.write(\"Hello, world!\")  # Default: chunk_size=25, delay_in_ms=75\ndesktop.write(\"Fast typing!\", chunk_size=50, delay_in_ms=25)  # Faster typing\n\n# Press keys\ndesktop.press(\"enter\")\ndesktop.press(\"space\")\ndesktop.press(\"backspace\")\ndesktop.press([\"ctrl\", \"c\"]) # Key combination\n```\n\n### Window control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Get current (active) window ID\nwindow_id = desktop.get_current_window_id()\n\n# Get all windows of the application\nwindow_ids = desktop.get_application_windows(\"Firefox\")\n\n# Get window title\ntitle = desktop.get_window_title(window_id)\n```\n\n### Screenshot\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Take a screenshot and save it as \"screenshot.png\" locally\nimage = desktop.screenshot()\n# Save the image to a file\nwith open(\"screenshot.png\", \"wb\") as f:\n    f.write(image)\n```\n\n### Open file\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Open file with default application\ndesktop.files.write(\"/home/user/index.js\", \"console.log('hello')\") # First create the file\ndesktop.open(\"/home/user/index.js\") # Then open it\n```\n\n### Launch applications\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Launch the application\ndesktop.launch('google-chrome')\n```\n\n### Run any bash commands\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Run any bash command\nout = desktop.commands.run(\"ls -la /home/user\")\nprint(out)\n```\n\n### Wait\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\ndesktop.wait(1000) # Wait for 1 second\n```\n\n## Under the hood\n\nThe desktop-like environment is based on Linux and [Xfce](https://www.xfce.org/) at the moment. We chose Xfce because it's a fast and lightweight environment that's also popular and actively supported. However, this Sandbox template is fully customizable and you can create your own desktop environment.\nCheck out the sandbox template's code [here](https://github.com/e2b-dev/desktop/tree/main/template).\n","packages/dockerfile-utils-js/README.md":"# @e2b/dockerfile-utils\n\nDockerfile parser and shell lexer ported from [BuildKit](https://github.com/moby/buildkit/tree/master/frontend/dockerfile) and a `.dockerignore` matcher ported from [moby/patternmatcher](https://github.com/moby/patternmatcher), with no runtime dependencies. Used by the [E2B SDK](https://www.npmjs.com/package/e2b) to implement `Template.fromDockerfile` and to filter the build context.\n\n```ts\nimport { parseDockerfileAst, ShellLex } from '@e2b/dockerfile-utils'\n\nconst ast = parseDockerfileAst(`\nFROM node:24 AS build\nENV KEY=\"a  b\" OTHER=c\nRUN <<EOF\nnpm ci\nnpm run build\nEOF\n`)\n\nfor (const instruction of ast.instructions) {\n  console.log(instruction.name, instruction.flags, instruction.args)\n}\n\nconst lex = new ShellLex(ast.escapeToken)\nlex.processWords('KEY=\"a  b\" OTHER=c') // ['KEY=a  b', 'OTHER=c']\n```\n\n`parseDockerfileAst` handles parser directives (`# escape=`, `# syntax=`), comments (including inside line continuations), builder flags, JSON/exec forms and heredocs, and reports line numbers and warnings. `ShellLex` splits and unquotes words the way BuildKit does, preserving `$VAR` / `${VAR:-default}` references for later expansion.\n\n```ts\nimport { PatternMatcher } from '@e2b/dockerfile-utils'\n\nconst matcher = new PatternMatcher(['node_modules', '*.log', '!keep.log'])\nmatcher.matches('node_modules/pkg/index.js') // true\nmatcher.matches('keep.log') // false\n```\n\n`PatternMatcher` applies `.dockerignore` semantics to slash-separated paths relative to the context root: a pattern matching a directory excludes everything under it, and `!` patterns re-include paths (the last matching pattern wins). An invalid pattern throws a plain `Error`.\n","packages/dockerfile-utils-python/README.md":"# e2b-dockerfile-utils\n\nDockerfile parser and shell lexer ported from [BuildKit](https://github.com/moby/buildkit/tree/master/frontend/dockerfile) and a `.dockerignore` matcher ported from [moby/patternmatcher](https://github.com/moby/patternmatcher), with no runtime dependencies. Used by the [E2B SDK](https://pypi.org/project/e2b/) to implement `Template.from_dockerfile` and to filter the build context.\n\n```python\nfrom e2b_dockerfile_utils import ShellLex, parse_dockerfile_ast\n\nast = parse_dockerfile_ast(\n    \"\"\"\nFROM node:24 AS build\nENV KEY=\"a  b\" OTHER=c\nRUN <<EOF\nnpm ci\nnpm run build\nEOF\n\"\"\"\n)\n\nfor instruction in ast.instructions:\n    print(instruction.name, instruction.flags, instruction.args)\n\nlex = ShellLex(ast.escape_token)\nlex.process_words('KEY=\"a  b\" OTHER=c')  # ['KEY=a  b', 'OTHER=c']\n```\n\n`parse_dockerfile_ast` handles parser directives (`# escape=`, `# syntax=`), comments (including inside line continuations), builder flags, JSON/exec forms and heredocs, and reports line numbers and warnings. `ShellLex` splits and unquotes words the way BuildKit does, preserving `$VAR` / `${VAR:-default}` references for later expansion.\n\n```python\nfrom e2b_dockerfile_utils import PatternMatcher\n\nmatcher = PatternMatcher([\"node_modules\", \"*.log\", \"!keep.log\"])\nmatcher.matches(\"node_modules/pkg/index.js\")  # True\nmatcher.matches(\"keep.log\")  # False\n```\n\n`PatternMatcher` applies `.dockerignore` semantics to slash-separated paths relative to the context root: a pattern matching a directory excludes everything under it, and `!` patterns re-include paths (the last matching pattern wins). An invalid pattern raises a plain `ValueError`.\n","packages/js-sdk/README.md":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">  \n  <a href=\"https://www.npmjs.com/package/e2b\">\n    <img alt=\"Last 1 month downloads for the JavaScript SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/npm/dm/e2b?label=NPM%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```bash\nnpm i e2b\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n3. Set environment variable with your API key\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Start a sandbox and run commands\n\n```ts\nimport { Sandbox } from 'e2b'\n\nconst sandbox = await Sandbox.create()\nconst result = await sandbox.commands.run('echo \"Hello from E2B!\"')\nconsole.log(result.stdout) // Hello from E2B!\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox`, `Volume`, `Template` and `Secret` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```ts\nimport { E2B } from 'e2b'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst sandbox = await client.Sandbox.create()\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Code execution with Code Interpreter\n\nIf you need [`runCode()`](https://docs.e2b.dev/code-interpreting/analyze-data-with-ai?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b), install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):\n\n```bash\nnpm i @e2b/code-interpreter\n```\n\n```ts\nimport { Sandbox } from '@e2b/code-interpreter'\n\nconst sandbox = await Sandbox.create()\nconst execution = await sandbox.runCode('x = 1; x += 1; x')\nconsole.log(execution.text)  // outputs 2\n```\n\n### 6. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n\n### 7. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","packages/python-sdk/README.md":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://pypi.org/project/e2b/\">\n    <img alt=\"Last 1 month downloads for the Python SDK\" loading=\"lazy\" decoding=\"async\" style=\"color:transparent;width:170px;height:18px\" src=\"https://static.pepy.tech/personalized-badge/e2b?period=monthly&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=PyPi%20Monthly%20Downloads\">\n  </a>  \n</h4>\n\n\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\npip install e2b\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n3. Set environment variable with your API key\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Start a sandbox and run commands\n\n```py\nfrom e2b import Sandbox\n\nwith Sandbox.create() as sandbox:\n    result = sandbox.commands.run('echo \"Hello from E2B!\"')\n    print(result.stdout)  # Hello from E2B!\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox`, `AsyncSandbox`, `Volume`, `AsyncVolume`, `Template`, `AsyncTemplate` and `Secret` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```py\nfrom e2b import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\nsandbox = client.Sandbox.create()\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The async variants are exposed as well.\nasync_sandbox = await client.AsyncSandbox.create()\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n### High-concurrency sandbox streams\n\nSandbox `commands` and `files` traffic from all sandboxes in a process shares one HTTP/2 connection pool. Requests are spread over the pooled connections by free stream capacity, and a new connection is dialed only once every existing one is at the server's concurrent-stream limit (`100` for `sandbox.e2b.app`), up to `E2B_MAX_CONNECTIONS` connections per resolved address (default `200`). Past that cap, a request waits for a stream to free up. Long-running streams therefore never queue behind one connection's concurrent-stream limit, and idle processes keep a single connection.\n\n`E2B_MAX_CONNECTIONS` is read when `e2b` is imported:\n\n```sh\nE2B_MAX_CONNECTIONS=400 python eval.py\n```\n\n### 5. Code execution with Code Interpreter\n\nIf you need [`run_code()`](https://docs.e2b.dev/code-interpreting/analyze-data-with-ai?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b), install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):\n\n```\npip install e2b-code-interpreter\n```\n\n```py\nfrom e2b_code_interpreter import Sandbox\n\nwith Sandbox.create() as sandbox:\n    execution = sandbox.run_code(\"x = 1; x += 1; x\")\n    print(execution.text)  # outputs 2\n```\n\n### 6. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n\n### 7. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","skills/stripe-projects/SKILL.md":"---\nname: stripe-projects\ndescription: \"Use after E2B sandbox/API access has been provisioned through Stripe Projects and the user needs to use the resulting E2B API key with the E2B CLI, JavaScript SDK, Python SDK, or Code Interpreter SDK.\"\n---\n\n# E2B Stripe Projects\n\nUse these patterns after E2B sandbox/API access has been provisioned through Stripe Projects.\n\n## Credentials\n\n- Stripe Projects provisions E2B sandbox/API access and returns an E2B team API key.\n- Use that key as `E2B_API_KEY` for sandbox creation, sandbox control, and SDK clients.\n- Prefer setting `E2B_API_KEY` explicitly in runtime environments so commands and SDK calls use the intended E2B team.\n- Local defaults can also come from `.env.local` or `~/.e2b/config.json`.\n- In Stripe Projects checkouts, the E2B CLI may not be globally logged in. Before using `e2b sandbox ...`, prefer a Stripe Projects env pull plus per-command export instead of trying `e2b auth login`.\n- Do not print secret values. `stripe projects env --json` can return redacted placeholders, so do not use it as the source for a runnable `E2B_API_KEY`. Pull the managed env file, then read only the needed E2B variables into the command environment without echoing them.\n\n```bash\nstripe projects env --pull --yes\nenv_value() {\n  awk -F= -v key=\"$1\" '$1 == key {sub(/^[^=]*=/, \"\"); gsub(/^\"|\"$/, \"\"); print; exit}' .env\n}\nexport E2B_API_KEY=\"$(env_value E2B_API_KEY)\"\nexport E2B_API_URL=\"$(env_value E2B_API_URL)\"\nexport E2B_DOMAIN=\"$(env_value E2B_DOMAIN)\"\ne2b sandbox create base --detach\n```\n\n## Stripe Projects CLI\n\nAdd E2B to the current Stripe project:\n\n```bash\nstripe projects add e2b/sandboxes\n```\n\nInspect or pull provisioned credentials:\n\n```bash\nstripe projects env\nstripe projects env --json\nstripe projects env --pull --yes\n```\n\nExport the E2B API key before using the E2B CLI or SDK. Prefer `stripe projects env --pull --yes` for command execution because JSON output may redact secret values. Read only the variables you need from `.env`; do not source `.env` as shell code:\n\n```bash\nstripe projects env --pull --yes\nenv_value() {\n  awk -F= -v key=\"$1\" '$1 == key {sub(/^[^=]*=/, \"\"); gsub(/^\"|\"$/, \"\"); print; exit}' .env\n}\nexport E2B_API_KEY=\"$(env_value E2B_API_KEY)\"\nexport E2B_API_URL=\"$(env_value E2B_API_URL)\"\nexport E2B_DOMAIN=\"$(env_value E2B_DOMAIN)\"\n```\n\nUse `stripe projects env --json` for structure checks only. In current Stripe Projects output, the E2B variables are under `data.resource_access_configurations[].access_configuration`, including `E2B_API_KEY`, `E2B_API_URL`, and `E2B_DOMAIN`, but the values may be redacted and unusable for CLI/SDK calls.\n\n## E2B CLI\n\nIf the E2B CLI is missing or a shell shim is broken, install it with Node instead of switching to SDK code:\n\n```bash\nif ! e2b --version >/dev/null 2>&1; then\n  npm install -g @e2b/cli\nfi\n```\n\nThe CLI package requires Node 22 or newer.\n\nPrefer detached sandboxes for non-interactive work so the command returns a sandbox ID and does not attach an interactive terminal:\n\n```bash\ne2b sandbox create --detach\ne2b sandbox create base --detach\n```\n\nRun shell commands in a sandbox with `--` before shell flags so the CLI does not parse them:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'pwd && ls -la'\n```\n\nFor long-running processes, run them in the background and write a PID file in the sandbox:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'nohup python server.py >server.log 2>&1 & echo $! >server.pid'\n```\n\nThe CLI has explicit resume, but sandbox creation does not currently expose an auto-resume flag:\n\n```bash\ne2b sandbox resume <sandbox_id>\n```\n\nUse `sandbox exec` for operational commands against an existing sandbox:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'python --version'\ne2b sandbox exec <sandbox_id> -- bash -lc 'ls -la /tmp'\n```\n\n## JavaScript SDK\n\nUse `Sandbox.create()` with `E2B_API_KEY` for a fresh sandbox:\n\n```ts\nimport Sandbox from 'e2b'\n\nconst sandbox = await Sandbox.create('base')\nconst result = await sandbox.commands.run('echo \"hello from e2b\"')\nconsole.log(result.stdout)\n```\n\nUse lifecycle options when the sandbox should pause on timeout and resume on later activity:\n\n```ts\nconst sandbox = await Sandbox.create('base', {\n  lifecycle: { onTimeout: 'pause', autoResume: true },\n})\n```\n\nUse `Sandbox.connect()` when a CLI step already created the sandbox:\n\n```ts\nimport Sandbox from 'e2b'\n\nconst sandbox = await Sandbox.connect(process.env.SANDBOX_ID!)\nconst result = await sandbox.commands.run('cat important_file.md')\nconsole.log(result.stdout)\n```\n\n## Python SDK\n\nUse the context manager with `E2B_API_KEY` for short-lived tasks:\n\n```py\nfrom e2b import Sandbox\n\nwith Sandbox.create(\"base\") as sandbox:\n    result = sandbox.commands.run('echo \"hello from e2b\"')\n    print(result.stdout)\n```\n\nUse lifecycle options when the sandbox should pause on timeout and resume on later activity:\n\n```py\nsandbox = Sandbox.create(\n    \"base\",\n    lifecycle={\"on_timeout\": \"pause\", \"auto_resume\": True},\n)\n```\n\nFor workflows that share a sandbox across steps, keep the sandbox ID and connect to it later:\n\n```py\nfrom e2b import Sandbox\n\nsandbox = Sandbox.connect(sandbox_id)\nresult = sandbox.commands.run(\"cat important_file.md\")\nprint(result.stdout)\n```\n\n## Practical Defaults\n\n- Use the `base` template unless a task requires a specific template.\n- Prefer `bash -lc` for multi-command CLI execution.\n- Put temporary files under `/tmp` or the current working directory inside the sandbox unless the task requires a specific path.\n- For workloads that need code execution with `run_code` or `runCode`, use the Code Interpreter SDK.\n"},"files":{"AGENTS.md":"CLAUDE.md","CLAUDE.md":"Use pnpm for node and uv for python to install and update dependencies.\nRun `pnpm run format`, `pnpm run lint` and `pnpm run typecheck` before committing changes.\nWhen modifying the SDK packages, ensure equivalent changes are applied to both JS as well as sync and async Python implementations.\nNever edit the API, envd, or volume-content specs in spec/ by hand; they are synced with Copybara from e2b-dev/runtime and e2b-dev/belt at the commits pinned in spec/runtime-ref and spec/belt-ref (see copy.bara.sky and spec/README.md). To update the specs, bump the pins and re-run `make codegen`, which re-fetches them before generating.\nCreate or update tests covering affected codepaths and run them using `pnpm run test`.\nGenerate a changeset with `pnpm changeset` in the repository root when changing the public surface of packages/cli, packages/js-sdk, or packages/python-sdk; internal scripts, devtools, and tests don't need one.\nWhen creating a pull request, add usage examples for user-facing changes to the PR description.\nWhen opening a new pull request, use the Linear MCP if available to link to related issues, or create a new issue from the PR description.\nKeep PR descriptions up-to-date with changes.\nDefault credentials are stored in .env.local in the repository root or inside ~/.e2b/config.json.\n","packages/cli/README.md":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n# E2B CLI\n\nThis CLI tool allows you to build manager your running E2B sandbox and sandbox templates. Learn more in [our documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli).\n\n### 1. Install the CLI\n\n**Using Homebrew (on macOS)**\n\n```bash\nbrew install e2b\n```\n\n**Using NPM**\n\n```bash\nnpm install -g @e2b/cli\n```\n\n### 2. Authenticate\n\n```bash\ne2b auth login\n```\n\n> [!NOTE]\n> To authenticate without the ability to open the browser (e.g. in CI/CD),\n> provide `E2B_API_KEY` as an environment variable. You can find your API key\n> in the [API Keys](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli) tab in the E2B dashboard.\n> Then use the CLI like this: `E2B_API_KEY=e2b_... e2b template create`.\n\n### 3. Check out docs\n\nVisit our [CLI documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli) to learn more.\n","packages/code-interpreter-js/README.md":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://www.npmjs.com/package/e2b\">\n    <img alt=\"Last 1 month downloads for the JavaScript SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/npm/dm/e2b?label=NPM%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter) is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).\n\nSource: [packages/code-interpreter-js](https://github.com/e2b-dev/E2B/tree/main/packages/code-interpreter-js)\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\nnpm i @e2b/code-interpreter\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n3. Set environment variable with your API key.\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Execute code with code interpreter inside Sandbox\n\n```ts\nimport { Sandbox } from '@e2b/code-interpreter'\n\nconst sbx = await Sandbox.create()\nawait sbx.runCode('x = 1')\n\nconst execution = await sbx.runCode('x+=1; x')\nconsole.log(execution.text)  // outputs 2\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```ts\nimport { E2B } from '@e2b/code-interpreter'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst sbx = await client.Sandbox.create()\nconst execution = await sbx.runCode('x = 1; x += 1; x')\n\n// The core resources are bound to the client's configuration as well.\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n\n### 6. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","packages/code-interpreter-python/README.md":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://pypi.org/project/e2b/\">\n    <img alt=\"Last 1 month downloads for the Python SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/pypi/dm/e2b?label=PyPI%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter) is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).\n\nSource: [packages/code-interpreter-python](https://github.com/e2b-dev/E2B/tree/main/packages/code-interpreter-python)\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\npip install e2b-code-interpreter\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n3. Set environment variable with your API key.\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Execute code with code interpreter inside Sandbox\n\n```py\nfrom e2b_code_interpreter import Sandbox\n\nwith Sandbox.create() as sandbox:\n    sandbox.run_code(\"x = 1\")\n    execution = sandbox.run_code(\"x+=1; x\")\n    print(execution.text)  # outputs 2\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` and `AsyncSandbox` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```py\nfrom e2b_code_interpreter import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\nwith client.Sandbox.create() as sandbox:\n    execution = sandbox.run_code(\"x = 1; x += 1; x\")\n\n# The async variant is exposed as well.\nasync_sandbox = await client.AsyncSandbox.create()\n\n# The core resources are bound to the client's configuration as well.\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n\n### 6. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","packages/desktop-js/README.md":"# E2B Desktop Sandbox - Virtual Computer for Computer Use\n\nE2B Desktop Sandbox is a secure virtual desktop ready for Computer Use. Powered by [E2B](https://e2b.dev).\n\nEach sandbox is isolated from the others and can be customized with any dependencies you want.\n\n![Desktop Sandbox](https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/packages/desktop-python/screenshot.png)\n\nSource: [packages/desktop-js](https://github.com/e2b-dev/E2B/tree/main/packages/desktop-js)\n\n## Examples\n\nCheck out the [example open-source app](https://github.com/e2b-dev/open-computer-use) in a separate repository.\n\n## 🚀 Getting started\n\nThe E2B Desktop Sandbox is built on top of [E2B Sandbox](https://e2b.dev/docs).\n\n### 1. Get E2B API key\n\nSign up at [E2B](https://e2b.dev) and get your API key.\nSet environment variable `E2B_API_KEY` with your API key.\n\n### 2. Install SDK\n\n```bash\nnpm install @e2b/desktop\n```\n\n### 3. Create Desktop Sandbox\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\n// Start a new desktop sandbox\nconst desktop = await Sandbox.create()\n\n// Launch an application\nawait desktop.launch('google-chrome') // or vscode, firefox, etc.\n\n// Wait 10s for the application to open\nawait desktop.wait(10000)\n\n// Stream the application's window\n// Note: there can be only one stream at a time\n// You need to stop the current stream before streaming another application\nawait desktop.stream.start({\n  windowId: await desktop.getCurrentWindowId(), // if not provided the whole desktop will be streamed\n  requireAuth: true,\n})\n\n// Get the stream auth key\nconst authKey = desktop.stream.getAuthKey()\n\n// Print the stream URL\nconsole.log('Stream URL:', desktop.stream.getUrl({ authKey }))\n\n// Kill the sandbox after the tasks are finished\n// await desktop.kill()\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```javascript\nimport { E2B } from '@e2b/desktop'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst desktop = await client.Sandbox.create()\nawait desktop.stream.start()\n\n// The core resources are bound to the client's configuration as well.\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n## Features\n\n### Streaming desktop's screen\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Start the stream\nawait desktop.stream.start()\n\n// Get stream URL\nconst url = desktop.stream.getUrl()\nconsole.log(url)\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Streaming with password protection\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Start the stream\nawait desktop.stream.start({\n  requireAuth: true, // Enable authentication with an auto-generated key\n})\n\n// Retrieve the authentication key\nconst authKey = await desktop.stream.getAuthKey()\n\n// Get stream URL\nconst url = desktop.stream.getUrl({ authKey })\nconsole.log(url)\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Streaming specific application\n\n> [!WARNING]\n>\n> - Will throw an error if the desired application is not open yet\n> - The stream will close once the application closes\n> - Creating multiple streams at the same time is not supported, you may have to stop the current stream and start a new one for each application\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Get current (active) window ID\nconst windowId = await desktop.getCurrentWindowId()\n\n// Get all windows of the application\nconst windowIds = await desktop.getApplicationWindows('Firefox')\n\n// Start the stream\nawait desktop.stream.start({ windowId: windowIds[0] })\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Mouse control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\nawait desktop.doubleClick()\nawait desktop.leftClick()\nawait desktop.leftClick(100, 200)\nawait desktop.rightClick()\nawait desktop.rightClick(100, 200)\nawait desktop.middleClick()\nawait desktop.middleClick(100, 200)\nawait desktop.scroll(10) // Scroll by the amount. Positive for up, negative for down.\nawait desktop.moveMouse(100, 200) // Move to x, y coordinates\nawait desktop.drag([100, 100], [200, 200]) // Drag using the mouse\nawait desktop.mousePress('left') // Press the mouse button\nawait desktop.mouseRelease('left') // Release the mouse button\n```\n\n### Keyboard control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Write text at the current cursor position with customizable typing speed\nawait desktop.write('Hello, world!')\nawait desktop.write('Fast typing!', { chunkSize: 50, delayInMs: 25 }) // Faster typing\n\n// Press keys\nawait desktop.press('enter')\nawait desktop.press('space')\nawait desktop.press('backspace')\nawait desktop.press(['ctrl', 'c']) // Key combination\n```\n\n### Window control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Get current (active) window ID\nconst windowId = await desktop.getCurrentWindowId()\n\n// Get all windows of the application\nconst windowIds = await desktop.getApplicationWindows('Firefox')\n\n// Get window title\nconst title = await desktop.getWindowTitle(windowId)\n```\n\n### Screenshot\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\nconst image = await desktop.screenshot()\n// Save the image to a file\nfs.writeFileSync('screenshot.png', image)\n```\n\n### Open file\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Open file with default application\nawait desktop.files.write('/home/user/index.js', \"console.log('hello')\") // First create the file\nawait desktop.open('/home/user/index.js') // Then open it\n```\n\n### Launch applications\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Launch the application\nawait desktop.launch('google-chrome')\n```\n\n### Run any bash commands\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Run any bash command\nconst out = await desktop.commands.run('ls -la /home/user')\nconsole.log(out)\n```\n\n### Wait\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\nawait desktop.wait(1000) // Wait for 1 second\n```\n\n## Under the hood\n\nThe desktop-like environment is based on Linux and [Xfce](https://www.xfce.org/) at the moment. We chose Xfce because it's a fast and lightweight environment that's also popular and actively supported. However, this Sandbox template is fully customizable and you can create your own desktop environment.\nCheck out the sandbox template's code [here](https://github.com/e2b-dev/desktop/tree/main/template).\n","packages/desktop-python/README.md":"# E2B Desktop Sandbox - Virtual Computer for Computer Use\n\nE2B Desktop Sandbox is a secure virtual desktop ready for Computer Use. Powered by [E2B](https://e2b.dev).\n\nEach sandbox is isolated from the others and can be customized with any dependencies you want.\n\n![Desktop Sandbox](https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/packages/desktop-python/screenshot.png)\n\nSource: [packages/desktop-python](https://github.com/e2b-dev/E2B/tree/main/packages/desktop-python)\n\n## Examples\n\nCheck out the [example open-source app](https://github.com/e2b-dev/open-computer-use) in a separate repository.\n\n## 🚀 Getting started\n\nThe E2B Desktop Sandbox is built on top of [E2B Sandbox](https://e2b.dev/docs).\n\n### 1. Get E2B API key\n\nSign up at [E2B](https://e2b.dev) and get your API key.\nSet environment variable `E2B_API_KEY` with your API key.\n\n### 2. Install SDK\n\n```bash\npip install e2b-desktop\n```\n\n### 3. Create Desktop Sandbox\n\n```python\nfrom e2b_desktop import Sandbox\n\n# Create a new desktop sandbox\ndesktop = Sandbox.create()\n\n# Launch an application\ndesktop.launch('google-chrome')  # or vscode, firefox, etc.\n\n# Wait 10s for the application to open\ndesktop.wait(10000)\n\n# Stream the application's window\n# Note: There can be only one stream at a time\n# You need to stop the current stream before streaming another application\ndesktop.stream.start(\n    window_id=desktop.get_current_window_id(), # if not provided the whole desktop will be streamed\n    require_auth=True\n)\n\n# Get the stream auth key\nauth_key = desktop.stream.get_auth_key()\n\n# Print the stream URL\nprint('Stream URL:', desktop.stream.get_url(auth_key=auth_key))\n\n# Kill the sandbox after the tasks are finished\n# desktop.kill()\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```python\nfrom e2b_desktop import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\ndesktop = client.Sandbox.create()\ndesktop.stream.start()\n\n# The core resources are bound to the client's configuration as well.\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n## Features\n\n### Streaming desktop's screen\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Start the stream\ndesktop.stream.start()\n\n# Get stream URL\nurl = desktop.stream.get_url()\nprint(url)\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Streaming with password protection\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Start the stream\ndesktop.stream.start(\n    require_auth=True  # Enable authentication with an auto-generated key\n)\n\n# Retrieve the authentication key\nauth_key = desktop.stream.get_auth_key()\n\n# Get stream URL\nurl = desktop.stream.get_url(auth_key=auth_key)\nprint(url)\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Streaming specific application\n\n> [!WARNING]\n>\n> - Will raise an error if the desired application is not open yet\n> - The stream will close once the application closes\n> - Creating multiple streams at the same time is not supported, you may have to stop the current stream and start a new one for each application\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Get current (active) window ID\nwindow_id = desktop.get_current_window_id()\n\n# Get all windows of the application\nwindow_ids = desktop.get_application_windows(\"Firefox\")\n\n# Start the stream\ndesktop.stream.start(window_id=window_ids[0])\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Mouse control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\ndesktop.double_click()\ndesktop.left_click()\ndesktop.left_click(x=100, y=200)\ndesktop.right_click()\ndesktop.right_click(x=100, y=200)\ndesktop.middle_click()\ndesktop.middle_click(x=100, y=200)\ndesktop.scroll(10) # Scroll by the amount. Positive for up, negative for down.\ndesktop.move_mouse(100, 200) # Move to x, y coordinates\ndesktop.drag((100, 100), (200, 200)) # Drag using the mouse\ndesktop.mouse_press(\"left\") # Press the mouse button\ndesktop.mouse_release(\"left\") # Release the mouse button\n```\n\n### Keyboard control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Write text at the current cursor position with customizable typing speed\ndesktop.write(\"Hello, world!\")  # Default: chunk_size=25, delay_in_ms=75\ndesktop.write(\"Fast typing!\", chunk_size=50, delay_in_ms=25)  # Faster typing\n\n# Press keys\ndesktop.press(\"enter\")\ndesktop.press(\"space\")\ndesktop.press(\"backspace\")\ndesktop.press([\"ctrl\", \"c\"]) # Key combination\n```\n\n### Window control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Get current (active) window ID\nwindow_id = desktop.get_current_window_id()\n\n# Get all windows of the application\nwindow_ids = desktop.get_application_windows(\"Firefox\")\n\n# Get window title\ntitle = desktop.get_window_title(window_id)\n```\n\n### Screenshot\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Take a screenshot and save it as \"screenshot.png\" locally\nimage = desktop.screenshot()\n# Save the image to a file\nwith open(\"screenshot.png\", \"wb\") as f:\n    f.write(image)\n```\n\n### Open file\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Open file with default application\ndesktop.files.write(\"/home/user/index.js\", \"console.log('hello')\") # First create the file\ndesktop.open(\"/home/user/index.js\") # Then open it\n```\n\n### Launch applications\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Launch the application\ndesktop.launch('google-chrome')\n```\n\n### Run any bash commands\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Run any bash command\nout = desktop.commands.run(\"ls -la /home/user\")\nprint(out)\n```\n\n### Wait\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\ndesktop.wait(1000) # Wait for 1 second\n```\n\n## Under the hood\n\nThe desktop-like environment is based on Linux and [Xfce](https://www.xfce.org/) at the moment. We chose Xfce because it's a fast and lightweight environment that's also popular and actively supported. However, this Sandbox template is fully customizable and you can create your own desktop environment.\nCheck out the sandbox template's code [here](https://github.com/e2b-dev/desktop/tree/main/template).\n","packages/dockerfile-utils-js/README.md":"# @e2b/dockerfile-utils\n\nDockerfile parser and shell lexer ported from [BuildKit](https://github.com/moby/buildkit/tree/master/frontend/dockerfile) and a `.dockerignore` matcher ported from [moby/patternmatcher](https://github.com/moby/patternmatcher), with no runtime dependencies. Used by the [E2B SDK](https://www.npmjs.com/package/e2b) to implement `Template.fromDockerfile` and to filter the build context.\n\n```ts\nimport { parseDockerfileAst, ShellLex } from '@e2b/dockerfile-utils'\n\nconst ast = parseDockerfileAst(`\nFROM node:24 AS build\nENV KEY=\"a  b\" OTHER=c\nRUN <<EOF\nnpm ci\nnpm run build\nEOF\n`)\n\nfor (const instruction of ast.instructions) {\n  console.log(instruction.name, instruction.flags, instruction.args)\n}\n\nconst lex = new ShellLex(ast.escapeToken)\nlex.processWords('KEY=\"a  b\" OTHER=c') // ['KEY=a  b', 'OTHER=c']\n```\n\n`parseDockerfileAst` handles parser directives (`# escape=`, `# syntax=`), comments (including inside line continuations), builder flags, JSON/exec forms and heredocs, and reports line numbers and warnings. `ShellLex` splits and unquotes words the way BuildKit does, preserving `$VAR` / `${VAR:-default}` references for later expansion.\n\n```ts\nimport { PatternMatcher } from '@e2b/dockerfile-utils'\n\nconst matcher = new PatternMatcher(['node_modules', '*.log', '!keep.log'])\nmatcher.matches('node_modules/pkg/index.js') // true\nmatcher.matches('keep.log') // false\n```\n\n`PatternMatcher` applies `.dockerignore` semantics to slash-separated paths relative to the context root: a pattern matching a directory excludes everything under it, and `!` patterns re-include paths (the last matching pattern wins). An invalid pattern throws a plain `Error`.\n","packages/dockerfile-utils-python/README.md":"# e2b-dockerfile-utils\n\nDockerfile parser and shell lexer ported from [BuildKit](https://github.com/moby/buildkit/tree/master/frontend/dockerfile) and a `.dockerignore` matcher ported from [moby/patternmatcher](https://github.com/moby/patternmatcher), with no runtime dependencies. Used by the [E2B SDK](https://pypi.org/project/e2b/) to implement `Template.from_dockerfile` and to filter the build context.\n\n```python\nfrom e2b_dockerfile_utils import ShellLex, parse_dockerfile_ast\n\nast = parse_dockerfile_ast(\n    \"\"\"\nFROM node:24 AS build\nENV KEY=\"a  b\" OTHER=c\nRUN <<EOF\nnpm ci\nnpm run build\nEOF\n\"\"\"\n)\n\nfor instruction in ast.instructions:\n    print(instruction.name, instruction.flags, instruction.args)\n\nlex = ShellLex(ast.escape_token)\nlex.process_words('KEY=\"a  b\" OTHER=c')  # ['KEY=a  b', 'OTHER=c']\n```\n\n`parse_dockerfile_ast` handles parser directives (`# escape=`, `# syntax=`), comments (including inside line continuations), builder flags, JSON/exec forms and heredocs, and reports line numbers and warnings. `ShellLex` splits and unquotes words the way BuildKit does, preserving `$VAR` / `${VAR:-default}` references for later expansion.\n\n```python\nfrom e2b_dockerfile_utils import PatternMatcher\n\nmatcher = PatternMatcher([\"node_modules\", \"*.log\", \"!keep.log\"])\nmatcher.matches(\"node_modules/pkg/index.js\")  # True\nmatcher.matches(\"keep.log\")  # False\n```\n\n`PatternMatcher` applies `.dockerignore` semantics to slash-separated paths relative to the context root: a pattern matching a directory excludes everything under it, and `!` patterns re-include paths (the last matching pattern wins). An invalid pattern raises a plain `ValueError`.\n","packages/js-sdk/README.md":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">  \n  <a href=\"https://www.npmjs.com/package/e2b\">\n    <img alt=\"Last 1 month downloads for the JavaScript SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/npm/dm/e2b?label=NPM%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```bash\nnpm i e2b\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n3. Set environment variable with your API key\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Start a sandbox and run commands\n\n```ts\nimport { Sandbox } from 'e2b'\n\nconst sandbox = await Sandbox.create()\nconst result = await sandbox.commands.run('echo \"Hello from E2B!\"')\nconsole.log(result.stdout) // Hello from E2B!\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox`, `Volume`, `Template` and `Secret` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```ts\nimport { E2B } from 'e2b'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst sandbox = await client.Sandbox.create()\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Code execution with Code Interpreter\n\nIf you need [`runCode()`](https://docs.e2b.dev/code-interpreting/analyze-data-with-ai?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b), install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):\n\n```bash\nnpm i @e2b/code-interpreter\n```\n\n```ts\nimport { Sandbox } from '@e2b/code-interpreter'\n\nconst sandbox = await Sandbox.create()\nconst execution = await sandbox.runCode('x = 1; x += 1; x')\nconsole.log(execution.text)  // outputs 2\n```\n\n### 6. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n\n### 7. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","packages/python-sdk/README.md":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://pypi.org/project/e2b/\">\n    <img alt=\"Last 1 month downloads for the Python SDK\" loading=\"lazy\" decoding=\"async\" style=\"color:transparent;width:170px;height:18px\" src=\"https://static.pepy.tech/personalized-badge/e2b?period=monthly&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=PyPi%20Monthly%20Downloads\">\n  </a>  \n</h4>\n\n\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\npip install e2b\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n3. Set environment variable with your API key\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Start a sandbox and run commands\n\n```py\nfrom e2b import Sandbox\n\nwith Sandbox.create() as sandbox:\n    result = sandbox.commands.run('echo \"Hello from E2B!\"')\n    print(result.stdout)  # Hello from E2B!\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox`, `AsyncSandbox`, `Volume`, `AsyncVolume`, `Template`, `AsyncTemplate` and `Secret` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```py\nfrom e2b import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\nsandbox = client.Sandbox.create()\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The async variants are exposed as well.\nasync_sandbox = await client.AsyncSandbox.create()\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n### High-concurrency sandbox streams\n\nSandbox `commands` and `files` traffic from all sandboxes in a process shares one HTTP/2 connection pool. Requests are spread over the pooled connections by free stream capacity, and a new connection is dialed only once every existing one is at the server's concurrent-stream limit (`100` for `sandbox.e2b.app`), up to `E2B_MAX_CONNECTIONS` connections per resolved address (default `200`). Past that cap, a request waits for a stream to free up. Long-running streams therefore never queue behind one connection's concurrent-stream limit, and idle processes keep a single connection.\n\n`E2B_MAX_CONNECTIONS` is read when `e2b` is imported:\n\n```sh\nE2B_MAX_CONNECTIONS=400 python eval.py\n```\n\n### 5. Code execution with Code Interpreter\n\nIf you need [`run_code()`](https://docs.e2b.dev/code-interpreting/analyze-data-with-ai?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b), install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):\n\n```\npip install e2b-code-interpreter\n```\n\n```py\nfrom e2b_code_interpreter import Sandbox\n\nwith Sandbox.create() as sandbox:\n    execution = sandbox.run_code(\"x = 1; x += 1; x\")\n    print(execution.text)  # outputs 2\n```\n\n### 6. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n\n### 7. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","skills/stripe-projects/SKILL.md":"---\nname: stripe-projects\ndescription: \"Use after E2B sandbox/API access has been provisioned through Stripe Projects and the user needs to use the resulting E2B API key with the E2B CLI, JavaScript SDK, Python SDK, or Code Interpreter SDK.\"\n---\n\n# E2B Stripe Projects\n\nUse these patterns after E2B sandbox/API access has been provisioned through Stripe Projects.\n\n## Credentials\n\n- Stripe Projects provisions E2B sandbox/API access and returns an E2B team API key.\n- Use that key as `E2B_API_KEY` for sandbox creation, sandbox control, and SDK clients.\n- Prefer setting `E2B_API_KEY` explicitly in runtime environments so commands and SDK calls use the intended E2B team.\n- Local defaults can also come from `.env.local` or `~/.e2b/config.json`.\n- In Stripe Projects checkouts, the E2B CLI may not be globally logged in. Before using `e2b sandbox ...`, prefer a Stripe Projects env pull plus per-command export instead of trying `e2b auth login`.\n- Do not print secret values. `stripe projects env --json` can return redacted placeholders, so do not use it as the source for a runnable `E2B_API_KEY`. Pull the managed env file, then read only the needed E2B variables into the command environment without echoing them.\n\n```bash\nstripe projects env --pull --yes\nenv_value() {\n  awk -F= -v key=\"$1\" '$1 == key {sub(/^[^=]*=/, \"\"); gsub(/^\"|\"$/, \"\"); print; exit}' .env\n}\nexport E2B_API_KEY=\"$(env_value E2B_API_KEY)\"\nexport E2B_API_URL=\"$(env_value E2B_API_URL)\"\nexport E2B_DOMAIN=\"$(env_value E2B_DOMAIN)\"\ne2b sandbox create base --detach\n```\n\n## Stripe Projects CLI\n\nAdd E2B to the current Stripe project:\n\n```bash\nstripe projects add e2b/sandboxes\n```\n\nInspect or pull provisioned credentials:\n\n```bash\nstripe projects env\nstripe projects env --json\nstripe projects env --pull --yes\n```\n\nExport the E2B API key before using the E2B CLI or SDK. Prefer `stripe projects env --pull --yes` for command execution because JSON output may redact secret values. Read only the variables you need from `.env`; do not source `.env` as shell code:\n\n```bash\nstripe projects env --pull --yes\nenv_value() {\n  awk -F= -v key=\"$1\" '$1 == key {sub(/^[^=]*=/, \"\"); gsub(/^\"|\"$/, \"\"); print; exit}' .env\n}\nexport E2B_API_KEY=\"$(env_value E2B_API_KEY)\"\nexport E2B_API_URL=\"$(env_value E2B_API_URL)\"\nexport E2B_DOMAIN=\"$(env_value E2B_DOMAIN)\"\n```\n\nUse `stripe projects env --json` for structure checks only. In current Stripe Projects output, the E2B variables are under `data.resource_access_configurations[].access_configuration`, including `E2B_API_KEY`, `E2B_API_URL`, and `E2B_DOMAIN`, but the values may be redacted and unusable for CLI/SDK calls.\n\n## E2B CLI\n\nIf the E2B CLI is missing or a shell shim is broken, install it with Node instead of switching to SDK code:\n\n```bash\nif ! e2b --version >/dev/null 2>&1; then\n  npm install -g @e2b/cli\nfi\n```\n\nThe CLI package requires Node 22 or newer.\n\nPrefer detached sandboxes for non-interactive work so the command returns a sandbox ID and does not attach an interactive terminal:\n\n```bash\ne2b sandbox create --detach\ne2b sandbox create base --detach\n```\n\nRun shell commands in a sandbox with `--` before shell flags so the CLI does not parse them:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'pwd && ls -la'\n```\n\nFor long-running processes, run them in the background and write a PID file in the sandbox:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'nohup python server.py >server.log 2>&1 & echo $! >server.pid'\n```\n\nThe CLI has explicit resume, but sandbox creation does not currently expose an auto-resume flag:\n\n```bash\ne2b sandbox resume <sandbox_id>\n```\n\nUse `sandbox exec` for operational commands against an existing sandbox:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'python --version'\ne2b sandbox exec <sandbox_id> -- bash -lc 'ls -la /tmp'\n```\n\n## JavaScript SDK\n\nUse `Sandbox.create()` with `E2B_API_KEY` for a fresh sandbox:\n\n```ts\nimport Sandbox from 'e2b'\n\nconst sandbox = await Sandbox.create('base')\nconst result = await sandbox.commands.run('echo \"hello from e2b\"')\nconsole.log(result.stdout)\n```\n\nUse lifecycle options when the sandbox should pause on timeout and resume on later activity:\n\n```ts\nconst sandbox = await Sandbox.create('base', {\n  lifecycle: { onTimeout: 'pause', autoResume: true },\n})\n```\n\nUse `Sandbox.connect()` when a CLI step already created the sandbox:\n\n```ts\nimport Sandbox from 'e2b'\n\nconst sandbox = await Sandbox.connect(process.env.SANDBOX_ID!)\nconst result = await sandbox.commands.run('cat important_file.md')\nconsole.log(result.stdout)\n```\n\n## Python SDK\n\nUse the context manager with `E2B_API_KEY` for short-lived tasks:\n\n```py\nfrom e2b import Sandbox\n\nwith Sandbox.create(\"base\") as sandbox:\n    result = sandbox.commands.run('echo \"hello from e2b\"')\n    print(result.stdout)\n```\n\nUse lifecycle options when the sandbox should pause on timeout and resume on later activity:\n\n```py\nsandbox = Sandbox.create(\n    \"base\",\n    lifecycle={\"on_timeout\": \"pause\", \"auto_resume\": True},\n)\n```\n\nFor workflows that share a sandbox across steps, keep the sandbox ID and connect to it later:\n\n```py\nfrom e2b import Sandbox\n\nsandbox = Sandbox.connect(sandbox_id)\nresult = sandbox.commands.run(\"cat important_file.md\")\nprint(result.stdout)\n```\n\n## Practical Defaults\n\n- Use the `base` template unless a task requires a specific template.\n- Prefer `bash -lc` for multi-command CLI execution.\n- Put temporary files under `/tmp` or the current working directory inside the sandbox unless the task requires a specific path.\n- For workloads that need code execution with `run_code` or `runCode`, use the Code Interpreter SDK.\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/AGENTS.md","title":"AI Agent Protocol & Instructions","category":"root-instruction","format":"markdown","content":"CLAUDE.md","isInternal":false,"tokens":4,"sizeBytes":9},{"name":"CLAUDE.md","path":"CLAUDE.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/CLAUDE.md","title":"Claude Agent Guidelines & System Prompt","category":"claude-rule","format":"markdown","content":"Use pnpm for node and uv for python to install and update dependencies.\nRun `pnpm run format`, `pnpm run lint` and `pnpm run typecheck` before committing changes.\nWhen modifying the SDK packages, ensure equivalent changes are applied to both JS as well as sync and async Python implementations.\nNever edit the API, envd, or volume-content specs in spec/ by hand; they are synced with Copybara from e2b-dev/runtime and e2b-dev/belt at the commits pinned in spec/runtime-ref and spec/belt-ref (see copy.bara.sky and spec/README.md). To update the specs, bump the pins and re-run `make codegen`, which re-fetches them before generating.\nCreate or update tests covering affected codepaths and run them using `pnpm run test`.\nGenerate a changeset with `pnpm changeset` in the repository root when changing the public surface of packages/cli, packages/js-sdk, or packages/python-sdk; internal scripts, devtools, and tests don't need one.\nWhen creating a pull request, add usage examples for user-facing changes to the PR description.\nWhen opening a new pull request, use the Linear MCP if available to link to related issues, or create a new issue from the PR description.\nKeep PR descriptions up-to-date with changes.\nDefault credentials are stored in .env.local in the repository root or inside ~/.e2b/config.json.\n","isInternal":false,"tokens":290,"sizeBytes":1311},{"name":"SKILL.md","path":"skills/stripe-projects/SKILL.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/skills/stripe-projects/SKILL.md","title":"stripe-projects","category":"anthropic-skill","format":"markdown","content":"---\nname: stripe-projects\ndescription: \"Use after E2B sandbox/API access has been provisioned through Stripe Projects and the user needs to use the resulting E2B API key with the E2B CLI, JavaScript SDK, Python SDK, or Code Interpreter SDK.\"\n---\n\n# E2B Stripe Projects\n\nUse these patterns after E2B sandbox/API access has been provisioned through Stripe Projects.\n\n## Credentials\n\n- Stripe Projects provisions E2B sandbox/API access and returns an E2B team API key.\n- Use that key as `E2B_API_KEY` for sandbox creation, sandbox control, and SDK clients.\n- Prefer setting `E2B_API_KEY` explicitly in runtime environments so commands and SDK calls use the intended E2B team.\n- Local defaults can also come from `.env.local` or `~/.e2b/config.json`.\n- In Stripe Projects checkouts, the E2B CLI may not be globally logged in. Before using `e2b sandbox ...`, prefer a Stripe Projects env pull plus per-command export instead of trying `e2b auth login`.\n- Do not print secret values. `stripe projects env --json` can return redacted placeholders, so do not use it as the source for a runnable `E2B_API_KEY`. Pull the managed env file, then read only the needed E2B variables into the command environment without echoing them.\n\n```bash\nstripe projects env --pull --yes\nenv_value() {\n  awk -F= -v key=\"$1\" '$1 == key {sub(/^[^=]*=/, \"\"); gsub(/^\"|\"$/, \"\"); print; exit}' .env\n}\nexport E2B_API_KEY=\"$(env_value E2B_API_KEY)\"\nexport E2B_API_URL=\"$(env_value E2B_API_URL)\"\nexport E2B_DOMAIN=\"$(env_value E2B_DOMAIN)\"\ne2b sandbox create base --detach\n```\n\n## Stripe Projects CLI\n\nAdd E2B to the current Stripe project:\n\n```bash\nstripe projects add e2b/sandboxes\n```\n\nInspect or pull provisioned credentials:\n\n```bash\nstripe projects env\nstripe projects env --json\nstripe projects env --pull --yes\n```\n\nExport the E2B API key before using the E2B CLI or SDK. Prefer `stripe projects env --pull --yes` for command execution because JSON output may redact secret values. Read only the variables you need from `.env`; do not source `.env` as shell code:\n\n```bash\nstripe projects env --pull --yes\nenv_value() {\n  awk -F= -v key=\"$1\" '$1 == key {sub(/^[^=]*=/, \"\"); gsub(/^\"|\"$/, \"\"); print; exit}' .env\n}\nexport E2B_API_KEY=\"$(env_value E2B_API_KEY)\"\nexport E2B_API_URL=\"$(env_value E2B_API_URL)\"\nexport E2B_DOMAIN=\"$(env_value E2B_DOMAIN)\"\n```\n\nUse `stripe projects env --json` for structure checks only. In current Stripe Projects output, the E2B variables are under `data.resource_access_configurations[].access_configuration`, including `E2B_API_KEY`, `E2B_API_URL`, and `E2B_DOMAIN`, but the values may be redacted and unusable for CLI/SDK calls.\n\n## E2B CLI\n\nIf the E2B CLI is missing or a shell shim is broken, install it with Node instead of switching to SDK code:\n\n```bash\nif ! e2b --version >/dev/null 2>&1; then\n  npm install -g @e2b/cli\nfi\n```\n\nThe CLI package requires Node 22 or newer.\n\nPrefer detached sandboxes for non-interactive work so the command returns a sandbox ID and does not attach an interactive terminal:\n\n```bash\ne2b sandbox create --detach\ne2b sandbox create base --detach\n```\n\nRun shell commands in a sandbox with `--` before shell flags so the CLI does not parse them:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'pwd && ls -la'\n```\n\nFor long-running processes, run them in the background and write a PID file in the sandbox:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'nohup python server.py >server.log 2>&1 & echo $! >server.pid'\n```\n\nThe CLI has explicit resume, but sandbox creation does not currently expose an auto-resume flag:\n\n```bash\ne2b sandbox resume <sandbox_id>\n```\n\nUse `sandbox exec` for operational commands against an existing sandbox:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'python --version'\ne2b sandbox exec <sandbox_id> -- bash -lc 'ls -la /tmp'\n```\n\n## JavaScript SDK\n\nUse `Sandbox.create()` with `E2B_API_KEY` for a fresh sandbox:\n\n```ts\nimport Sandbox from 'e2b'\n\nconst sandbox = await Sandbox.create('base')\nconst result = await sandbox.commands.run('echo \"hello from e2b\"')\nconsole.log(result.stdout)\n```\n\nUse lifecycle options when the sandbox should pause on timeout and resume on later activity:\n\n```ts\nconst sandbox = await Sandbox.create('base', {\n  lifecycle: { onTimeout: 'pause', autoResume: true },\n})\n```\n\nUse `Sandbox.connect()` when a CLI step already created the sandbox:\n\n```ts\nimport Sandbox from 'e2b'\n\nconst sandbox = await Sandbox.connect(process.env.SANDBOX_ID!)\nconst result = await sandbox.commands.run('cat important_file.md')\nconsole.log(result.stdout)\n```\n\n## Python SDK\n\nUse the context manager with `E2B_API_KEY` for short-lived tasks:\n\n```py\nfrom e2b import Sandbox\n\nwith Sandbox.create(\"base\") as sandbox:\n    result = sandbox.commands.run('echo \"hello from e2b\"')\n    print(result.stdout)\n```\n\nUse lifecycle options when the sandbox should pause on timeout and resume on later activity:\n\n```py\nsandbox = Sandbox.create(\n    \"base\",\n    lifecycle={\"on_timeout\": \"pause\", \"auto_resume\": True},\n)\n```\n\nFor workflows that share a sandbox across steps, keep the sandbox ID and connect to it later:\n\n```py\nfrom e2b import Sandbox\n\nsandbox = Sandbox.connect(sandbox_id)\nresult = sandbox.commands.run(\"cat important_file.md\")\nprint(result.stdout)\n```\n\n## Practical Defaults\n\n- Use the `base` template unless a task requires a specific template.\n- Prefer `bash -lc` for multi-command CLI execution.\n- Put temporary files under `/tmp` or the current working directory inside the sandbox unless the task requires a specific path.\n- For workloads that need code execution with `run_code` or `runCode`, use the Code Interpreter SDK.\n","frontmatter":{"name":"stripe-projects","description":"Use after E2B sandbox/API access has been provisioned through Stripe Projects and the user needs to use the resulting E2B API key with the E2B CLI, JavaScript SDK, Python SDK, or Code Interpreter SDK."},"isInternal":false,"tokens":1422,"sizeBytes":5618},{"name":"README.md","path":"packages/cli/README.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/packages/cli/README.md","title":"cli Documentation","category":"plugin-manifest","format":"markdown","content":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n# E2B CLI\n\nThis CLI tool allows you to build manager your running E2B sandbox and sandbox templates. Learn more in [our documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli).\n\n### 1. Install the CLI\n\n**Using Homebrew (on macOS)**\n\n```bash\nbrew install e2b\n```\n\n**Using NPM**\n\n```bash\nnpm install -g @e2b/cli\n```\n\n### 2. Authenticate\n\n```bash\ne2b auth login\n```\n\n> [!NOTE]\n> To authenticate without the ability to open the browser (e.g. in CI/CD),\n> provide `E2B_API_KEY` as an environment variable. You can find your API key\n> in the [API Keys](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli) tab in the E2B dashboard.\n> Then use the CLI like this: `E2B_API_KEY=e2b_... e2b template create`.\n\n### 3. Check out docs\n\nVisit our [CLI documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli) to learn more.\n","isInternal":false,"tokens":422,"sizeBytes":1466},{"name":"README.md","path":"packages/code-interpreter-js/README.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/packages/code-interpreter-js/README.md","title":"code-interpreter-js Documentation","category":"plugin-manifest","format":"markdown","content":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://www.npmjs.com/package/e2b\">\n    <img alt=\"Last 1 month downloads for the JavaScript SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/npm/dm/e2b?label=NPM%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter) is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).\n\nSource: [packages/code-interpreter-js](https://github.com/e2b-dev/E2B/tree/main/packages/code-interpreter-js)\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\nnpm i @e2b/code-interpreter\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n3. Set environment variable with your API key.\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Execute code with code interpreter inside Sandbox\n\n```ts\nimport { Sandbox } from '@e2b/code-interpreter'\n\nconst sbx = await Sandbox.create()\nawait sbx.runCode('x = 1')\n\nconst execution = await sbx.runCode('x+=1; x')\nconsole.log(execution.text)  // outputs 2\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```ts\nimport { E2B } from '@e2b/code-interpreter'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst sbx = await client.Sandbox.create()\nconst execution = await sbx.runCode('x = 1; x += 1; x')\n\n// The core resources are bound to the client's configuration as well.\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n\n### 6. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","isInternal":false,"tokens":946,"sizeBytes":3490},{"name":"README.md","path":"packages/code-interpreter-python/README.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/packages/code-interpreter-python/README.md","title":"code-interpreter-python Documentation","category":"plugin-manifest","format":"markdown","content":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://pypi.org/project/e2b/\">\n    <img alt=\"Last 1 month downloads for the Python SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/pypi/dm/e2b?label=PyPI%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter) is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).\n\nSource: [packages/code-interpreter-python](https://github.com/e2b-dev/E2B/tree/main/packages/code-interpreter-python)\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\npip install e2b-code-interpreter\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n3. Set environment variable with your API key.\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Execute code with code interpreter inside Sandbox\n\n```py\nfrom e2b_code_interpreter import Sandbox\n\nwith Sandbox.create() as sandbox:\n    sandbox.run_code(\"x = 1\")\n    execution = sandbox.run_code(\"x+=1; x\")\n    print(execution.text)  # outputs 2\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` and `AsyncSandbox` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```py\nfrom e2b_code_interpreter import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\nwith client.Sandbox.create() as sandbox:\n    execution = sandbox.run_code(\"x = 1; x += 1; x\")\n\n# The async variant is exposed as well.\nasync_sandbox = await client.AsyncSandbox.create()\n\n# The core resources are bound to the client's configuration as well.\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n\n### 6. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","isInternal":false,"tokens":950,"sizeBytes":3546},{"name":"README.md","path":"packages/desktop-js/README.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/packages/desktop-js/README.md","title":"desktop-js Documentation","category":"plugin-manifest","format":"markdown","content":"# E2B Desktop Sandbox - Virtual Computer for Computer Use\n\nE2B Desktop Sandbox is a secure virtual desktop ready for Computer Use. Powered by [E2B](https://e2b.dev).\n\nEach sandbox is isolated from the others and can be customized with any dependencies you want.\n\n![Desktop Sandbox](https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/packages/desktop-python/screenshot.png)\n\nSource: [packages/desktop-js](https://github.com/e2b-dev/E2B/tree/main/packages/desktop-js)\n\n## Examples\n\nCheck out the [example open-source app](https://github.com/e2b-dev/open-computer-use) in a separate repository.\n\n## 🚀 Getting started\n\nThe E2B Desktop Sandbox is built on top of [E2B Sandbox](https://e2b.dev/docs).\n\n### 1. Get E2B API key\n\nSign up at [E2B](https://e2b.dev) and get your API key.\nSet environment variable `E2B_API_KEY` with your API key.\n\n### 2. Install SDK\n\n```bash\nnpm install @e2b/desktop\n```\n\n### 3. Create Desktop Sandbox\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\n// Start a new desktop sandbox\nconst desktop = await Sandbox.create()\n\n// Launch an application\nawait desktop.launch('google-chrome') // or vscode, firefox, etc.\n\n// Wait 10s for the application to open\nawait desktop.wait(10000)\n\n// Stream the application's window\n// Note: there can be only one stream at a time\n// You need to stop the current stream before streaming another application\nawait desktop.stream.start({\n  windowId: await desktop.getCurrentWindowId(), // if not provided the whole desktop will be streamed\n  requireAuth: true,\n})\n\n// Get the stream auth key\nconst authKey = desktop.stream.getAuthKey()\n\n// Print the stream URL\nconsole.log('Stream URL:', desktop.stream.getUrl({ authKey }))\n\n// Kill the sandbox after the tasks are finished\n// await desktop.kill()\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```javascript\nimport { E2B } from '@e2b/desktop'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst desktop = await client.Sandbox.create()\nawait desktop.stream.start()\n\n// The core resources are bound to the client's configuration as well.\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n## Features\n\n### Streaming desktop's screen\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Start the stream\nawait desktop.stream.start()\n\n// Get stream URL\nconst url = desktop.stream.getUrl()\nconsole.log(url)\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Streaming with password protection\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Start the stream\nawait desktop.stream.start({\n  requireAuth: true, // Enable authentication with an auto-generated key\n})\n\n// Retrieve the authentication key\nconst authKey = await desktop.stream.getAuthKey()\n\n// Get stream URL\nconst url = desktop.stream.getUrl({ authKey })\nconsole.log(url)\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Streaming specific application\n\n> [!WARNING]\n>\n> - Will throw an error if the desired application is not open yet\n> - The stream will close once the application closes\n> - Creating multiple streams at the same time is not supported, you may have to stop the current stream and start a new one for each application\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Get current (active) window ID\nconst windowId = await desktop.getCurrentWindowId()\n\n// Get all windows of the application\nconst windowIds = await desktop.getApplicationWindows('Firefox')\n\n// Start the stream\nawait desktop.stream.start({ windowId: windowIds[0] })\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Mouse control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\nawait desktop.doubleClick()\nawait desktop.leftClick()\nawait desktop.leftClick(100, 200)\nawait desktop.rightClick()\nawait desktop.rightClick(100, 200)\nawait desktop.middleClick()\nawait desktop.middleClick(100, 200)\nawait desktop.scroll(10) // Scroll by the amount. Positive for up, negative for down.\nawait desktop.moveMouse(100, 200) // Move to x, y coordinates\nawait desktop.drag([100, 100], [200, 200]) // Drag using the mouse\nawait desktop.mousePress('left') // Press the mouse button\nawait desktop.mouseRelease('left') // Release the mouse button\n```\n\n### Keyboard control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Write text at the current cursor position with customizable typing speed\nawait desktop.write('Hello, world!')\nawait desktop.write('Fast typing!', { chunkSize: 50, delayInMs: 25 }) // Faster typing\n\n// Press keys\nawait desktop.press('enter')\nawait desktop.press('space')\nawait desktop.press('backspace')\nawait desktop.press(['ctrl', 'c']) // Key combination\n```\n\n### Window control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Get current (active) window ID\nconst windowId = await desktop.getCurrentWindowId()\n\n// Get all windows of the application\nconst windowIds = await desktop.getApplicationWindows('Firefox')\n\n// Get window title\nconst title = await desktop.getWindowTitle(windowId)\n```\n\n### Screenshot\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\nconst image = await desktop.screenshot()\n// Save the image to a file\nfs.writeFileSync('screenshot.png', image)\n```\n\n### Open file\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Open file with default application\nawait desktop.files.write('/home/user/index.js', \"console.log('hello')\") // First create the file\nawait desktop.open('/home/user/index.js') // Then open it\n```\n\n### Launch applications\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Launch the application\nawait desktop.launch('google-chrome')\n```\n\n### Run any bash commands\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Run any bash command\nconst out = await desktop.commands.run('ls -la /home/user')\nconsole.log(out)\n```\n\n### Wait\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\nawait desktop.wait(1000) // Wait for 1 second\n```\n\n## Under the hood\n\nThe desktop-like environment is based on Linux and [Xfce](https://www.xfce.org/) at the moment. We chose Xfce because it's a fast and lightweight environment that's also popular and actively supported. However, this Sandbox template is fully customizable and you can create your own desktop environment.\nCheck out the sandbox template's code [here](https://github.com/e2b-dev/desktop/tree/main/template).\n","isInternal":false,"tokens":1686,"sizeBytes":7359},{"name":"README.md","path":"packages/desktop-python/README.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/packages/desktop-python/README.md","title":"desktop-python Documentation","category":"plugin-manifest","format":"markdown","content":"# E2B Desktop Sandbox - Virtual Computer for Computer Use\n\nE2B Desktop Sandbox is a secure virtual desktop ready for Computer Use. Powered by [E2B](https://e2b.dev).\n\nEach sandbox is isolated from the others and can be customized with any dependencies you want.\n\n![Desktop Sandbox](https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/packages/desktop-python/screenshot.png)\n\nSource: [packages/desktop-python](https://github.com/e2b-dev/E2B/tree/main/packages/desktop-python)\n\n## Examples\n\nCheck out the [example open-source app](https://github.com/e2b-dev/open-computer-use) in a separate repository.\n\n## 🚀 Getting started\n\nThe E2B Desktop Sandbox is built on top of [E2B Sandbox](https://e2b.dev/docs).\n\n### 1. Get E2B API key\n\nSign up at [E2B](https://e2b.dev) and get your API key.\nSet environment variable `E2B_API_KEY` with your API key.\n\n### 2. Install SDK\n\n```bash\npip install e2b-desktop\n```\n\n### 3. Create Desktop Sandbox\n\n```python\nfrom e2b_desktop import Sandbox\n\n# Create a new desktop sandbox\ndesktop = Sandbox.create()\n\n# Launch an application\ndesktop.launch('google-chrome')  # or vscode, firefox, etc.\n\n# Wait 10s for the application to open\ndesktop.wait(10000)\n\n# Stream the application's window\n# Note: There can be only one stream at a time\n# You need to stop the current stream before streaming another application\ndesktop.stream.start(\n    window_id=desktop.get_current_window_id(), # if not provided the whole desktop will be streamed\n    require_auth=True\n)\n\n# Get the stream auth key\nauth_key = desktop.stream.get_auth_key()\n\n# Print the stream URL\nprint('Stream URL:', desktop.stream.get_url(auth_key=auth_key))\n\n# Kill the sandbox after the tasks are finished\n# desktop.kill()\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```python\nfrom e2b_desktop import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\ndesktop = client.Sandbox.create()\ndesktop.stream.start()\n\n# The core resources are bound to the client's configuration as well.\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n## Features\n\n### Streaming desktop's screen\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Start the stream\ndesktop.stream.start()\n\n# Get stream URL\nurl = desktop.stream.get_url()\nprint(url)\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Streaming with password protection\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Start the stream\ndesktop.stream.start(\n    require_auth=True  # Enable authentication with an auto-generated key\n)\n\n# Retrieve the authentication key\nauth_key = desktop.stream.get_auth_key()\n\n# Get stream URL\nurl = desktop.stream.get_url(auth_key=auth_key)\nprint(url)\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Streaming specific application\n\n> [!WARNING]\n>\n> - Will raise an error if the desired application is not open yet\n> - The stream will close once the application closes\n> - Creating multiple streams at the same time is not supported, you may have to stop the current stream and start a new one for each application\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Get current (active) window ID\nwindow_id = desktop.get_current_window_id()\n\n# Get all windows of the application\nwindow_ids = desktop.get_application_windows(\"Firefox\")\n\n# Start the stream\ndesktop.stream.start(window_id=window_ids[0])\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Mouse control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\ndesktop.double_click()\ndesktop.left_click()\ndesktop.left_click(x=100, y=200)\ndesktop.right_click()\ndesktop.right_click(x=100, y=200)\ndesktop.middle_click()\ndesktop.middle_click(x=100, y=200)\ndesktop.scroll(10) # Scroll by the amount. Positive for up, negative for down.\ndesktop.move_mouse(100, 200) # Move to x, y coordinates\ndesktop.drag((100, 100), (200, 200)) # Drag using the mouse\ndesktop.mouse_press(\"left\") # Press the mouse button\ndesktop.mouse_release(\"left\") # Release the mouse button\n```\n\n### Keyboard control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Write text at the current cursor position with customizable typing speed\ndesktop.write(\"Hello, world!\")  # Default: chunk_size=25, delay_in_ms=75\ndesktop.write(\"Fast typing!\", chunk_size=50, delay_in_ms=25)  # Faster typing\n\n# Press keys\ndesktop.press(\"enter\")\ndesktop.press(\"space\")\ndesktop.press(\"backspace\")\ndesktop.press([\"ctrl\", \"c\"]) # Key combination\n```\n\n### Window control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Get current (active) window ID\nwindow_id = desktop.get_current_window_id()\n\n# Get all windows of the application\nwindow_ids = desktop.get_application_windows(\"Firefox\")\n\n# Get window title\ntitle = desktop.get_window_title(window_id)\n```\n\n### Screenshot\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Take a screenshot and save it as \"screenshot.png\" locally\nimage = desktop.screenshot()\n# Save the image to a file\nwith open(\"screenshot.png\", \"wb\") as f:\n    f.write(image)\n```\n\n### Open file\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Open file with default application\ndesktop.files.write(\"/home/user/index.js\", \"console.log('hello')\") # First create the file\ndesktop.open(\"/home/user/index.js\") # Then open it\n```\n\n### Launch applications\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Launch the application\ndesktop.launch('google-chrome')\n```\n\n### Run any bash commands\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Run any bash command\nout = desktop.commands.run(\"ls -la /home/user\")\nprint(out)\n```\n\n### Wait\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\ndesktop.wait(1000) # Wait for 1 second\n```\n\n## Under the hood\n\nThe desktop-like environment is based on Linux and [Xfce](https://www.xfce.org/) at the moment. We chose Xfce because it's a fast and lightweight environment that's also popular and actively supported. However, this Sandbox template is fully customizable and you can create your own desktop environment.\nCheck out the sandbox template's code [here](https://github.com/e2b-dev/desktop/tree/main/template).\n","isInternal":false,"tokens":1617,"sizeBytes":6808},{"name":"README.md","path":"packages/dockerfile-utils-js/README.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/packages/dockerfile-utils-js/README.md","title":"dockerfile-utils-js Documentation","category":"plugin-manifest","format":"markdown","content":"# @e2b/dockerfile-utils\n\nDockerfile parser and shell lexer ported from [BuildKit](https://github.com/moby/buildkit/tree/master/frontend/dockerfile) and a `.dockerignore` matcher ported from [moby/patternmatcher](https://github.com/moby/patternmatcher), with no runtime dependencies. Used by the [E2B SDK](https://www.npmjs.com/package/e2b) to implement `Template.fromDockerfile` and to filter the build context.\n\n```ts\nimport { parseDockerfileAst, ShellLex } from '@e2b/dockerfile-utils'\n\nconst ast = parseDockerfileAst(`\nFROM node:24 AS build\nENV KEY=\"a  b\" OTHER=c\nRUN <<EOF\nnpm ci\nnpm run build\nEOF\n`)\n\nfor (const instruction of ast.instructions) {\n  console.log(instruction.name, instruction.flags, instruction.args)\n}\n\nconst lex = new ShellLex(ast.escapeToken)\nlex.processWords('KEY=\"a  b\" OTHER=c') // ['KEY=a  b', 'OTHER=c']\n```\n\n`parseDockerfileAst` handles parser directives (`# escape=`, `# syntax=`), comments (including inside line continuations), builder flags, JSON/exec forms and heredocs, and reports line numbers and warnings. `ShellLex` splits and unquotes words the way BuildKit does, preserving `$VAR` / `${VAR:-default}` references for later expansion.\n\n```ts\nimport { PatternMatcher } from '@e2b/dockerfile-utils'\n\nconst matcher = new PatternMatcher(['node_modules', '*.log', '!keep.log'])\nmatcher.matches('node_modules/pkg/index.js') // true\nmatcher.matches('keep.log') // false\n```\n\n`PatternMatcher` applies `.dockerignore` semantics to slash-separated paths relative to the context root: a pattern matching a directory excludes everything under it, and `!` patterns re-include paths (the last matching pattern wins). An invalid pattern throws a plain `Error`.\n","isInternal":false,"tokens":416,"sizeBytes":1685},{"name":"README.md","path":"packages/dockerfile-utils-python/README.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/packages/dockerfile-utils-python/README.md","title":"dockerfile-utils-python Documentation","category":"plugin-manifest","format":"markdown","content":"# e2b-dockerfile-utils\n\nDockerfile parser and shell lexer ported from [BuildKit](https://github.com/moby/buildkit/tree/master/frontend/dockerfile) and a `.dockerignore` matcher ported from [moby/patternmatcher](https://github.com/moby/patternmatcher), with no runtime dependencies. Used by the [E2B SDK](https://pypi.org/project/e2b/) to implement `Template.from_dockerfile` and to filter the build context.\n\n```python\nfrom e2b_dockerfile_utils import ShellLex, parse_dockerfile_ast\n\nast = parse_dockerfile_ast(\n    \"\"\"\nFROM node:24 AS build\nENV KEY=\"a  b\" OTHER=c\nRUN <<EOF\nnpm ci\nnpm run build\nEOF\n\"\"\"\n)\n\nfor instruction in ast.instructions:\n    print(instruction.name, instruction.flags, instruction.args)\n\nlex = ShellLex(ast.escape_token)\nlex.process_words('KEY=\"a  b\" OTHER=c')  # ['KEY=a  b', 'OTHER=c']\n```\n\n`parse_dockerfile_ast` handles parser directives (`# escape=`, `# syntax=`), comments (including inside line continuations), builder flags, JSON/exec forms and heredocs, and reports line numbers and warnings. `ShellLex` splits and unquotes words the way BuildKit does, preserving `$VAR` / `${VAR:-default}` references for later expansion.\n\n```python\nfrom e2b_dockerfile_utils import PatternMatcher\n\nmatcher = PatternMatcher([\"node_modules\", \"*.log\", \"!keep.log\"])\nmatcher.matches(\"node_modules/pkg/index.js\")  # True\nmatcher.matches(\"keep.log\")  # False\n```\n\n`PatternMatcher` applies `.dockerignore` semantics to slash-separated paths relative to the context root: a pattern matching a directory excludes everything under it, and `!` patterns re-include paths (the last matching pattern wins). An invalid pattern raises a plain `ValueError`.\n","isInternal":false,"tokens":406,"sizeBytes":1657},{"name":"README.md","path":"packages/js-sdk/README.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/packages/js-sdk/README.md","title":"js-sdk Documentation","category":"plugin-manifest","format":"markdown","content":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">  \n  <a href=\"https://www.npmjs.com/package/e2b\">\n    <img alt=\"Last 1 month downloads for the JavaScript SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/npm/dm/e2b?label=NPM%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```bash\nnpm i e2b\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n3. Set environment variable with your API key\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Start a sandbox and run commands\n\n```ts\nimport { Sandbox } from 'e2b'\n\nconst sandbox = await Sandbox.create()\nconst result = await sandbox.commands.run('echo \"Hello from E2B!\"')\nconsole.log(result.stdout) // Hello from E2B!\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox`, `Volume`, `Template` and `Secret` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```ts\nimport { E2B } from 'e2b'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst sandbox = await client.Sandbox.create()\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Code execution with Code Interpreter\n\nIf you need [`runCode()`](https://docs.e2b.dev/code-interpreting/analyze-data-with-ai?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b), install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):\n\n```bash\nnpm i @e2b/code-interpreter\n```\n\n```ts\nimport { Sandbox } from '@e2b/code-interpreter'\n\nconst sandbox = await Sandbox.create()\nconst execution = await sandbox.runCode('x = 1; x += 1; x')\nconsole.log(execution.text)  // outputs 2\n```\n\n### 6. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n\n### 7. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","isInternal":false,"tokens":1008,"sizeBytes":3668},{"name":"README.md","path":"packages/python-sdk/README.md","rawUrl":"https://raw.githubusercontent.com/e2b-dev/E2B/HEAD/packages/python-sdk/README.md","title":"python-sdk Documentation","category":"plugin-manifest","format":"markdown","content":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://pypi.org/project/e2b/\">\n    <img alt=\"Last 1 month downloads for the Python SDK\" loading=\"lazy\" decoding=\"async\" style=\"color:transparent;width:170px;height:18px\" src=\"https://static.pepy.tech/personalized-badge/e2b?period=monthly&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=PyPi%20Monthly%20Downloads\">\n  </a>  \n</h4>\n\n\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\npip install e2b\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n3. Set environment variable with your API key\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Start a sandbox and run commands\n\n```py\nfrom e2b import Sandbox\n\nwith Sandbox.create() as sandbox:\n    result = sandbox.commands.run('echo \"Hello from E2B!\"')\n    print(result.stdout)  # Hello from E2B!\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox`, `AsyncSandbox`, `Volume`, `AsyncVolume`, `Template`, `AsyncTemplate` and `Secret` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```py\nfrom e2b import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\nsandbox = client.Sandbox.create()\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The async variants are exposed as well.\nasync_sandbox = await client.AsyncSandbox.create()\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n### High-concurrency sandbox streams\n\nSandbox `commands` and `files` traffic from all sandboxes in a process shares one HTTP/2 connection pool. Requests are spread over the pooled connections by free stream capacity, and a new connection is dialed only once every existing one is at the server's concurrent-stream limit (`100` for `sandbox.e2b.app`), up to `E2B_MAX_CONNECTIONS` connections per resolved address (default `200`). Past that cap, a request waits for a stream to free up. Long-running streams therefore never queue behind one connection's concurrent-stream limit, and idle processes keep a single connection.\n\n`E2B_MAX_CONNECTIONS` is read when `e2b` is imported:\n\n```sh\nE2B_MAX_CONNECTIONS=400 python eval.py\n```\n\n### 5. Code execution with Code Interpreter\n\nIf you need [`run_code()`](https://docs.e2b.dev/code-interpreting/analyze-data-with-ai?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b), install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):\n\n```\npip install e2b-code-interpreter\n```\n\n```py\nfrom e2b_code_interpreter import Sandbox\n\nwith Sandbox.create() as sandbox:\n    execution = sandbox.run_code(\"x = 1; x += 1; x\")\n    print(execution.text)  # outputs 2\n```\n\n### 6. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n\n### 7. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n","isInternal":false,"tokens":1174,"sizeBytes":4419}],"systemPromptSnippet":"<yakaai_skills repo=\"e2b-dev/E2B\">\n<!-- File: AGENTS.md (Tokens: ~4 | Category: root-instruction) -->\nCLAUDE.md\n\n<!-- File: CLAUDE.md (Tokens: ~290 | Category: claude-rule) -->\nUse pnpm for node and uv for python to install and update dependencies.\nRun `pnpm run format`, `pnpm run lint` and `pnpm run typecheck` before committing changes.\nWhen modifying the SDK packages, ensure equivalent changes are applied to both JS as well as sync and async Python implementations.\nNever edit the API, envd, or volume-content specs in spec/ by hand; they are synced with Copybara from e2b-dev/runtime and e2b-dev/belt at the commits pinned in spec/runtime-ref and spec/belt-ref (see copy.bara.sky and spec/README.md). To update the specs, bump the pins and re-run `make codegen`, which re-fetches them before generating.\nCreate or update tests covering affected codepaths and run them using `pnpm run test`.\nGenerate a changeset with `pnpm changeset` in the repository root when changing the public surface of packages/cli, packages/js-sdk, or packages/python-sdk; internal scripts, devtools, and tests don't need one.\nWhen creating a pull request, add usage examples for user-facing changes to the PR description.\nWhen opening a new pull request, use the Linear MCP if available to link to related issues, or create a new issue from the PR description.\nKeep PR descriptions up-to-date with changes.\nDefault credentials are stored in .env.local in the repository root or inside ~/.e2b/config.json.\n\n<!-- File: skills/stripe-projects/SKILL.md (Tokens: ~1422 | Category: anthropic-skill) -->\n---\nname: stripe-projects\ndescription: \"Use after E2B sandbox/API access has been provisioned through Stripe Projects and the user needs to use the resulting E2B API key with the E2B CLI, JavaScript SDK, Python SDK, or Code Interpreter SDK.\"\n---\n\n# E2B Stripe Projects\n\nUse these patterns after E2B sandbox/API access has been provisioned through Stripe Projects.\n\n## Credentials\n\n- Stripe Projects provisions E2B sandbox/API access and returns an E2B team API key.\n- Use that key as `E2B_API_KEY` for sandbox creation, sandbox control, and SDK clients.\n- Prefer setting `E2B_API_KEY` explicitly in runtime environments so commands and SDK calls use the intended E2B team.\n- Local defaults can also come from `.env.local` or `~/.e2b/config.json`.\n- In Stripe Projects checkouts, the E2B CLI may not be globally logged in. Before using `e2b sandbox ...`, prefer a Stripe Projects env pull plus per-command export instead of trying `e2b auth login`.\n- Do not print secret values. `stripe projects env --json` can return redacted placeholders, so do not use it as the source for a runnable `E2B_API_KEY`. Pull the managed env file, then read only the needed E2B variables into the command environment without echoing them.\n\n```bash\nstripe projects env --pull --yes\nenv_value() {\n  awk -F= -v key=\"$1\" '$1 == key {sub(/^[^=]*=/, \"\"); gsub(/^\"|\"$/, \"\"); print; exit}' .env\n}\nexport E2B_API_KEY=\"$(env_value E2B_API_KEY)\"\nexport E2B_API_URL=\"$(env_value E2B_API_URL)\"\nexport E2B_DOMAIN=\"$(env_value E2B_DOMAIN)\"\ne2b sandbox create base --detach\n```\n\n## Stripe Projects CLI\n\nAdd E2B to the current Stripe project:\n\n```bash\nstripe projects add e2b/sandboxes\n```\n\nInspect or pull provisioned credentials:\n\n```bash\nstripe projects env\nstripe projects env --json\nstripe projects env --pull --yes\n```\n\nExport the E2B API key before using the E2B CLI or SDK. Prefer `stripe projects env --pull --yes` for command execution because JSON output may redact secret values. Read only the variables you need from `.env`; do not source `.env` as shell code:\n\n```bash\nstripe projects env --pull --yes\nenv_value() {\n  awk -F= -v key=\"$1\" '$1 == key {sub(/^[^=]*=/, \"\"); gsub(/^\"|\"$/, \"\"); print; exit}' .env\n}\nexport E2B_API_KEY=\"$(env_value E2B_API_KEY)\"\nexport E2B_API_URL=\"$(env_value E2B_API_URL)\"\nexport E2B_DOMAIN=\"$(env_value E2B_DOMAIN)\"\n```\n\nUse `stripe projects env --json` for structure checks only. In current Stripe Projects output, the E2B variables are under `data.resource_access_configurations[].access_configuration`, including `E2B_API_KEY`, `E2B_API_URL`, and `E2B_DOMAIN`, but the values may be redacted and unusable for CLI/SDK calls.\n\n## E2B CLI\n\nIf the E2B CLI is missing or a shell shim is broken, install it with Node instead of switching to SDK code:\n\n```bash\nif ! e2b --version >/dev/null 2>&1; then\n  npm install -g @e2b/cli\nfi\n```\n\nThe CLI package requires Node 22 or newer.\n\nPrefer detached sandboxes for non-interactive work so the command returns a sandbox ID and does not attach an interactive terminal:\n\n```bash\ne2b sandbox create --detach\ne2b sandbox create base --detach\n```\n\nRun shell commands in a sandbox with `--` before shell flags so the CLI does not parse them:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'pwd && ls -la'\n```\n\nFor long-running processes, run them in the background and write a PID file in the sandbox:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'nohup python server.py >server.log 2>&1 & echo $! >server.pid'\n```\n\nThe CLI has explicit resume, but sandbox creation does not currently expose an auto-resume flag:\n\n```bash\ne2b sandbox resume <sandbox_id>\n```\n\nUse `sandbox exec` for operational commands against an existing sandbox:\n\n```bash\ne2b sandbox exec <sandbox_id> -- bash -lc 'python --version'\ne2b sandbox exec <sandbox_id> -- bash -lc 'ls -la /tmp'\n```\n\n## JavaScript SDK\n\nUse `Sandbox.create()` with `E2B_API_KEY` for a fresh sandbox:\n\n```ts\nimport Sandbox from 'e2b'\n\nconst sandbox = await Sandbox.create('base')\nconst result = await sandbox.commands.run('echo \"hello from e2b\"')\nconsole.log(result.stdout)\n```\n\nUse lifecycle options when the sandbox should pause on timeout and resume on later activity:\n\n```ts\nconst sandbox = await Sandbox.create('base', {\n  lifecycle: { onTimeout: 'pause', autoResume: true },\n})\n```\n\nUse `Sandbox.connect()` when a CLI step already created the sandbox:\n\n```ts\nimport Sandbox from 'e2b'\n\nconst sandbox = await Sandbox.connect(process.env.SANDBOX_ID!)\nconst result = await sandbox.commands.run('cat important_file.md')\nconsole.log(result.stdout)\n```\n\n## Python SDK\n\nUse the context manager with `E2B_API_KEY` for short-lived tasks:\n\n```py\nfrom e2b import Sandbox\n\nwith Sandbox.create(\"base\") as sandbox:\n    result = sandbox.commands.run('echo \"hello from e2b\"')\n    print(result.stdout)\n```\n\nUse lifecycle options when the sandbox should pause on timeout and resume on later activity:\n\n```py\nsandbox = Sandbox.create(\n    \"base\",\n    lifecycle={\"on_timeout\": \"pause\", \"auto_resume\": True},\n)\n```\n\nFor workflows that share a sandbox across steps, keep the sandbox ID and connect to it later:\n\n```py\nfrom e2b import Sandbox\n\nsandbox = Sandbox.connect(sandbox_id)\nresult = sandbox.commands.run(\"cat important_file.md\")\nprint(result.stdout)\n```\n\n## Practical Defaults\n\n- Use the `base` template unless a task requires a specific template.\n- Prefer `bash -lc` for multi-command CLI execution.\n- Put temporary files under `/tmp` or the current working directory inside the sandbox unless the task requires a specific path.\n- For workloads that need code execution with `run_code` or `runCode`, use the Code Interpreter SDK.\n\n<!-- File: packages/cli/README.md (Tokens: ~422 | Category: plugin-manifest) -->\n<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n# E2B CLI\n\nThis CLI tool allows you to build manager your running E2B sandbox and sandbox templates. Learn more in [our documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli).\n\n### 1. Install the CLI\n\n**Using Homebrew (on macOS)**\n\n```bash\nbrew install e2b\n```\n\n**Using NPM**\n\n```bash\nnpm install -g @e2b/cli\n```\n\n### 2. Authenticate\n\n```bash\ne2b auth login\n```\n\n> [!NOTE]\n> To authenticate without the ability to open the browser (e.g. in CI/CD),\n> provide `E2B_API_KEY` as an environment variable. You can find your API key\n> in the [API Keys](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli) tab in the E2B dashboard.\n> Then use the CLI like this: `E2B_API_KEY=e2b_... e2b template create`.\n\n### 3. Check out docs\n\nVisit our [CLI documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b-cli) to learn more.\n\n<!-- File: packages/code-interpreter-js/README.md (Tokens: ~946 | Category: plugin-manifest) -->\n<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://www.npmjs.com/package/e2b\">\n    <img alt=\"Last 1 month downloads for the JavaScript SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/npm/dm/e2b?label=NPM%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter) is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).\n\nSource: [packages/code-interpreter-js](https://github.com/e2b-dev/E2B/tree/main/packages/code-interpreter-js)\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\nnpm i @e2b/code-interpreter\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n3. Set environment variable with your API key.\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Execute code with code interpreter inside Sandbox\n\n```ts\nimport { Sandbox } from '@e2b/code-interpreter'\n\nconst sbx = await Sandbox.create()\nawait sbx.runCode('x = 1')\n\nconst execution = await sbx.runCode('x+=1; x')\nconsole.log(execution.text)  // outputs 2\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```ts\nimport { E2B } from '@e2b/code-interpreter'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst sbx = await client.Sandbox.create()\nconst execution = await sbx.runCode('x = 1; x += 1; x')\n\n// The core resources are bound to the client's configuration as well.\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n\n### 6. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n\n<!-- File: packages/code-interpreter-python/README.md (Tokens: ~950 | Category: plugin-manifest) -->\n<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://pypi.org/project/e2b/\">\n    <img alt=\"Last 1 month downloads for the Python SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/pypi/dm/e2b?label=PyPI%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter) is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).\n\nSource: [packages/code-interpreter-python](https://github.com/e2b-dev/E2B/tree/main/packages/code-interpreter-python)\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\npip install e2b-code-interpreter\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n3. Set environment variable with your API key.\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Execute code with code interpreter inside Sandbox\n\n```py\nfrom e2b_code_interpreter import Sandbox\n\nwith Sandbox.create() as sandbox:\n    sandbox.run_code(\"x = 1\")\n    execution = sandbox.run_code(\"x+=1; x\")\n    print(execution.text)  # outputs 2\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` and `AsyncSandbox` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```py\nfrom e2b_code_interpreter import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\nwith client.Sandbox.create() as sandbox:\n    execution = sandbox.run_code(\"x = 1; x += 1; x\")\n\n# The async variant is exposed as well.\nasync_sandbox = await client.AsyncSandbox.create()\n\n# The core resources are bound to the client's configuration as well.\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=code-interpreter).\n\n### 6. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n\n<!-- File: packages/desktop-js/README.md (Tokens: ~1686 | Category: plugin-manifest) -->\n# E2B Desktop Sandbox - Virtual Computer for Computer Use\n\nE2B Desktop Sandbox is a secure virtual desktop ready for Computer Use. Powered by [E2B](https://e2b.dev).\n\nEach sandbox is isolated from the others and can be customized with any dependencies you want.\n\n![Desktop Sandbox](https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/packages/desktop-python/screenshot.png)\n\nSource: [packages/desktop-js](https://github.com/e2b-dev/E2B/tree/main/packages/desktop-js)\n\n## Examples\n\nCheck out the [example open-source app](https://github.com/e2b-dev/open-computer-use) in a separate repository.\n\n## 🚀 Getting started\n\nThe E2B Desktop Sandbox is built on top of [E2B Sandbox](https://e2b.dev/docs).\n\n### 1. Get E2B API key\n\nSign up at [E2B](https://e2b.dev) and get your API key.\nSet environment variable `E2B_API_KEY` with your API key.\n\n### 2. Install SDK\n\n```bash\nnpm install @e2b/desktop\n```\n\n### 3. Create Desktop Sandbox\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\n// Start a new desktop sandbox\nconst desktop = await Sandbox.create()\n\n// Launch an application\nawait desktop.launch('google-chrome') // or vscode, firefox, etc.\n\n// Wait 10s for the application to open\nawait desktop.wait(10000)\n\n// Stream the application's window\n// Note: there can be only one stream at a time\n// You need to stop the current stream before streaming another application\nawait desktop.stream.start({\n  windowId: await desktop.getCurrentWindowId(), // if not provided the whole desktop will be streamed\n  requireAuth: true,\n})\n\n// Get the stream auth key\nconst authKey = desktop.stream.getAuthKey()\n\n// Print the stream URL\nconsole.log('Stream URL:', desktop.stream.getUrl({ authKey }))\n\n// Kill the sandbox after the tasks are finished\n// await desktop.kill()\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```javascript\nimport { E2B } from '@e2b/desktop'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst desktop = await client.Sandbox.create()\nawait desktop.stream.start()\n\n// The core resources are bound to the client's configuration as well.\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n## Features\n\n### Streaming desktop's screen\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Start the stream\nawait desktop.stream.start()\n\n// Get stream URL\nconst url = desktop.stream.getUrl()\nconsole.log(url)\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Streaming with password protection\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Start the stream\nawait desktop.stream.start({\n  requireAuth: true, // Enable authentication with an auto-generated key\n})\n\n// Retrieve the authentication key\nconst authKey = await desktop.stream.getAuthKey()\n\n// Get stream URL\nconst url = desktop.stream.getUrl({ authKey })\nconsole.log(url)\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Streaming specific application\n\n> [!WARNING]\n>\n> - Will throw an error if the desired application is not open yet\n> - The stream will close once the application closes\n> - Creating multiple streams at the same time is not supported, you may have to stop the current stream and start a new one for each application\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Get current (active) window ID\nconst windowId = await desktop.getCurrentWindowId()\n\n// Get all windows of the application\nconst windowIds = await desktop.getApplicationWindows('Firefox')\n\n// Start the stream\nawait desktop.stream.start({ windowId: windowIds[0] })\n\n// Stop the stream\nawait desktop.stream.stop()\n```\n\n### Mouse control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\nawait desktop.doubleClick()\nawait desktop.leftClick()\nawait desktop.leftClick(100, 200)\nawait desktop.rightClick()\nawait desktop.rightClick(100, 200)\nawait desktop.middleClick()\nawait desktop.middleClick(100, 200)\nawait desktop.scroll(10) // Scroll by the amount. Positive for up, negative for down.\nawait desktop.moveMouse(100, 200) // Move to x, y coordinates\nawait desktop.drag([100, 100], [200, 200]) // Drag using the mouse\nawait desktop.mousePress('left') // Press the mouse button\nawait desktop.mouseRelease('left') // Release the mouse button\n```\n\n### Keyboard control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Write text at the current cursor position with customizable typing speed\nawait desktop.write('Hello, world!')\nawait desktop.write('Fast typing!', { chunkSize: 50, delayInMs: 25 }) // Faster typing\n\n// Press keys\nawait desktop.press('enter')\nawait desktop.press('space')\nawait desktop.press('backspace')\nawait desktop.press(['ctrl', 'c']) // Key combination\n```\n\n### Window control\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Get current (active) window ID\nconst windowId = await desktop.getCurrentWindowId()\n\n// Get all windows of the application\nconst windowIds = await desktop.getApplicationWindows('Firefox')\n\n// Get window title\nconst title = await desktop.getWindowTitle(windowId)\n```\n\n### Screenshot\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\nconst image = await desktop.screenshot()\n// Save the image to a file\nfs.writeFileSync('screenshot.png', image)\n```\n\n### Open file\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Open file with default application\nawait desktop.files.write('/home/user/index.js', \"console.log('hello')\") // First create the file\nawait desktop.open('/home/user/index.js') // Then open it\n```\n\n### Launch applications\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Launch the application\nawait desktop.launch('google-chrome')\n```\n\n### Run any bash commands\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\n\n// Run any bash command\nconst out = await desktop.commands.run('ls -la /home/user')\nconsole.log(out)\n```\n\n### Wait\n\n```javascript\nimport { Sandbox } from '@e2b/desktop'\n\nconst desktop = await Sandbox.create()\nawait desktop.wait(1000) // Wait for 1 second\n```\n\n## Under the hood\n\nThe desktop-like environment is based on Linux and [Xfce](https://www.xfce.org/) at the moment. We chose Xfce because it's a fast and lightweight environment that's also popular and actively supported. However, this Sandbox template is fully customizable and you can create your own desktop environment.\nCheck out the sandbox template's code [here](https://github.com/e2b-dev/desktop/tree/main/template).\n\n<!-- File: packages/desktop-python/README.md (Tokens: ~1617 | Category: plugin-manifest) -->\n# E2B Desktop Sandbox - Virtual Computer for Computer Use\n\nE2B Desktop Sandbox is a secure virtual desktop ready for Computer Use. Powered by [E2B](https://e2b.dev).\n\nEach sandbox is isolated from the others and can be customized with any dependencies you want.\n\n![Desktop Sandbox](https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/packages/desktop-python/screenshot.png)\n\nSource: [packages/desktop-python](https://github.com/e2b-dev/E2B/tree/main/packages/desktop-python)\n\n## Examples\n\nCheck out the [example open-source app](https://github.com/e2b-dev/open-computer-use) in a separate repository.\n\n## 🚀 Getting started\n\nThe E2B Desktop Sandbox is built on top of [E2B Sandbox](https://e2b.dev/docs).\n\n### 1. Get E2B API key\n\nSign up at [E2B](https://e2b.dev) and get your API key.\nSet environment variable `E2B_API_KEY` with your API key.\n\n### 2. Install SDK\n\n```bash\npip install e2b-desktop\n```\n\n### 3. Create Desktop Sandbox\n\n```python\nfrom e2b_desktop import Sandbox\n\n# Create a new desktop sandbox\ndesktop = Sandbox.create()\n\n# Launch an application\ndesktop.launch('google-chrome')  # or vscode, firefox, etc.\n\n# Wait 10s for the application to open\ndesktop.wait(10000)\n\n# Stream the application's window\n# Note: There can be only one stream at a time\n# You need to stop the current stream before streaming another application\ndesktop.stream.start(\n    window_id=desktop.get_current_window_id(), # if not provided the whole desktop will be streamed\n    require_auth=True\n)\n\n# Get the stream auth key\nauth_key = desktop.stream.get_auth_key()\n\n# Print the stream URL\nprint('Stream URL:', desktop.stream.get_url(auth_key=auth_key))\n\n# Kill the sandbox after the tasks are finished\n# desktop.kill()\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox` export reads its configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```python\nfrom e2b_desktop import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\ndesktop = client.Sandbox.create()\ndesktop.stream.start()\n\n# The core resources are bound to the client's configuration as well.\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n## Features\n\n### Streaming desktop's screen\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Start the stream\ndesktop.stream.start()\n\n# Get stream URL\nurl = desktop.stream.get_url()\nprint(url)\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Streaming with password protection\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Start the stream\ndesktop.stream.start(\n    require_auth=True  # Enable authentication with an auto-generated key\n)\n\n# Retrieve the authentication key\nauth_key = desktop.stream.get_auth_key()\n\n# Get stream URL\nurl = desktop.stream.get_url(auth_key=auth_key)\nprint(url)\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Streaming specific application\n\n> [!WARNING]\n>\n> - Will raise an error if the desired application is not open yet\n> - The stream will close once the application closes\n> - Creating multiple streams at the same time is not supported, you may have to stop the current stream and start a new one for each application\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Get current (active) window ID\nwindow_id = desktop.get_current_window_id()\n\n# Get all windows of the application\nwindow_ids = desktop.get_application_windows(\"Firefox\")\n\n# Start the stream\ndesktop.stream.start(window_id=window_ids[0])\n\n# Stop the stream\ndesktop.stream.stop()\n```\n\n### Mouse control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\ndesktop.double_click()\ndesktop.left_click()\ndesktop.left_click(x=100, y=200)\ndesktop.right_click()\ndesktop.right_click(x=100, y=200)\ndesktop.middle_click()\ndesktop.middle_click(x=100, y=200)\ndesktop.scroll(10) # Scroll by the amount. Positive for up, negative for down.\ndesktop.move_mouse(100, 200) # Move to x, y coordinates\ndesktop.drag((100, 100), (200, 200)) # Drag using the mouse\ndesktop.mouse_press(\"left\") # Press the mouse button\ndesktop.mouse_release(\"left\") # Release the mouse button\n```\n\n### Keyboard control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Write text at the current cursor position with customizable typing speed\ndesktop.write(\"Hello, world!\")  # Default: chunk_size=25, delay_in_ms=75\ndesktop.write(\"Fast typing!\", chunk_size=50, delay_in_ms=25)  # Faster typing\n\n# Press keys\ndesktop.press(\"enter\")\ndesktop.press(\"space\")\ndesktop.press(\"backspace\")\ndesktop.press([\"ctrl\", \"c\"]) # Key combination\n```\n\n### Window control\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Get current (active) window ID\nwindow_id = desktop.get_current_window_id()\n\n# Get all windows of the application\nwindow_ids = desktop.get_application_windows(\"Firefox\")\n\n# Get window title\ntitle = desktop.get_window_title(window_id)\n```\n\n### Screenshot\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Take a screenshot and save it as \"screenshot.png\" locally\nimage = desktop.screenshot()\n# Save the image to a file\nwith open(\"screenshot.png\", \"wb\") as f:\n    f.write(image)\n```\n\n### Open file\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Open file with default application\ndesktop.files.write(\"/home/user/index.js\", \"console.log('hello')\") # First create the file\ndesktop.open(\"/home/user/index.js\") # Then open it\n```\n\n### Launch applications\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Launch the application\ndesktop.launch('google-chrome')\n```\n\n### Run any bash commands\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\n# Run any bash command\nout = desktop.commands.run(\"ls -la /home/user\")\nprint(out)\n```\n\n### Wait\n\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox.create()\n\ndesktop.wait(1000) # Wait for 1 second\n```\n\n## Under the hood\n\nThe desktop-like environment is based on Linux and [Xfce](https://www.xfce.org/) at the moment. We chose Xfce because it's a fast and lightweight environment that's also popular and actively supported. However, this Sandbox template is fully customizable and you can create your own desktop environment.\nCheck out the sandbox template's code [here](https://github.com/e2b-dev/desktop/tree/main/template).\n\n<!-- File: packages/dockerfile-utils-js/README.md (Tokens: ~416 | Category: plugin-manifest) -->\n# @e2b/dockerfile-utils\n\nDockerfile parser and shell lexer ported from [BuildKit](https://github.com/moby/buildkit/tree/master/frontend/dockerfile) and a `.dockerignore` matcher ported from [moby/patternmatcher](https://github.com/moby/patternmatcher), with no runtime dependencies. Used by the [E2B SDK](https://www.npmjs.com/package/e2b) to implement `Template.fromDockerfile` and to filter the build context.\n\n```ts\nimport { parseDockerfileAst, ShellLex } from '@e2b/dockerfile-utils'\n\nconst ast = parseDockerfileAst(`\nFROM node:24 AS build\nENV KEY=\"a  b\" OTHER=c\nRUN <<EOF\nnpm ci\nnpm run build\nEOF\n`)\n\nfor (const instruction of ast.instructions) {\n  console.log(instruction.name, instruction.flags, instruction.args)\n}\n\nconst lex = new ShellLex(ast.escapeToken)\nlex.processWords('KEY=\"a  b\" OTHER=c') // ['KEY=a  b', 'OTHER=c']\n```\n\n`parseDockerfileAst` handles parser directives (`# escape=`, `# syntax=`), comments (including inside line continuations), builder flags, JSON/exec forms and heredocs, and reports line numbers and warnings. `ShellLex` splits and unquotes words the way BuildKit does, preserving `$VAR` / `${VAR:-default}` references for later expansion.\n\n```ts\nimport { PatternMatcher } from '@e2b/dockerfile-utils'\n\nconst matcher = new PatternMatcher(['node_modules', '*.log', '!keep.log'])\nmatcher.matches('node_modules/pkg/index.js') // true\nmatcher.matches('keep.log') // false\n```\n\n`PatternMatcher` applies `.dockerignore` semantics to slash-separated paths relative to the context root: a pattern matching a directory excludes everything under it, and `!` patterns re-include paths (the last matching pattern wins). An invalid pattern throws a plain `Error`.\n\n<!-- File: packages/dockerfile-utils-python/README.md (Tokens: ~406 | Category: plugin-manifest) -->\n# e2b-dockerfile-utils\n\nDockerfile parser and shell lexer ported from [BuildKit](https://github.com/moby/buildkit/tree/master/frontend/dockerfile) and a `.dockerignore` matcher ported from [moby/patternmatcher](https://github.com/moby/patternmatcher), with no runtime dependencies. Used by the [E2B SDK](https://pypi.org/project/e2b/) to implement `Template.from_dockerfile` and to filter the build context.\n\n```python\nfrom e2b_dockerfile_utils import ShellLex, parse_dockerfile_ast\n\nast = parse_dockerfile_ast(\n    \"\"\"\nFROM node:24 AS build\nENV KEY=\"a  b\" OTHER=c\nRUN <<EOF\nnpm ci\nnpm run build\nEOF\n\"\"\"\n)\n\nfor instruction in ast.instructions:\n    print(instruction.name, instruction.flags, instruction.args)\n\nlex = ShellLex(ast.escape_token)\nlex.process_words('KEY=\"a  b\" OTHER=c')  # ['KEY=a  b', 'OTHER=c']\n```\n\n`parse_dockerfile_ast` handles parser directives (`# escape=`, `# syntax=`), comments (including inside line continuations), builder flags, JSON/exec forms and heredocs, and reports line numbers and warnings. `ShellLex` splits and unquotes words the way BuildKit does, preserving `$VAR` / `${VAR:-default}` references for later expansion.\n\n```python\nfrom e2b_dockerfile_utils import PatternMatcher\n\nmatcher = PatternMatcher([\"node_modules\", \"*.log\", \"!keep.log\"])\nmatcher.matches(\"node_modules/pkg/index.js\")  # True\nmatcher.matches(\"keep.log\")  # False\n```\n\n`PatternMatcher` applies `.dockerignore` semantics to slash-separated paths relative to the context root: a pattern matching a directory excludes everything under it, and `!` patterns re-include paths (the last matching pattern wins). An invalid pattern raises a plain `ValueError`.\n\n<!-- File: packages/js-sdk/README.md (Tokens: ~1008 | Category: plugin-manifest) -->\n<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">  \n  <a href=\"https://www.npmjs.com/package/e2b\">\n    <img alt=\"Last 1 month downloads for the JavaScript SDK\" loading=\"lazy\" width=\"200\" height=\"20\" decoding=\"async\" data-nimg=\"1\"\n    style=\"color:transparent;width:auto;height:100%\" src=\"https://img.shields.io/npm/dm/e2b?label=NPM%20Downloads\">\n  </a>\n</h4>\n\n<!---\n<img width=\"100%\" src=\"/readme-assets/preview.png\" alt=\"Cover image\">\n--->\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```bash\nnpm i e2b\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n3. Set environment variable with your API key\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Start a sandbox and run commands\n\n```ts\nimport { Sandbox } from 'e2b'\n\nconst sandbox = await Sandbox.create()\nconst result = await sandbox.commands.run('echo \"Hello from E2B!\"')\nconsole.log(result.stdout) // Hello from E2B!\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox`, `Volume`, `Template` and `Secret` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resources it exposes:\n\n```ts\nimport { E2B } from 'e2b'\n\nconst client = new E2B({ apiKey: 'e2b_***', domain: 'e2b.dev' })\n\nconst sandbox = await client.Sandbox.create()\nconst volume = await client.Volume.create('my-volume')\nconst exists = await client.Template.exists('my-template')\nawait client.Secret.create('openai-api-key', 'sk-***')\n\n// The classes can be destructured and used like the top-level ones.\nconst { Sandbox } = client\nconst paginator = Sandbox.list()\n```\n\nPer-call options still take precedence over the client's options, and clients are isolated from each other and from the env-configured top-level exports.\n\n### 5. Code execution with Code Interpreter\n\nIf you need [`runCode()`](https://docs.e2b.dev/code-interpreting/analyze-data-with-ai?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b), install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):\n\n```bash\nnpm i @e2b/code-interpreter\n```\n\n```ts\nimport { Sandbox } from '@e2b/code-interpreter'\n\nconst sandbox = await Sandbox.create()\nconst execution = await sandbox.runCode('x = 1; x += 1; x')\nconsole.log(execution.text)  // outputs 2\n```\n\n### 6. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=npm&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n\n### 7. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n\n<!-- File: packages/python-sdk/README.md (Tokens: ~1174 | Category: plugin-manifest) -->\n<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-white.png\">\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\">\n    <img alt=\"E2B Logo\" src=\"https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-black.png\" width=\"200\">\n  </picture>\n</p>\n\n<h4 align=\"center\">\n  <a href=\"https://pypi.org/project/e2b/\">\n    <img alt=\"Last 1 month downloads for the Python SDK\" loading=\"lazy\" decoding=\"async\" style=\"color:transparent;width:170px;height:18px\" src=\"https://static.pepy.tech/personalized-badge/e2b?period=monthly&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=PyPi%20Monthly%20Downloads\">\n  </a>  \n</h4>\n\n\n## What is E2B?\n[E2B](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).\n\n## Run your first Sandbox\n\n### 1. Install SDK\n\n```\npip install e2b\n```\n\n### 2. Get your E2B API key\n1. Sign up to E2B [here](https://e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n2. Get your API key [here](https://e2b.dev/dashboard?tab=keys&utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n3. Set environment variable with your API key\n```\nE2B_API_KEY=e2b_***\n```\n\n### 3. Start a sandbox and run commands\n\n```py\nfrom e2b import Sandbox\n\nwith Sandbox.create() as sandbox:\n    result = sandbox.commands.run('echo \"Hello from E2B!\"')\n    print(result.stdout)  # Hello from E2B!\n```\n\n### 4. Bind the configuration to a client\n\nThe top-level `Sandbox`, `AsyncSandbox`, `Volume`, `AsyncVolume`, `Template`, `AsyncTemplate` and `Secret` exports read their configuration from the environment variables. To use an explicit configuration — e.g. several API keys or domains in one process — create an `E2B` client and use the resource classes it exposes:\n\n```py\nfrom e2b import E2B\n\nclient = E2B(api_key=\"e2b_***\", domain=\"e2b.dev\")\n\nsandbox = client.Sandbox.create()\nvolume = client.Volume.create(\"my-volume\")\nexists = client.Template.exists(\"my-template\")\nsecret = client.Secret.create(\"openai-api-key\", \"sk-***\")\n\n# The async variants are exposed as well.\nasync_sandbox = await client.AsyncSandbox.create()\n\n# The classes can be assigned and used like the top-level ones.\nSandbox = client.Sandbox\npaginator = Sandbox.list()\n```\n\nPer-call params still take precedence over the client's params, and clients are isolated from each other and from the env-configured top-level exports.\n\n### High-concurrency sandbox streams\n\nSandbox `commands` and `files` traffic from all sandboxes in a process shares one HTTP/2 connection pool. Requests are spread over the pooled connections by free stream capacity, and a new connection is dialed only once every existing one is at the server's concurrent-stream limit (`100` for `sandbox.e2b.app`), up to `E2B_MAX_CONNECTIONS` connections per resolved address (default `200`). Past that cap, a request waits for a stream to free up. Long-running streams therefore never queue behind one connection's concurrent-stream limit, and idle processes keep a single connection.\n\n`E2B_MAX_CONNECTIONS` is read when `e2b` is imported:\n\n```sh\nE2B_MAX_CONNECTIONS=400 python eval.py\n```\n\n### 5. Code execution with Code Interpreter\n\nIf you need [`run_code()`](https://docs.e2b.dev/code-interpreting/analyze-data-with-ai?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b), install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):\n\n```\npip install e2b-code-interpreter\n```\n\n```py\nfrom e2b_code_interpreter import Sandbox\n\nwith Sandbox.create() as sandbox:\n    execution = sandbox.run_code(\"x = 1; x += 1; x\")\n    print(execution.text)  # outputs 2\n```\n\n### 6. Check docs\nVisit [E2B documentation](https://docs.e2b.dev/?utm_source=pypi&utm_medium=referral&utm_campaign=readme&utm_content=e2b).\n\n### 7. E2B cookbook\nVisit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.\n</yakaai_skills>"}