Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Update id to template in docs
Tomas Valentac85412e0fb37
diff --git a/apps/docs/src/app/guide/custom-sandbox/page.mdx b/apps/docs/src/app/guide/custom-sandbox/page.mdxindex fc3f4d820..10f7958fd 100644--- a/apps/docs/src/app/guide/custom-sandbox/page.mdx+++ b/apps/docs/src/app/guide/custom-sandbox/page.mdx@@ -161,7 +161,7 @@ This way, we'll be able to spawn our custom sandbox and control it with the SDK.import { Sandbox } from '@e2b/sdk'// Spawn your custom sandbox-const sandbox = await Sandbox.create({ id: 'my-agent-sandbox' }) // $HighlightLine+const sandbox = await Sandbox.create({ template: 'my-agent-sandbox' }) // $HighlightLine// Interact with sandbox. Learn more here:// https://e2b.dev/docs/sandbox/overview@@ -174,7 +174,7 @@ await sandbox.close()from e2b import Sandbox# Spawn your custom sandbox-sandbox = Sandbox(id="my-agent-sandbox") # $HighlightLine+sandbox = Sandbox(template="my-agent-sandbox") # $HighlightLine# Interact with sandbox. Learn more here:# https://e2b.dev/docs/sandbox/overviewdiff --git a/apps/docs/src/app/sandbox/custom/page.mdx b/apps/docs/src/app/sandbox/custom/page.mdxindex d9de2928e..42d53ce4f 100644--- a/apps/docs/src/app/sandbox/custom/page.mdx+++ b/apps/docs/src/app/sandbox/custom/page.mdx@@ -20,7 +20,7 @@ Once you build your custom sandbox template, you can spawn multiple isolated san// Create new sandboxconst sandbox = await Sandbox.create({- id: '<sandbox-template-id>', // You get sandbox ID from the CLI after you run `$ e2b build`+ template: '<sandbox-template-id>', // You get sandbox template ID from the CLI after you run `$ e2b build`})// Close sandbox once done@@ -32,7 +32,7 @@ Once you build your custom sandbox template, you can spawn multiple isolated san# Create new sandboxsandbox = Sandbox(- id="<sandbox-template-id>", # You get sandbox ID from the CLI after you run `$ e2b build`+ template="<sandbox-template-id>", # You get sandbox ID from the CLI after you run `$ e2b build`)# Close sandbox once donediff --git a/apps/docs/src/app/sandbox/templates/overview/page.mdx b/apps/docs/src/app/sandbox/templates/overview/page.mdxindex 2efb58307..469705afd 100644--- a/apps/docs/src/app/sandbox/templates/overview/page.mdx+++ b/apps/docs/src/app/sandbox/templates/overview/page.mdx@@ -33,7 +33,7 @@ Follow our [guide](/guide/custom-sandbox) on how to create a custom sandbox.// Create new sandboxconst sandbox = await Sandbox.create({// You get sandbox ID from the CLI after you run `$ e2b build`- id: '<sandbox-template-id>', // $HighlightLine+ template: '<sandbox-template-id>', // $HighlightLine})// Close sandbox once done@@ -46,7 +46,7 @@ Follow our [guide](/guide/custom-sandbox) on how to create a custom sandbox.# Create new sandboxsandbox = Sandbox(# You get sandbox ID from the CLI after you run `$ e2b build`- id="<sandbox-template-id>", # $HighlightLine+ template="<sandbox-template-id>", # $HighlightLine)# Close sandbox once donediff --git a/apps/docs/src/code/js/agents/clone_repo.js b/apps/docs/src/code/js/agents/clone_repo.jsindex e7c37fe26..0df219261 100644--- a/apps/docs/src/code/js/agents/clone_repo.js+++ b/apps/docs/src/code/js/agents/clone_repo.js@@ -3,7 +3,7 @@ import { Sandbox } from '@e2b/sdk'// 1. Start the playground sandboxconst sandbox = await Sandbox.create({// You can pass your own sandbox template id- id: 'base',+ template: 'base',apiKey: process.env.E2B_API_KEY,})diff --git a/apps/docs/src/code/js/agents/code_exec.js b/apps/docs/src/code/js/agents/code_exec.jsindex 5a2ab5363..01ea81c3c 100644--- a/apps/docs/src/code/js/agents/code_exec.js+++ b/apps/docs/src/code/js/agents/code_exec.js@@ -3,7 +3,7 @@ import { Sandbox } from '@e2b/sdk'// 1. Start the playground sandboxconst sandbox = await Sandbox.create({// You can pass your own sandbox template id- id: 'base',+ template: 'base',})// 2. Save the JavaScript code to a file inside the playgrounddiff --git a/apps/docs/src/code/js/agents/install_deps_npm.js b/apps/docs/src/code/js/agents/install_deps_npm.jsindex e7750712f..1f11877ac 100644--- a/apps/docs/src/code/js/agents/install_deps_npm.js+++ b/apps/docs/src/code/js/agents/install_deps_npm.js@@ -2,7 +2,7 @@ import { Sandbox } from '@e2b/sdk'// 1. Start the playground sandboxconst sandbox = await Sandbox.create({- id: 'base', // $HighlightLine+ template: 'base', // $HighlightLineapiKey: process.env.E2B_API_KEY,})diff --git a/apps/docs/src/code/js/agents/start_process.js b/apps/docs/src/code/js/agents/start_process.jsindex 1f80e7dfa..7cc89eef4 100644--- a/apps/docs/src/code/js/agents/start_process.js+++ b/apps/docs/src/code/js/agents/start_process.js@@ -3,7 +3,7 @@ import { Sandbox } from '@e2b/sdk'// 1. Start the playground sandboxconst sandbox = await Sandbox.create({// You can pass your own sandbox template id- id: 'base',+ template: 'base',apiKey: process.env.E2B_API_KEY,})diff --git a/apps/docs/src/code/js/basics/download_file.js b/apps/docs/src/code/js/basics/download_file.jsindex 9f0dffa19..807f49708 100644--- a/apps/docs/src/code/js/basics/download_file.js+++ b/apps/docs/src/code/js/basics/download_file.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'import fs from 'node:fs'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })const buffer = await sandbox.downloadFile('path/to/remote/file/inside/sandbox') // $HighlightLine// Save file to local filesystemdiff --git a/apps/docs/src/code/js/basics/fs_ls.js b/apps/docs/src/code/js/basics/fs_ls.jsindex 25d0280ab..6f4bfc880 100644--- a/apps/docs/src/code/js/basics/fs_ls.js+++ b/apps/docs/src/code/js/basics/fs_ls.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',})const dirContent = await sandbox.filesystem.list('/') // $HighlightLinediff --git a/apps/docs/src/code/js/basics/fs_mkdir.js b/apps/docs/src/code/js/basics/fs_mkdir.jsindex 0b22e8028..2817d9606 100644--- a/apps/docs/src/code/js/basics/fs_mkdir.js+++ b/apps/docs/src/code/js/basics/fs_mkdir.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({ id: 'base' })+const sandbox = await Sandbox.create({ template: 'base' })// Create a new directory '/dir'await sandbox.filesystem.makeDir('/dir') // $HighlightLinediff --git a/apps/docs/src/code/js/basics/fs_read.js b/apps/docs/src/code/js/basics/fs_read.jsindex ddb869910..ac04b4ff3 100644--- a/apps/docs/src/code/js/basics/fs_read.js+++ b/apps/docs/src/code/js/basics/fs_read.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })const fileContent = await sandbox.filesystem.read('/etc/hosts') // $HighlightLineconsole.log(fileContent)diff --git a/apps/docs/src/code/js/basics/fs_read_bytes.js b/apps/docs/src/code/js/basics/fs_read_bytes.jsindex ab0091ef4..b0f301340 100644--- a/apps/docs/src/code/js/basics/fs_read_bytes.js+++ b/apps/docs/src/code/js/basics/fs_read_bytes.js@@ -1,7 +1,7 @@import fs from 'fs'import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })// File bytes will read file's content as bytes// `fileBytes` as a Uint8Arraydiff --git a/apps/docs/src/code/js/basics/fs_watch.js b/apps/docs/src/code/js/basics/fs_watch.jsindex e89486129..c620e6bc0 100644--- a/apps/docs/src/code/js/basics/fs_watch.js+++ b/apps/docs/src/code/js/basics/fs_watch.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })// Start filesystem watcher for the /home directoryconst watcher = sandbox.filesystem.watchDir('/home') // $HighlightLinediff --git a/apps/docs/src/code/js/basics/fs_write.js b/apps/docs/src/code/js/basics/fs_write.jsindex 55652af73..774a36788 100644--- a/apps/docs/src/code/js/basics/fs_write.js+++ b/apps/docs/src/code/js/basics/fs_write.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })// `filesystem.write()` will:// - create the file if it doesn't existdiff --git a/apps/docs/src/code/js/basics/fs_write_bytes.js b/apps/docs/src/code/js/basics/fs_write_bytes.jsindex 5aac0ee62..72b61dbac 100644--- a/apps/docs/src/code/js/basics/fs_write_bytes.js+++ b/apps/docs/src/code/js/basics/fs_write_bytes.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })// Let's convert string to bytes for testing purposesconst encoder = new TextEncoder('utf-8')diff --git a/apps/docs/src/code/js/basics/get_url.js b/apps/docs/src/code/js/basics/get_url.jsindex 820c0b01f..0372f3b6a 100644--- a/apps/docs/src/code/js/basics/get_url.js+++ b/apps/docs/src/code/js/basics/get_url.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })const url = sandbox.getHostname() // $HighlightLineconsole.log('https://' + url)diff --git a/apps/docs/src/code/js/basics/get_url_port.js b/apps/docs/src/code/js/basics/get_url_port.jsindex e6ed2f234..007e6b2f5 100644--- a/apps/docs/src/code/js/basics/get_url_port.js+++ b/apps/docs/src/code/js/basics/get_url_port.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })const openPort = 3000const url = sandbox.getHostname(openPort) // $HighlightLinediff --git a/apps/docs/src/code/js/basics/process_env_vars.js b/apps/docs/src/code/js/basics/process_env_vars.jsindex 12f822cd2..177df9696 100644--- a/apps/docs/src/code/js/basics/process_env_vars.js+++ b/apps/docs/src/code/js/basics/process_env_vars.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',envVars: {FOO: 'Hello'},})diff --git a/apps/docs/src/code/js/basics/process_exit.js b/apps/docs/src/code/js/basics/process_exit.jsindex 7aba32b03..0839482f2 100644--- a/apps/docs/src/code/js/basics/process_exit.js+++ b/apps/docs/src/code/js/basics/process_exit.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',onExit: () => console.log('[sandbox]', 'process ended'), // $HighlightLine})diff --git a/apps/docs/src/code/js/basics/process_start.js b/apps/docs/src/code/js/basics/process_start.jsindex 8e0e0af35..754b814a4 100644--- a/apps/docs/src/code/js/basics/process_start.js+++ b/apps/docs/src/code/js/basics/process_start.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })const npmInit = await sandbox.process.start({cmd: 'npm init -y', // $HighlightLinediff --git a/apps/docs/src/code/js/basics/process_stop.js b/apps/docs/src/code/js/basics/process_stop.jsindex 01e3c4b8e..745a23538 100644--- a/apps/docs/src/code/js/basics/process_stop.js+++ b/apps/docs/src/code/js/basics/process_stop.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',})const npmInit = await sandbox.process.start({diff --git a/apps/docs/src/code/js/basics/process_stream_stderr.js b/apps/docs/src/code/js/basics/process_stream_stderr.jsindex 5295820fc..47b58957a 100644--- a/apps/docs/src/code/js/basics/process_stream_stderr.js+++ b/apps/docs/src/code/js/basics/process_stream_stderr.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',})// This command will fail and output to stderr because Golang isn't installed in the cloud playgrounddiff --git a/apps/docs/src/code/js/basics/process_stream_stdout.js b/apps/docs/src/code/js/basics/process_stream_stdout.jsindex f8a17caf9..92a00c504 100644--- a/apps/docs/src/code/js/basics/process_stream_stdout.js+++ b/apps/docs/src/code/js/basics/process_stream_stdout.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',onStdout: (output) => console.log('sandbox', output.line), // $HighlightLine})diff --git a/apps/docs/src/code/js/basics/process_write_stdin.js b/apps/docs/src/code/js/basics/process_write_stdin.jsindex 87059f1f1..8e7f0cc88 100644--- a/apps/docs/src/code/js/basics/process_write_stdin.js+++ b/apps/docs/src/code/js/basics/process_write_stdin.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })// This example will print back the string we send to the process using `sendStdin()`diff --git a/apps/docs/src/code/js/basics/scan_ports.js b/apps/docs/src/code/js/basics/scan_ports.jsindex 4e479de1f..c004dc937 100644--- a/apps/docs/src/code/js/basics/scan_ports.js+++ b/apps/docs/src/code/js/basics/scan_ports.js@@ -21,7 +21,7 @@ function printNewPortAndURL(openPorts, sandbox) {}const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',onScanPorts: (openPorts) => printNewPortAndURL(openPorts, sandbox), // $HighlightLine})diff --git a/apps/docs/src/code/js/basics/set_env_vars.js b/apps/docs/src/code/js/basics/set_env_vars.jsindex a51fbd55e..24e17db41 100644--- a/apps/docs/src/code/js/basics/set_env_vars.js+++ b/apps/docs/src/code/js/basics/set_env_vars.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',envVars: {FOO: 'Hello'}, // $HighlightLine})diff --git a/apps/docs/src/code/js/basics/upload_file.js b/apps/docs/src/code/js/basics/upload_file.jsindex a736a2e68..65d63f015 100644--- a/apps/docs/src/code/js/basics/upload_file.js+++ b/apps/docs/src/code/js/basics/upload_file.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'import fs from 'node:fs'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })// If you're in the server environmentconst filename = 'data.csv' // $HighlightLinediff --git a/apps/docs/src/code/js/code_exec/process.js b/apps/docs/src/code/js/code_exec/process.jsindex c7fff41ea..a295d2135 100644--- a/apps/docs/src/code/js/code_exec/process.js+++ b/apps/docs/src/code/js/code_exec/process.js@@ -3,7 +3,7 @@ import { Sandbox } from '@e2b/sdk'// 1. Start the playground sandboxconst sandbox = await Sandbox.create({// You can pass your own sandbox template id- id: 'base',+ template: 'base',apiKey: process.env.E2B_API_KEY,})diff --git a/apps/docs/src/code/js/cwd/filesystem.js b/apps/docs/src/code/js/cwd/filesystem.jsindex dac0b420c..9f8cf3be4 100644--- a/apps/docs/src/code/js/cwd/filesystem.js+++ b/apps/docs/src/code/js/cwd/filesystem.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',cwd: '/home/user/code', // $HighlightLine})diff --git a/apps/docs/src/code/js/cwd/process.js b/apps/docs/src/code/js/cwd/process.jsindex 98eeed2bd..fc7289e4b 100644--- a/apps/docs/src/code/js/cwd/process.js+++ b/apps/docs/src/code/js/cwd/process.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',cwd: '/code', // $HighlightLine})diff --git a/apps/docs/src/code/js/cwd/sandbox.js b/apps/docs/src/code/js/cwd/sandbox.jsindex 1e9a0da73..7141641fc 100644--- a/apps/docs/src/code/js/cwd/sandbox.js+++ b/apps/docs/src/code/js/cwd/sandbox.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',cwd: '/code', // $HighlightLine})diff --git a/apps/docs/src/code/js/logging/e2b_logging.js b/apps/docs/src/code/js/logging/e2b_logging.jsindex 87ec6ecea..1a308a3d4 100644--- a/apps/docs/src/code/js/logging/e2b_logging.js+++ b/apps/docs/src/code/js/logging/e2b_logging.js@@ -9,7 +9,7 @@ const logger = {}const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',apiKey: process.env.E2B_API_KEY,logger, // $HighlightLine})diff --git a/apps/docs/src/code/js/processes/background_processes.js b/apps/docs/src/code/js/processes/background_processes.jsindex ece37170b..0ef9d4f75 100644--- a/apps/docs/src/code/js/processes/background_processes.js+++ b/apps/docs/src/code/js/processes/background_processes.js@@ -1,7 +1,7 @@import { Sandbox } from '@e2b/sdk'const sandbox = await Sandbox.create({- id: 'base',+ template: 'base',apiKey: process.env.E2B_API_KEY,})diff --git a/apps/docs/src/code/js/quickstart.js b/apps/docs/src/code/js/quickstart.jsindex cbe6bbe33..4d8083918 100644--- a/apps/docs/src/code/js/quickstart.js+++ b/apps/docs/src/code/js/quickstart.js@@ -3,7 +3,7 @@ import { Sandbox } from '@e2b/sdk'// 1. Start cloud playgroundconst sandbox = await Sandbox.create({// $HighlightLine- id: 'base', // or you can pass your own sandbox template id+ template: 'base', // or you can pass your own sandbox template idapiKey: process.env.E2B_API_KEY,})diff --git a/apps/docs/src/code/js/reconnect/reconnect.js b/apps/docs/src/code/js/reconnect/reconnect.jsindex 22fff2dcb..53134b221 100644--- a/apps/docs/src/code/js/reconnect/reconnect.js+++ b/apps/docs/src/code/js/reconnect/reconnect.js@@ -4,7 +4,7 @@ async function wait(ms) {return new Promise(resolve => setTimeout(resolve, ms))}-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })// Do something in the sandboxawait sandbox.filesystem.write('hello.txt', 'Hello World!')diff --git a/apps/docs/src/code/js/reconnect/reconnect_1.js b/apps/docs/src/code/js/reconnect/reconnect_1.jsindex bf8d68406..213722dec 100644--- a/apps/docs/src/code/js/reconnect/reconnect_1.js+++ b/apps/docs/src/code/js/reconnect/reconnect_1.js@@ -4,4 +4,4 @@ async function wait(ms) {return new Promise(resolve => setTimeout(resolve, ms))}-const sandbox = await Sandbox.create({id: 'base'})\ No newline at end of file+const sandbox = await Sandbox.create({ template: 'base' })\ No newline at end of filediff --git a/apps/docs/src/code/js/timeout/timeout_filesystem.js b/apps/docs/src/code/js/timeout/timeout_filesystem.jsindex 6cbe4b130..99ccdd21e 100644--- a/apps/docs/src/code/js/timeout/timeout_filesystem.js+++ b/apps/docs/src/code/js/timeout/timeout_filesystem.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })// Timeout 3s for the write operationawait sandbox.filesystem.write('hello.txt', 'Hello World!', {timeout: 3000}) // $HighlightLinediff --git a/apps/docs/src/code/js/timeout/timeout_process.js b/apps/docs/src/code/js/timeout/timeout_process.jsindex 81ce58eb7..bfe3633aa 100644--- a/apps/docs/src/code/js/timeout/timeout_process.js+++ b/apps/docs/src/code/js/timeout/timeout_process.js@@ -1,6 +1,6 @@import { Sandbox } from '@e2b/sdk'-const sandbox = await Sandbox.create({id: 'base'})+const sandbox = await Sandbox.create({ template: 'base' })// Timeout 3s for the process to startconst npmInit = await sandbox.process.start({diff --git a/apps/docs/src/code/js/timeout/timeout_sandbox.js b/apps/docs/src/code/js/timeout/timeout_sandbox.jsindex d2bc2464e..e9e379470 100644--- a/apps/docs/src/code/js/timeout/timeout_sandbox.js+++ b/apps/docs/src/code/js/timeout/timeout_sandbox.js@@ -2,7 +2,7 @@ import { Sandbox } from '@e2b/sdk'// Timeout 3s for the sandbox to openconst sandbox = await Sandbox.create({- id: 'base',+ template: 'base',timeout: 3000, // $HighlightLine})diff --git a/apps/docs/src/code/python/agents/clone_repo.py b/apps/docs/src/code/python/agents/clone_repo.pyindex 8af9823f7..835f2e29a 100644--- a/apps/docs/src/code/python/agents/clone_repo.py+++ b/apps/docs/src/code/python/agents/clone_repo.py@@ -13,7 +13,7 @@ def main():# 1. Start the playground sandboxsandbox = Sandbox(# Select the right runtime- id="base",+ template="base",api_key=E2B_API_KEY,)diff --git a/apps/docs/src/code/python/agents/code_exec.py b/apps/docs/src/code/python/agents/code_exec.pyindex 56b0eee4d..60a20d85b 100644--- a/apps/docs/src/code/python/agents/code_exec.py+++ b/apps/docs/src/code/python/agents/code_exec.py@@ -8,7 +8,7 @@ def print_out(output):# 1. Start the playground sandboxsandbox = Sandbox(# You can pass your own sandbox template id- id="base",+ template="base",)# 2. Save the JavaScript code to a file inside the playgrounddiff --git a/apps/docs/src/code/python/agents/start_process.py b/apps/docs/src/code/python/agents/start_process.pyindex 4e5ba1028..6d4838ffd 100644--- a/apps/docs/src/code/python/agents/start_process.py+++ b/apps/docs/src/code/python/agents/start_process.py@@ -13,7 +13,7 @@ def main():# 1. Start the playground sandboxsandbox = Sandbox(# Select the right runtime- id="base",+ template="base",api_key=E2B_API_KEY,)diff --git a/apps/docs/src/code/python/basics/download_file.py b/apps/docs/src/code/python/basics/download_file.pyindex a645132cc..2984ab0fb 100644--- a/apps/docs/src/code/python/basics/download_file.py+++ b/apps/docs/src/code/python/basics/download_file.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")file_in_bytes = sandbox.download_file("path/to/remote/file/inside/sandbox") # $HighlightLine# Save file to local filesystemdiff --git a/apps/docs/src/code/python/basics/fs_ls.py b/apps/docs/src/code/python/basics/fs_ls.pyindex b9dcd11dc..c27daba4e 100644--- a/apps/docs/src/code/python/basics/fs_ls.py+++ b/apps/docs/src/code/python/basics/fs_ls.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")# List the root directorycontent = sandbox.filesystem.list("/") # $HighlightLinediff --git a/apps/docs/src/code/python/basics/fs_mkdir.py b/apps/docs/src/code/python/basics/fs_mkdir.pyindex dd6469b36..8657f9c2d 100644--- a/apps/docs/src/code/python/basics/fs_mkdir.py+++ b/apps/docs/src/code/python/basics/fs_mkdir.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")# Create a new directory '/dir'sandbox.filesystem.make_dir("/dir") # $HighlightLinediff --git a/apps/docs/src/code/python/basics/fs_read.py b/apps/docs/src/code/python/basics/fs_read.pyindex 3a025204d..ea38ab74c 100644--- a/apps/docs/src/code/python/basics/fs_read.py+++ b/apps/docs/src/code/python/basics/fs_read.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")# Read the '/etc/hosts' filefile_content = sandbox.filesystem.read("/etc/hosts") # $HighlightLinediff --git a/apps/docs/src/code/python/basics/fs_read_bytes.py b/apps/docs/src/code/python/basics/fs_read_bytes.pyindex e40387ade..ff5a50a11 100644--- a/apps/docs/src/code/python/basics/fs_read_bytes.py+++ b/apps/docs/src/code/python/basics/fs_read_bytes.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")# File bytes will read file's content as bytes# `file_bytes` as a bytearraydiff --git a/apps/docs/src/code/python/basics/fs_watch.py b/apps/docs/src/code/python/basics/fs_watch.pyindex d7bb474f1..09c267b4f 100644--- a/apps/docs/src/code/python/basics/fs_watch.py+++ b/apps/docs/src/code/python/basics/fs_watch.py@@ -12,7 +12,7 @@ def create_watcher(sandbox): # $HighlightLinewatcher.start() # $HighlightLine-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")create_watcher(sandbox) # $HighlightLinediff --git a/apps/docs/src/code/python/basics/fs_write.py b/apps/docs/src/code/python/basics/fs_write.pyindex 48ffac64c..df1b869dc 100644--- a/apps/docs/src/code/python/basics/fs_write.py+++ b/apps/docs/src/code/python/basics/fs_write.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")# `filesystem.write()` will:# - create the file if it doesn't existdiff --git a/apps/docs/src/code/python/basics/fs_write_bytes.py b/apps/docs/src/code/python/basics/fs_write_bytes.pyindex 6f38b9ed0..762b9dc72 100644--- a/apps/docs/src/code/python/basics/fs_write_bytes.py+++ b/apps/docs/src/code/python/basics/fs_write_bytes.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")content_in_bytes = bytearray(b"Hello world")diff --git a/apps/docs/src/code/python/basics/get_url.py b/apps/docs/src/code/python/basics/get_url.pyindex b425b2613..afab231d0 100644--- a/apps/docs/src/code/python/basics/get_url.py+++ b/apps/docs/src/code/python/basics/get_url.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")url = sandbox.get_hostname() # $HighlightLineprint("https://" + url)diff --git a/apps/docs/src/code/python/basics/get_url_port.py b/apps/docs/src/code/python/basics/get_url_port.pyindex a005e8e35..3e273eace 100644--- a/apps/docs/src/code/python/basics/get_url_port.py+++ b/apps/docs/src/code/python/basics/get_url_port.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")open_port = 3000url = sandbox.get_hostname(open_port) # $HighlightLinediff --git a/apps/docs/src/code/python/basics/process_env_vars.py b/apps/docs/src/code/python/basics/process_env_vars.pyindex b707567ee..4ae94e2b6 100644--- a/apps/docs/src/code/python/basics/process_env_vars.py+++ b/apps/docs/src/code/python/basics/process_env_vars.py@@ -1,7 +1,7 @@from e2b import Sandboxsandbox = Sandbox(- id="base",+ template="base",env_vars={"FOO": "Hello"})diff --git a/apps/docs/src/code/python/basics/process_exit.py b/apps/docs/src/code/python/basics/process_exit.pyindex ce6e1f11c..4e1a80361 100644--- a/apps/docs/src/code/python/basics/process_exit.py+++ b/apps/docs/src/code/python/basics/process_exit.py@@ -1,7 +1,7 @@from e2b import Sandboxsandbox = Sandbox(- id="base",+ template="base",on_exit=lambda: print("[sandbox]", "process ended"), # $HighlightLine)diff --git a/apps/docs/src/code/python/basics/process_start.py b/apps/docs/src/code/python/basics/process_start.pyindex 7a38d9383..af1aae136 100644--- a/apps/docs/src/code/python/basics/process_start.py+++ b/apps/docs/src/code/python/basics/process_start.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")npm_init = sandbox.process.start("npm init -y") # $HighlightLinenpm_init.wait()diff --git a/apps/docs/src/code/python/basics/process_stop.py b/apps/docs/src/code/python/basics/process_stop.pyindex 072c1808f..57bcf997a 100644--- a/apps/docs/src/code/python/basics/process_stop.py+++ b/apps/docs/src/code/python/basics/process_stop.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")npm_init = sandbox.process.start("npm init -y")npm_init.kill() # $HighlightLinediff --git a/apps/docs/src/code/python/basics/process_stream_stderr.py b/apps/docs/src/code/python/basics/process_stream_stderr.pyindex c40d4e445..ce25ccf00 100644--- a/apps/docs/src/code/python/basics/process_stream_stderr.py+++ b/apps/docs/src/code/python/basics/process_stream_stderr.py@@ -1,7 +1,7 @@from e2b import Sandboxsandbox = Sandbox(- id="base",+ template="base",on_stderr=lambda output: print("[sandbox]", output.line), # $HighlightLine)diff --git a/apps/docs/src/code/python/basics/process_stream_stdout.py b/apps/docs/src/code/python/basics/process_stream_stdout.pyindex 4838cafc8..07b2a6b51 100644--- a/apps/docs/src/code/python/basics/process_stream_stdout.py+++ b/apps/docs/src/code/python/basics/process_stream_stdout.py@@ -1,7 +1,7 @@from e2b import Sandboxsandbox = Sandbox(- id="base",+ template="base",on_stdout=lambda output: print("sandbox", output.line), # $HighlightLine)diff --git a/apps/docs/src/code/python/basics/process_write_stdin.py b/apps/docs/src/code/python/basics/process_write_stdin.pyindex 50c7c53b9..7786d2a7f 100644--- a/apps/docs/src/code/python/basics/process_write_stdin.py+++ b/apps/docs/src/code/python/basics/process_write_stdin.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")# This example will print back the string we send to the process using `send_stdin()`diff --git a/apps/docs/src/code/python/basics/scan_ports.py b/apps/docs/src/code/python/basics/scan_ports.pyindex 24433424d..023c2ba6d 100644--- a/apps/docs/src/code/python/basics/scan_ports.py+++ b/apps/docs/src/code/python/basics/scan_ports.py@@ -23,7 +23,7 @@ def print_new_port_and_url(open_ports, sandbox):sandbox = Sandbox(- id="base",+ template="base",on_scan_ports=lambda open_ports: print_new_port_and_url(open_ports, sandbox) # $HighlightLine)diff --git a/apps/docs/src/code/python/basics/set_env_vars.py b/apps/docs/src/code/python/basics/set_env_vars.pyindex be3a3e004..30234e9d4 100644--- a/apps/docs/src/code/python/basics/set_env_vars.py+++ b/apps/docs/src/code/python/basics/set_env_vars.py@@ -1,7 +1,7 @@from e2b import Sandboxsandbox = Sandbox(- id="base",+ template="base",env_vars={"FOO": "Hello"}, # $HighlightLine)diff --git a/apps/docs/src/code/python/basics/upload_file.py b/apps/docs/src/code/python/basics/upload_file.pyindex c8eb0199d..4d9b3fea4 100644--- a/apps/docs/src/code/python/basics/upload_file.py+++ b/apps/docs/src/code/python/basics/upload_file.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")with open("path/to/local/file", "rb") as f:remote_path = sandbox.upload_file(f) # $HighlightLinediff --git a/apps/docs/src/code/python/code_exec/process.py b/apps/docs/src/code/python/code_exec/process.pyindex bf52a6d81..840e8f56e 100644--- a/apps/docs/src/code/python/code_exec/process.py+++ b/apps/docs/src/code/python/code_exec/process.py@@ -13,7 +13,7 @@ def main():# 1. Start the playground sandboxsandbox = Sandbox(# You can pass your own sandbox template id- id="base",+ template="base",api_key=E2B_API_KEY,)diff --git a/apps/docs/src/code/python/cwd/filesystem.py b/apps/docs/src/code/python/cwd/filesystem.pyindex a80c01331..6aa0f439d 100644--- a/apps/docs/src/code/python/cwd/filesystem.py+++ b/apps/docs/src/code/python/cwd/filesystem.py@@ -1,7 +1,7 @@from e2b import Sandboxsandbox = Sandbox(- id="base",+ template="base",cwd="/home/user/code" # $HighlightLine)sandbox.filesystem.write("hello.txt", "Welcome to E2B!") # $HighlightLinediff --git a/apps/docs/src/code/python/cwd/process.py b/apps/docs/src/code/python/cwd/process.pyindex 5a512f380..ef8882107 100644--- a/apps/docs/src/code/python/cwd/process.py+++ b/apps/docs/src/code/python/cwd/process.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base", cwd="/code") # $HighlightLine+sandbox = Sandbox(template="base", cwd="/code") # $HighlightLinesandbox_cwd = sandbox.process.start("pwd") # $HighlightLinesandbox_cwd.wait()print(sandbox_cwd.output.stdout)diff --git a/apps/docs/src/code/python/cwd/sandbox.py b/apps/docs/src/code/python/cwd/sandbox.pyindex 4fb8836cc..89f0f7fd5 100644--- a/apps/docs/src/code/python/cwd/sandbox.py+++ b/apps/docs/src/code/python/cwd/sandbox.py@@ -1,7 +1,7 @@from e2b import Sandboxsandbox = Sandbox(- id="base",+ template="base",cwd="/code", # $HighlightLine)diff --git a/apps/docs/src/code/python/logging/e2b_logging.py b/apps/docs/src/code/python/logging/e2b_logging.pyindex eaa36809b..6e161e597 100644--- a/apps/docs/src/code/python/logging/e2b_logging.py+++ b/apps/docs/src/code/python/logging/e2b_logging.py@@ -30,7 +30,7 @@ e2b_logger.addHandler(handler) # $HighlightLinedef main():- sandbox = Sandbox(id="base", api_key=E2B_API_KEY)+ sandbox = Sandbox(template="base", api_key=E2B_API_KEY)sandbox.filesystem.write("test.txt", "Hello World")sandbox.close()diff --git a/apps/docs/src/code/python/processes/background_processes.py b/apps/docs/src/code/python/processes/background_processes.pyindex 1d78c03ff..9f95de844 100644--- a/apps/docs/src/code/python/processes/background_processes.py+++ b/apps/docs/src/code/python/processes/background_processes.py@@ -11,7 +11,7 @@ def print_stdout(output):def main():- sandbox = Sandbox(id="base", api_key=E2B_API_KEY)+ sandbox = Sandbox(template="base", api_key=E2B_API_KEY)# Start a server process in the background# We are not using `background_server.wait()` - that would wait for the process to finish runningdiff --git a/apps/docs/src/code/python/timeout/timeout_filesystem.py b/apps/docs/src/code/python/timeout/timeout_filesystem.pyindex 85dfd28e3..943e4ff65 100644--- a/apps/docs/src/code/python/timeout/timeout_filesystem.py+++ b/apps/docs/src/code/python/timeout/timeout_filesystem.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")# Timeout 3s for the write operationsandbox.filesystem.write("test.txt", "Hello World", timeout=3) # $HighlightLinediff --git a/apps/docs/src/code/python/timeout/timeout_process.py b/apps/docs/src/code/python/timeout/timeout_process.pyindex 657f2c1b3..f3ff68e81 100644--- a/apps/docs/src/code/python/timeout/timeout_process.py+++ b/apps/docs/src/code/python/timeout/timeout_process.py@@ -1,6 +1,6 @@from e2b import Sandbox-sandbox = Sandbox(id="base")+sandbox = Sandbox(template="base")# Timeout 3s for the process to startnpm_init = sandbox.process.start("npm init -y", timeout=3) # $HighlightLinediff --git a/apps/docs/src/code/python/timeout/timeout_sandbox.py b/apps/docs/src/code/python/timeout/timeout_sandbox.pyindex 8d3b1a2df..acd0cab5d 100644--- a/apps/docs/src/code/python/timeout/timeout_sandbox.py+++ b/apps/docs/src/code/python/timeout/timeout_sandbox.py@@ -1,6 +1,6 @@from e2b import Sandbox# Timeout 3s for the sandbox to open-sandbox = Sandbox(id="base", timeout=3) # $HighlightLine+sandbox = Sandbox(template="base", timeout=3) # $HighlightLinesandbox.close()