[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-e2b-stripe-projects":3,"mdc-r8b7uc-key":55,"related-org-e2b-stripe-projects":2104,"related-repo-e2b-stripe-projects":2113},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":26,"repoUrl":27,"updatedAt":28,"license":29,"forks":30,"topics":31,"repo":50,"sourceUrl":53,"mdContent":54},"stripe-projects","configure E2B sandbox with Stripe","Use after E2B sandbox\u002FAPI 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.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"e2b","E2B","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fe2b.jpg","e2b-dev",[13,17,20,23],{"name":14,"slug":15,"type":16},"Sandboxing","sandboxing","tag",{"name":18,"slug":19,"type":16},"Payments","payments",{"name":21,"slug":22,"type":16},"API Development","api-development",{"name":24,"slug":25,"type":16},"Stripe","stripe",12935,"https:\u002F\u002Fgithub.com\u002Fe2b-dev\u002FE2B","2026-07-12T07:55:26.689",null,964,[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"agent","ai","ai-agent","ai-agents","code-interpreter","copilot","development","devtools","gpt","gpt-4","javascript","llm","nextjs","openai","python","react","software","typescript",{"repoUrl":27,"stars":26,"forks":30,"topics":51,"description":52},[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"Open-source, secure environment with real-world tools for enterprise-grade agents.","https:\u002F\u002Fgithub.com\u002Fe2b-dev\u002FE2B\u002Ftree\u002FHEAD\u002Fskills\u002Fstripe-projects","---\nname: stripe-projects\ndescription: \"Use after E2B sandbox\u002FAPI 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\u002FAPI access has been provisioned through Stripe Projects.\n\n## Credentials\n\n- Stripe Projects provisions E2B sandbox\u002FAPI 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 `~\u002F.e2b\u002Fconfig.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(\u002F^[^=]*=\u002F, \"\"); gsub(\u002F^\"|\"$\u002F, \"\"); 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\u002Fsandboxes\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(\u002F^[^=]*=\u002F, \"\"); gsub(\u002F^\"|\"$\u002F, \"\"); 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\u002FSDK 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 >\u002Fdev\u002Fnull 2>&1; then\n  npm install -g @e2b\u002Fcli\nfi\n```\n\nThe CLI package requires Node 20 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 \u003Csandbox_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 \u003Csandbox_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 \u003Csandbox_id>\n```\n\nUse `sandbox exec` for operational commands against an existing sandbox:\n\n```bash\ne2b sandbox exec \u003Csandbox_id> -- bash -lc 'python --version'\ne2b sandbox exec \u003Csandbox_id> -- bash -lc 'ls -la \u002Ftmp'\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 `\u002Ftmp` 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",{"data":56,"body":57},{"name":4,"description":6},{"type":58,"children":59},"root",[60,69,75,82,179,444,450,455,483,488,554,582,774,817,823,828,910,915,920,969,982,1054,1059,1122,1127,1167,1179,1298,1304,1323,1524,1529,1669,1681,1873,1879,1891,1939,1943,1981,1986,2031,2037,2098],{"type":61,"tag":62,"props":63,"children":65},"element","h1",{"id":64},"e2b-stripe-projects",[66],{"type":67,"value":68},"text","E2B Stripe Projects",{"type":61,"tag":70,"props":71,"children":72},"p",{},[73],{"type":67,"value":74},"Use these patterns after E2B sandbox\u002FAPI access has been provisioned through Stripe Projects.",{"type":61,"tag":76,"props":77,"children":79},"h2",{"id":78},"credentials",[80],{"type":67,"value":81},"Credentials",{"type":61,"tag":83,"props":84,"children":85},"ul",{},[86,92,106,118,139,159],{"type":61,"tag":87,"props":88,"children":89},"li",{},[90],{"type":67,"value":91},"Stripe Projects provisions E2B sandbox\u002FAPI access and returns an E2B team API key.",{"type":61,"tag":87,"props":93,"children":94},{},[95,97,104],{"type":67,"value":96},"Use that key as ",{"type":61,"tag":98,"props":99,"children":101},"code",{"className":100},[],[102],{"type":67,"value":103},"E2B_API_KEY",{"type":67,"value":105}," for sandbox creation, sandbox control, and SDK clients.",{"type":61,"tag":87,"props":107,"children":108},{},[109,111,116],{"type":67,"value":110},"Prefer setting ",{"type":61,"tag":98,"props":112,"children":114},{"className":113},[],[115],{"type":67,"value":103},{"type":67,"value":117}," explicitly in runtime environments so commands and SDK calls use the intended E2B team.",{"type":61,"tag":87,"props":119,"children":120},{},[121,123,129,131,137],{"type":67,"value":122},"Local defaults can also come from ",{"type":61,"tag":98,"props":124,"children":126},{"className":125},[],[127],{"type":67,"value":128},".env.local",{"type":67,"value":130}," or ",{"type":61,"tag":98,"props":132,"children":134},{"className":133},[],[135],{"type":67,"value":136},"~\u002F.e2b\u002Fconfig.json",{"type":67,"value":138},".",{"type":61,"tag":87,"props":140,"children":141},{},[142,144,150,152,158],{"type":67,"value":143},"In Stripe Projects checkouts, the E2B CLI may not be globally logged in. Before using ",{"type":61,"tag":98,"props":145,"children":147},{"className":146},[],[148],{"type":67,"value":149},"e2b sandbox ...",{"type":67,"value":151},", prefer a Stripe Projects env pull plus per-command export instead of trying ",{"type":61,"tag":98,"props":153,"children":155},{"className":154},[],[156],{"type":67,"value":157},"e2b auth login",{"type":67,"value":138},{"type":61,"tag":87,"props":160,"children":161},{},[162,164,170,172,177],{"type":67,"value":163},"Do not print secret values. ",{"type":61,"tag":98,"props":165,"children":167},{"className":166},[],[168],{"type":67,"value":169},"stripe projects env --json",{"type":67,"value":171}," can return redacted placeholders, so do not use it as the source for a runnable ",{"type":61,"tag":98,"props":173,"children":175},{"className":174},[],[176],{"type":67,"value":103},{"type":67,"value":178},". Pull the managed env file, then read only the needed E2B variables into the command environment without echoing them.",{"type":61,"tag":180,"props":181,"children":186},"pre",{"className":182,"code":183,"language":184,"meta":185,"style":185},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","stripe projects env --pull --yes\nenv_value() {\n  awk -F= -v key=\"$1\" '$1 == key {sub(\u002F^[^=]*=\u002F, \"\"); gsub(\u002F^\"|\"$\u002F, \"\"); 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","bash","",[187],{"type":61,"tag":98,"props":188,"children":189},{"__ignoreMap":185},[190,222,243,302,311,350,383,416],{"type":61,"tag":191,"props":192,"children":195},"span",{"class":193,"line":194},"line",1,[196,201,207,212,217],{"type":61,"tag":191,"props":197,"children":199},{"style":198},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[200],{"type":67,"value":25},{"type":61,"tag":191,"props":202,"children":204},{"style":203},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[205],{"type":67,"value":206}," projects",{"type":61,"tag":191,"props":208,"children":209},{"style":203},[210],{"type":67,"value":211}," env",{"type":61,"tag":191,"props":213,"children":214},{"style":203},[215],{"type":67,"value":216}," --pull",{"type":61,"tag":191,"props":218,"children":219},{"style":203},[220],{"type":67,"value":221}," --yes\n",{"type":61,"tag":191,"props":223,"children":225},{"class":193,"line":224},2,[226,232,238],{"type":61,"tag":191,"props":227,"children":229},{"style":228},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[230],{"type":67,"value":231},"env_value",{"type":61,"tag":191,"props":233,"children":235},{"style":234},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[236],{"type":67,"value":237},"()",{"type":61,"tag":191,"props":239,"children":240},{"style":234},[241],{"type":67,"value":242}," {\n",{"type":61,"tag":191,"props":244,"children":246},{"class":193,"line":245},3,[247,252,257,262,267,272,278,282,287,292,297],{"type":61,"tag":191,"props":248,"children":249},{"style":198},[250],{"type":67,"value":251},"  awk",{"type":61,"tag":191,"props":253,"children":254},{"style":203},[255],{"type":67,"value":256}," -F=",{"type":61,"tag":191,"props":258,"children":259},{"style":203},[260],{"type":67,"value":261}," -v",{"type":61,"tag":191,"props":263,"children":264},{"style":203},[265],{"type":67,"value":266}," key=",{"type":61,"tag":191,"props":268,"children":269},{"style":234},[270],{"type":67,"value":271},"\"",{"type":61,"tag":191,"props":273,"children":275},{"style":274},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[276],{"type":67,"value":277},"$1",{"type":61,"tag":191,"props":279,"children":280},{"style":234},[281],{"type":67,"value":271},{"type":61,"tag":191,"props":283,"children":284},{"style":234},[285],{"type":67,"value":286}," '",{"type":61,"tag":191,"props":288,"children":289},{"style":203},[290],{"type":67,"value":291},"$1 == key {sub(\u002F^[^=]*=\u002F, \"\"); gsub(\u002F^\"|\"$\u002F, \"\"); print; exit}",{"type":61,"tag":191,"props":293,"children":294},{"style":234},[295],{"type":67,"value":296},"'",{"type":61,"tag":191,"props":298,"children":299},{"style":203},[300],{"type":67,"value":301}," .env\n",{"type":61,"tag":191,"props":303,"children":305},{"class":193,"line":304},4,[306],{"type":61,"tag":191,"props":307,"children":308},{"style":234},[309],{"type":67,"value":310},"}\n",{"type":61,"tag":191,"props":312,"children":314},{"class":193,"line":313},5,[315,321,327,332,337,341,345],{"type":61,"tag":191,"props":316,"children":318},{"style":317},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[319],{"type":67,"value":320},"export",{"type":61,"tag":191,"props":322,"children":324},{"style":323},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[325],{"type":67,"value":326}," E2B_API_KEY",{"type":61,"tag":191,"props":328,"children":329},{"style":234},[330],{"type":67,"value":331},"=",{"type":61,"tag":191,"props":333,"children":334},{"style":234},[335],{"type":67,"value":336},"\"$(",{"type":61,"tag":191,"props":338,"children":339},{"style":198},[340],{"type":67,"value":231},{"type":61,"tag":191,"props":342,"children":343},{"style":203},[344],{"type":67,"value":326},{"type":61,"tag":191,"props":346,"children":347},{"style":234},[348],{"type":67,"value":349},")\"\n",{"type":61,"tag":191,"props":351,"children":353},{"class":193,"line":352},6,[354,358,363,367,371,375,379],{"type":61,"tag":191,"props":355,"children":356},{"style":317},[357],{"type":67,"value":320},{"type":61,"tag":191,"props":359,"children":360},{"style":323},[361],{"type":67,"value":362}," E2B_API_URL",{"type":61,"tag":191,"props":364,"children":365},{"style":234},[366],{"type":67,"value":331},{"type":61,"tag":191,"props":368,"children":369},{"style":234},[370],{"type":67,"value":336},{"type":61,"tag":191,"props":372,"children":373},{"style":198},[374],{"type":67,"value":231},{"type":61,"tag":191,"props":376,"children":377},{"style":203},[378],{"type":67,"value":362},{"type":61,"tag":191,"props":380,"children":381},{"style":234},[382],{"type":67,"value":349},{"type":61,"tag":191,"props":384,"children":386},{"class":193,"line":385},7,[387,391,396,400,404,408,412],{"type":61,"tag":191,"props":388,"children":389},{"style":317},[390],{"type":67,"value":320},{"type":61,"tag":191,"props":392,"children":393},{"style":323},[394],{"type":67,"value":395}," E2B_DOMAIN",{"type":61,"tag":191,"props":397,"children":398},{"style":234},[399],{"type":67,"value":331},{"type":61,"tag":191,"props":401,"children":402},{"style":234},[403],{"type":67,"value":336},{"type":61,"tag":191,"props":405,"children":406},{"style":198},[407],{"type":67,"value":231},{"type":61,"tag":191,"props":409,"children":410},{"style":203},[411],{"type":67,"value":395},{"type":61,"tag":191,"props":413,"children":414},{"style":234},[415],{"type":67,"value":349},{"type":61,"tag":191,"props":417,"children":419},{"class":193,"line":418},8,[420,424,429,434,439],{"type":61,"tag":191,"props":421,"children":422},{"style":198},[423],{"type":67,"value":8},{"type":61,"tag":191,"props":425,"children":426},{"style":203},[427],{"type":67,"value":428}," sandbox",{"type":61,"tag":191,"props":430,"children":431},{"style":203},[432],{"type":67,"value":433}," create",{"type":61,"tag":191,"props":435,"children":436},{"style":203},[437],{"type":67,"value":438}," base",{"type":61,"tag":191,"props":440,"children":441},{"style":203},[442],{"type":67,"value":443}," --detach\n",{"type":61,"tag":76,"props":445,"children":447},{"id":446},"stripe-projects-cli",[448],{"type":67,"value":449},"Stripe Projects CLI",{"type":61,"tag":70,"props":451,"children":452},{},[453],{"type":67,"value":454},"Add E2B to the current Stripe project:",{"type":61,"tag":180,"props":456,"children":458},{"className":182,"code":457,"language":184,"meta":185,"style":185},"stripe projects add e2b\u002Fsandboxes\n",[459],{"type":61,"tag":98,"props":460,"children":461},{"__ignoreMap":185},[462],{"type":61,"tag":191,"props":463,"children":464},{"class":193,"line":194},[465,469,473,478],{"type":61,"tag":191,"props":466,"children":467},{"style":198},[468],{"type":67,"value":25},{"type":61,"tag":191,"props":470,"children":471},{"style":203},[472],{"type":67,"value":206},{"type":61,"tag":191,"props":474,"children":475},{"style":203},[476],{"type":67,"value":477}," add",{"type":61,"tag":191,"props":479,"children":480},{"style":203},[481],{"type":67,"value":482}," e2b\u002Fsandboxes\n",{"type":61,"tag":70,"props":484,"children":485},{},[486],{"type":67,"value":487},"Inspect or pull provisioned credentials:",{"type":61,"tag":180,"props":489,"children":491},{"className":182,"code":490,"language":184,"meta":185,"style":185},"stripe projects env\nstripe projects env --json\nstripe projects env --pull --yes\n",[492],{"type":61,"tag":98,"props":493,"children":494},{"__ignoreMap":185},[495,511,531],{"type":61,"tag":191,"props":496,"children":497},{"class":193,"line":194},[498,502,506],{"type":61,"tag":191,"props":499,"children":500},{"style":198},[501],{"type":67,"value":25},{"type":61,"tag":191,"props":503,"children":504},{"style":203},[505],{"type":67,"value":206},{"type":61,"tag":191,"props":507,"children":508},{"style":203},[509],{"type":67,"value":510}," env\n",{"type":61,"tag":191,"props":512,"children":513},{"class":193,"line":224},[514,518,522,526],{"type":61,"tag":191,"props":515,"children":516},{"style":198},[517],{"type":67,"value":25},{"type":61,"tag":191,"props":519,"children":520},{"style":203},[521],{"type":67,"value":206},{"type":61,"tag":191,"props":523,"children":524},{"style":203},[525],{"type":67,"value":211},{"type":61,"tag":191,"props":527,"children":528},{"style":203},[529],{"type":67,"value":530}," --json\n",{"type":61,"tag":191,"props":532,"children":533},{"class":193,"line":245},[534,538,542,546,550],{"type":61,"tag":191,"props":535,"children":536},{"style":198},[537],{"type":67,"value":25},{"type":61,"tag":191,"props":539,"children":540},{"style":203},[541],{"type":67,"value":206},{"type":61,"tag":191,"props":543,"children":544},{"style":203},[545],{"type":67,"value":211},{"type":61,"tag":191,"props":547,"children":548},{"style":203},[549],{"type":67,"value":216},{"type":61,"tag":191,"props":551,"children":552},{"style":203},[553],{"type":67,"value":221},{"type":61,"tag":70,"props":555,"children":556},{},[557,559,565,567,573,575,580],{"type":67,"value":558},"Export the E2B API key before using the E2B CLI or SDK. Prefer ",{"type":61,"tag":98,"props":560,"children":562},{"className":561},[],[563],{"type":67,"value":564},"stripe projects env --pull --yes",{"type":67,"value":566}," for command execution because JSON output may redact secret values. Read only the variables you need from ",{"type":61,"tag":98,"props":568,"children":570},{"className":569},[],[571],{"type":67,"value":572},".env",{"type":67,"value":574},"; do not source ",{"type":61,"tag":98,"props":576,"children":578},{"className":577},[],[579],{"type":67,"value":572},{"type":67,"value":581}," as shell code:",{"type":61,"tag":180,"props":583,"children":585},{"className":182,"code":584,"language":184,"meta":185,"style":185},"stripe projects env --pull --yes\nenv_value() {\n  awk -F= -v key=\"$1\" '$1 == key {sub(\u002F^[^=]*=\u002F, \"\"); gsub(\u002F^\"|\"$\u002F, \"\"); 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",[586],{"type":61,"tag":98,"props":587,"children":588},{"__ignoreMap":185},[589,612,627,674,681,712,743],{"type":61,"tag":191,"props":590,"children":591},{"class":193,"line":194},[592,596,600,604,608],{"type":61,"tag":191,"props":593,"children":594},{"style":198},[595],{"type":67,"value":25},{"type":61,"tag":191,"props":597,"children":598},{"style":203},[599],{"type":67,"value":206},{"type":61,"tag":191,"props":601,"children":602},{"style":203},[603],{"type":67,"value":211},{"type":61,"tag":191,"props":605,"children":606},{"style":203},[607],{"type":67,"value":216},{"type":61,"tag":191,"props":609,"children":610},{"style":203},[611],{"type":67,"value":221},{"type":61,"tag":191,"props":613,"children":614},{"class":193,"line":224},[615,619,623],{"type":61,"tag":191,"props":616,"children":617},{"style":228},[618],{"type":67,"value":231},{"type":61,"tag":191,"props":620,"children":621},{"style":234},[622],{"type":67,"value":237},{"type":61,"tag":191,"props":624,"children":625},{"style":234},[626],{"type":67,"value":242},{"type":61,"tag":191,"props":628,"children":629},{"class":193,"line":245},[630,634,638,642,646,650,654,658,662,666,670],{"type":61,"tag":191,"props":631,"children":632},{"style":198},[633],{"type":67,"value":251},{"type":61,"tag":191,"props":635,"children":636},{"style":203},[637],{"type":67,"value":256},{"type":61,"tag":191,"props":639,"children":640},{"style":203},[641],{"type":67,"value":261},{"type":61,"tag":191,"props":643,"children":644},{"style":203},[645],{"type":67,"value":266},{"type":61,"tag":191,"props":647,"children":648},{"style":234},[649],{"type":67,"value":271},{"type":61,"tag":191,"props":651,"children":652},{"style":274},[653],{"type":67,"value":277},{"type":61,"tag":191,"props":655,"children":656},{"style":234},[657],{"type":67,"value":271},{"type":61,"tag":191,"props":659,"children":660},{"style":234},[661],{"type":67,"value":286},{"type":61,"tag":191,"props":663,"children":664},{"style":203},[665],{"type":67,"value":291},{"type":61,"tag":191,"props":667,"children":668},{"style":234},[669],{"type":67,"value":296},{"type":61,"tag":191,"props":671,"children":672},{"style":203},[673],{"type":67,"value":301},{"type":61,"tag":191,"props":675,"children":676},{"class":193,"line":304},[677],{"type":61,"tag":191,"props":678,"children":679},{"style":234},[680],{"type":67,"value":310},{"type":61,"tag":191,"props":682,"children":683},{"class":193,"line":313},[684,688,692,696,700,704,708],{"type":61,"tag":191,"props":685,"children":686},{"style":317},[687],{"type":67,"value":320},{"type":61,"tag":191,"props":689,"children":690},{"style":323},[691],{"type":67,"value":326},{"type":61,"tag":191,"props":693,"children":694},{"style":234},[695],{"type":67,"value":331},{"type":61,"tag":191,"props":697,"children":698},{"style":234},[699],{"type":67,"value":336},{"type":61,"tag":191,"props":701,"children":702},{"style":198},[703],{"type":67,"value":231},{"type":61,"tag":191,"props":705,"children":706},{"style":203},[707],{"type":67,"value":326},{"type":61,"tag":191,"props":709,"children":710},{"style":234},[711],{"type":67,"value":349},{"type":61,"tag":191,"props":713,"children":714},{"class":193,"line":352},[715,719,723,727,731,735,739],{"type":61,"tag":191,"props":716,"children":717},{"style":317},[718],{"type":67,"value":320},{"type":61,"tag":191,"props":720,"children":721},{"style":323},[722],{"type":67,"value":362},{"type":61,"tag":191,"props":724,"children":725},{"style":234},[726],{"type":67,"value":331},{"type":61,"tag":191,"props":728,"children":729},{"style":234},[730],{"type":67,"value":336},{"type":61,"tag":191,"props":732,"children":733},{"style":198},[734],{"type":67,"value":231},{"type":61,"tag":191,"props":736,"children":737},{"style":203},[738],{"type":67,"value":362},{"type":61,"tag":191,"props":740,"children":741},{"style":234},[742],{"type":67,"value":349},{"type":61,"tag":191,"props":744,"children":745},{"class":193,"line":385},[746,750,754,758,762,766,770],{"type":61,"tag":191,"props":747,"children":748},{"style":317},[749],{"type":67,"value":320},{"type":61,"tag":191,"props":751,"children":752},{"style":323},[753],{"type":67,"value":395},{"type":61,"tag":191,"props":755,"children":756},{"style":234},[757],{"type":67,"value":331},{"type":61,"tag":191,"props":759,"children":760},{"style":234},[761],{"type":67,"value":336},{"type":61,"tag":191,"props":763,"children":764},{"style":198},[765],{"type":67,"value":231},{"type":61,"tag":191,"props":767,"children":768},{"style":203},[769],{"type":67,"value":395},{"type":61,"tag":191,"props":771,"children":772},{"style":234},[773],{"type":67,"value":349},{"type":61,"tag":70,"props":775,"children":776},{},[777,779,784,786,792,794,799,801,807,809,815],{"type":67,"value":778},"Use ",{"type":61,"tag":98,"props":780,"children":782},{"className":781},[],[783],{"type":67,"value":169},{"type":67,"value":785}," for structure checks only. In current Stripe Projects output, the E2B variables are under ",{"type":61,"tag":98,"props":787,"children":789},{"className":788},[],[790],{"type":67,"value":791},"data.resource_access_configurations[].access_configuration",{"type":67,"value":793},", including ",{"type":61,"tag":98,"props":795,"children":797},{"className":796},[],[798],{"type":67,"value":103},{"type":67,"value":800},", ",{"type":61,"tag":98,"props":802,"children":804},{"className":803},[],[805],{"type":67,"value":806},"E2B_API_URL",{"type":67,"value":808},", and ",{"type":61,"tag":98,"props":810,"children":812},{"className":811},[],[813],{"type":67,"value":814},"E2B_DOMAIN",{"type":67,"value":816},", but the values may be redacted and unusable for CLI\u002FSDK calls.",{"type":61,"tag":76,"props":818,"children":820},{"id":819},"e2b-cli",[821],{"type":67,"value":822},"E2B CLI",{"type":61,"tag":70,"props":824,"children":825},{},[826],{"type":67,"value":827},"If the E2B CLI is missing or a shell shim is broken, install it with Node instead of switching to SDK code:",{"type":61,"tag":180,"props":829,"children":831},{"className":182,"code":830,"language":184,"meta":185,"style":185},"if ! e2b --version >\u002Fdev\u002Fnull 2>&1; then\n  npm install -g @e2b\u002Fcli\nfi\n",[832],{"type":61,"tag":98,"props":833,"children":834},{"__ignoreMap":185},[835,879,902],{"type":61,"tag":191,"props":836,"children":837},{"class":193,"line":194},[838,844,849,854,859,864,869,874],{"type":61,"tag":191,"props":839,"children":841},{"style":840},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[842],{"type":67,"value":843},"if",{"type":61,"tag":191,"props":845,"children":846},{"style":234},[847],{"type":67,"value":848}," !",{"type":61,"tag":191,"props":850,"children":851},{"style":198},[852],{"type":67,"value":853}," e2b",{"type":61,"tag":191,"props":855,"children":856},{"style":203},[857],{"type":67,"value":858}," --version",{"type":61,"tag":191,"props":860,"children":861},{"style":234},[862],{"type":67,"value":863}," >",{"type":61,"tag":191,"props":865,"children":866},{"style":203},[867],{"type":67,"value":868},"\u002Fdev\u002Fnull",{"type":61,"tag":191,"props":870,"children":871},{"style":234},[872],{"type":67,"value":873}," 2>&1;",{"type":61,"tag":191,"props":875,"children":876},{"style":840},[877],{"type":67,"value":878}," then\n",{"type":61,"tag":191,"props":880,"children":881},{"class":193,"line":224},[882,887,892,897],{"type":61,"tag":191,"props":883,"children":884},{"style":198},[885],{"type":67,"value":886},"  npm",{"type":61,"tag":191,"props":888,"children":889},{"style":203},[890],{"type":67,"value":891}," install",{"type":61,"tag":191,"props":893,"children":894},{"style":203},[895],{"type":67,"value":896}," -g",{"type":61,"tag":191,"props":898,"children":899},{"style":203},[900],{"type":67,"value":901}," @e2b\u002Fcli\n",{"type":61,"tag":191,"props":903,"children":904},{"class":193,"line":245},[905],{"type":61,"tag":191,"props":906,"children":907},{"style":840},[908],{"type":67,"value":909},"fi\n",{"type":61,"tag":70,"props":911,"children":912},{},[913],{"type":67,"value":914},"The CLI package requires Node 20 or newer.",{"type":61,"tag":70,"props":916,"children":917},{},[918],{"type":67,"value":919},"Prefer detached sandboxes for non-interactive work so the command returns a sandbox ID and does not attach an interactive terminal:",{"type":61,"tag":180,"props":921,"children":923},{"className":182,"code":922,"language":184,"meta":185,"style":185},"e2b sandbox create --detach\ne2b sandbox create base --detach\n",[924],{"type":61,"tag":98,"props":925,"children":926},{"__ignoreMap":185},[927,946],{"type":61,"tag":191,"props":928,"children":929},{"class":193,"line":194},[930,934,938,942],{"type":61,"tag":191,"props":931,"children":932},{"style":198},[933],{"type":67,"value":8},{"type":61,"tag":191,"props":935,"children":936},{"style":203},[937],{"type":67,"value":428},{"type":61,"tag":191,"props":939,"children":940},{"style":203},[941],{"type":67,"value":433},{"type":61,"tag":191,"props":943,"children":944},{"style":203},[945],{"type":67,"value":443},{"type":61,"tag":191,"props":947,"children":948},{"class":193,"line":224},[949,953,957,961,965],{"type":61,"tag":191,"props":950,"children":951},{"style":198},[952],{"type":67,"value":8},{"type":61,"tag":191,"props":954,"children":955},{"style":203},[956],{"type":67,"value":428},{"type":61,"tag":191,"props":958,"children":959},{"style":203},[960],{"type":67,"value":433},{"type":61,"tag":191,"props":962,"children":963},{"style":203},[964],{"type":67,"value":438},{"type":61,"tag":191,"props":966,"children":967},{"style":203},[968],{"type":67,"value":443},{"type":61,"tag":70,"props":970,"children":971},{},[972,974,980],{"type":67,"value":973},"Run shell commands in a sandbox with ",{"type":61,"tag":98,"props":975,"children":977},{"className":976},[],[978],{"type":67,"value":979},"--",{"type":67,"value":981}," before shell flags so the CLI does not parse them:",{"type":61,"tag":180,"props":983,"children":985},{"className":182,"code":984,"language":184,"meta":185,"style":185},"e2b sandbox exec \u003Csandbox_id> -- bash -lc 'pwd && ls -la'\n",[986],{"type":61,"tag":98,"props":987,"children":988},{"__ignoreMap":185},[989],{"type":61,"tag":191,"props":990,"children":991},{"class":193,"line":194},[992,996,1000,1005,1010,1015,1020,1025,1030,1035,1040,1044,1049],{"type":61,"tag":191,"props":993,"children":994},{"style":198},[995],{"type":67,"value":8},{"type":61,"tag":191,"props":997,"children":998},{"style":203},[999],{"type":67,"value":428},{"type":61,"tag":191,"props":1001,"children":1002},{"style":203},[1003],{"type":67,"value":1004}," exec",{"type":61,"tag":191,"props":1006,"children":1007},{"style":234},[1008],{"type":67,"value":1009}," \u003C",{"type":61,"tag":191,"props":1011,"children":1012},{"style":203},[1013],{"type":67,"value":1014},"sandbox_i",{"type":61,"tag":191,"props":1016,"children":1017},{"style":323},[1018],{"type":67,"value":1019},"d",{"type":61,"tag":191,"props":1021,"children":1022},{"style":234},[1023],{"type":67,"value":1024},">",{"type":61,"tag":191,"props":1026,"children":1027},{"style":203},[1028],{"type":67,"value":1029}," --",{"type":61,"tag":191,"props":1031,"children":1032},{"style":203},[1033],{"type":67,"value":1034}," bash",{"type":61,"tag":191,"props":1036,"children":1037},{"style":203},[1038],{"type":67,"value":1039}," -lc",{"type":61,"tag":191,"props":1041,"children":1042},{"style":234},[1043],{"type":67,"value":286},{"type":61,"tag":191,"props":1045,"children":1046},{"style":203},[1047],{"type":67,"value":1048},"pwd && ls -la",{"type":61,"tag":191,"props":1050,"children":1051},{"style":234},[1052],{"type":67,"value":1053},"'\n",{"type":61,"tag":70,"props":1055,"children":1056},{},[1057],{"type":67,"value":1058},"For long-running processes, run them in the background and write a PID file in the sandbox:",{"type":61,"tag":180,"props":1060,"children":1062},{"className":182,"code":1061,"language":184,"meta":185,"style":185},"e2b sandbox exec \u003Csandbox_id> -- bash -lc 'nohup python server.py >server.log 2>&1 & echo $! >server.pid'\n",[1063],{"type":61,"tag":98,"props":1064,"children":1065},{"__ignoreMap":185},[1066],{"type":61,"tag":191,"props":1067,"children":1068},{"class":193,"line":194},[1069,1073,1077,1081,1085,1089,1093,1097,1101,1105,1109,1113,1118],{"type":61,"tag":191,"props":1070,"children":1071},{"style":198},[1072],{"type":67,"value":8},{"type":61,"tag":191,"props":1074,"children":1075},{"style":203},[1076],{"type":67,"value":428},{"type":61,"tag":191,"props":1078,"children":1079},{"style":203},[1080],{"type":67,"value":1004},{"type":61,"tag":191,"props":1082,"children":1083},{"style":234},[1084],{"type":67,"value":1009},{"type":61,"tag":191,"props":1086,"children":1087},{"style":203},[1088],{"type":67,"value":1014},{"type":61,"tag":191,"props":1090,"children":1091},{"style":323},[1092],{"type":67,"value":1019},{"type":61,"tag":191,"props":1094,"children":1095},{"style":234},[1096],{"type":67,"value":1024},{"type":61,"tag":191,"props":1098,"children":1099},{"style":203},[1100],{"type":67,"value":1029},{"type":61,"tag":191,"props":1102,"children":1103},{"style":203},[1104],{"type":67,"value":1034},{"type":61,"tag":191,"props":1106,"children":1107},{"style":203},[1108],{"type":67,"value":1039},{"type":61,"tag":191,"props":1110,"children":1111},{"style":234},[1112],{"type":67,"value":286},{"type":61,"tag":191,"props":1114,"children":1115},{"style":203},[1116],{"type":67,"value":1117},"nohup python server.py >server.log 2>&1 & echo $! >server.pid",{"type":61,"tag":191,"props":1119,"children":1120},{"style":234},[1121],{"type":67,"value":1053},{"type":61,"tag":70,"props":1123,"children":1124},{},[1125],{"type":67,"value":1126},"The CLI has explicit resume, but sandbox creation does not currently expose an auto-resume flag:",{"type":61,"tag":180,"props":1128,"children":1130},{"className":182,"code":1129,"language":184,"meta":185,"style":185},"e2b sandbox resume \u003Csandbox_id>\n",[1131],{"type":61,"tag":98,"props":1132,"children":1133},{"__ignoreMap":185},[1134],{"type":61,"tag":191,"props":1135,"children":1136},{"class":193,"line":194},[1137,1141,1145,1150,1154,1158,1162],{"type":61,"tag":191,"props":1138,"children":1139},{"style":198},[1140],{"type":67,"value":8},{"type":61,"tag":191,"props":1142,"children":1143},{"style":203},[1144],{"type":67,"value":428},{"type":61,"tag":191,"props":1146,"children":1147},{"style":203},[1148],{"type":67,"value":1149}," resume",{"type":61,"tag":191,"props":1151,"children":1152},{"style":234},[1153],{"type":67,"value":1009},{"type":61,"tag":191,"props":1155,"children":1156},{"style":203},[1157],{"type":67,"value":1014},{"type":61,"tag":191,"props":1159,"children":1160},{"style":323},[1161],{"type":67,"value":1019},{"type":61,"tag":191,"props":1163,"children":1164},{"style":234},[1165],{"type":67,"value":1166},">\n",{"type":61,"tag":70,"props":1168,"children":1169},{},[1170,1171,1177],{"type":67,"value":778},{"type":61,"tag":98,"props":1172,"children":1174},{"className":1173},[],[1175],{"type":67,"value":1176},"sandbox exec",{"type":67,"value":1178}," for operational commands against an existing sandbox:",{"type":61,"tag":180,"props":1180,"children":1182},{"className":182,"code":1181,"language":184,"meta":185,"style":185},"e2b sandbox exec \u003Csandbox_id> -- bash -lc 'python --version'\ne2b sandbox exec \u003Csandbox_id> -- bash -lc 'ls -la \u002Ftmp'\n",[1183],{"type":61,"tag":98,"props":1184,"children":1185},{"__ignoreMap":185},[1186,1242],{"type":61,"tag":191,"props":1187,"children":1188},{"class":193,"line":194},[1189,1193,1197,1201,1205,1209,1213,1217,1221,1225,1229,1233,1238],{"type":61,"tag":191,"props":1190,"children":1191},{"style":198},[1192],{"type":67,"value":8},{"type":61,"tag":191,"props":1194,"children":1195},{"style":203},[1196],{"type":67,"value":428},{"type":61,"tag":191,"props":1198,"children":1199},{"style":203},[1200],{"type":67,"value":1004},{"type":61,"tag":191,"props":1202,"children":1203},{"style":234},[1204],{"type":67,"value":1009},{"type":61,"tag":191,"props":1206,"children":1207},{"style":203},[1208],{"type":67,"value":1014},{"type":61,"tag":191,"props":1210,"children":1211},{"style":323},[1212],{"type":67,"value":1019},{"type":61,"tag":191,"props":1214,"children":1215},{"style":234},[1216],{"type":67,"value":1024},{"type":61,"tag":191,"props":1218,"children":1219},{"style":203},[1220],{"type":67,"value":1029},{"type":61,"tag":191,"props":1222,"children":1223},{"style":203},[1224],{"type":67,"value":1034},{"type":61,"tag":191,"props":1226,"children":1227},{"style":203},[1228],{"type":67,"value":1039},{"type":61,"tag":191,"props":1230,"children":1231},{"style":234},[1232],{"type":67,"value":286},{"type":61,"tag":191,"props":1234,"children":1235},{"style":203},[1236],{"type":67,"value":1237},"python --version",{"type":61,"tag":191,"props":1239,"children":1240},{"style":234},[1241],{"type":67,"value":1053},{"type":61,"tag":191,"props":1243,"children":1244},{"class":193,"line":224},[1245,1249,1253,1257,1261,1265,1269,1273,1277,1281,1285,1289,1294],{"type":61,"tag":191,"props":1246,"children":1247},{"style":198},[1248],{"type":67,"value":8},{"type":61,"tag":191,"props":1250,"children":1251},{"style":203},[1252],{"type":67,"value":428},{"type":61,"tag":191,"props":1254,"children":1255},{"style":203},[1256],{"type":67,"value":1004},{"type":61,"tag":191,"props":1258,"children":1259},{"style":234},[1260],{"type":67,"value":1009},{"type":61,"tag":191,"props":1262,"children":1263},{"style":203},[1264],{"type":67,"value":1014},{"type":61,"tag":191,"props":1266,"children":1267},{"style":323},[1268],{"type":67,"value":1019},{"type":61,"tag":191,"props":1270,"children":1271},{"style":234},[1272],{"type":67,"value":1024},{"type":61,"tag":191,"props":1274,"children":1275},{"style":203},[1276],{"type":67,"value":1029},{"type":61,"tag":191,"props":1278,"children":1279},{"style":203},[1280],{"type":67,"value":1034},{"type":61,"tag":191,"props":1282,"children":1283},{"style":203},[1284],{"type":67,"value":1039},{"type":61,"tag":191,"props":1286,"children":1287},{"style":234},[1288],{"type":67,"value":286},{"type":61,"tag":191,"props":1290,"children":1291},{"style":203},[1292],{"type":67,"value":1293},"ls -la \u002Ftmp",{"type":61,"tag":191,"props":1295,"children":1296},{"style":234},[1297],{"type":67,"value":1053},{"type":61,"tag":76,"props":1299,"children":1301},{"id":1300},"javascript-sdk",[1302],{"type":67,"value":1303},"JavaScript SDK",{"type":61,"tag":70,"props":1305,"children":1306},{},[1307,1308,1314,1316,1321],{"type":67,"value":778},{"type":61,"tag":98,"props":1309,"children":1311},{"className":1310},[],[1312],{"type":67,"value":1313},"Sandbox.create()",{"type":67,"value":1315}," with ",{"type":61,"tag":98,"props":1317,"children":1319},{"className":1318},[],[1320],{"type":67,"value":103},{"type":67,"value":1322}," for a fresh sandbox:",{"type":61,"tag":180,"props":1324,"children":1328},{"className":1325,"code":1326,"language":1327,"meta":185,"style":185},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import 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","ts",[1329],{"type":61,"tag":98,"props":1330,"children":1331},{"__ignoreMap":185},[1332,1362,1371,1430,1493],{"type":61,"tag":191,"props":1333,"children":1334},{"class":193,"line":194},[1335,1340,1345,1350,1354,1358],{"type":61,"tag":191,"props":1336,"children":1337},{"style":840},[1338],{"type":67,"value":1339},"import",{"type":61,"tag":191,"props":1341,"children":1342},{"style":323},[1343],{"type":67,"value":1344}," Sandbox ",{"type":61,"tag":191,"props":1346,"children":1347},{"style":840},[1348],{"type":67,"value":1349},"from",{"type":61,"tag":191,"props":1351,"children":1352},{"style":234},[1353],{"type":67,"value":286},{"type":61,"tag":191,"props":1355,"children":1356},{"style":203},[1357],{"type":67,"value":8},{"type":61,"tag":191,"props":1359,"children":1360},{"style":234},[1361],{"type":67,"value":1053},{"type":61,"tag":191,"props":1363,"children":1364},{"class":193,"line":224},[1365],{"type":61,"tag":191,"props":1366,"children":1368},{"emptyLinePlaceholder":1367},true,[1369],{"type":67,"value":1370},"\n",{"type":61,"tag":191,"props":1372,"children":1373},{"class":193,"line":245},[1374,1379,1384,1388,1393,1398,1402,1407,1412,1416,1421,1425],{"type":61,"tag":191,"props":1375,"children":1376},{"style":317},[1377],{"type":67,"value":1378},"const",{"type":61,"tag":191,"props":1380,"children":1381},{"style":323},[1382],{"type":67,"value":1383}," sandbox ",{"type":61,"tag":191,"props":1385,"children":1386},{"style":234},[1387],{"type":67,"value":331},{"type":61,"tag":191,"props":1389,"children":1390},{"style":840},[1391],{"type":67,"value":1392}," await",{"type":61,"tag":191,"props":1394,"children":1395},{"style":323},[1396],{"type":67,"value":1397}," Sandbox",{"type":61,"tag":191,"props":1399,"children":1400},{"style":234},[1401],{"type":67,"value":138},{"type":61,"tag":191,"props":1403,"children":1404},{"style":228},[1405],{"type":67,"value":1406},"create",{"type":61,"tag":191,"props":1408,"children":1409},{"style":323},[1410],{"type":67,"value":1411},"(",{"type":61,"tag":191,"props":1413,"children":1414},{"style":234},[1415],{"type":67,"value":296},{"type":61,"tag":191,"props":1417,"children":1418},{"style":203},[1419],{"type":67,"value":1420},"base",{"type":61,"tag":191,"props":1422,"children":1423},{"style":234},[1424],{"type":67,"value":296},{"type":61,"tag":191,"props":1426,"children":1427},{"style":323},[1428],{"type":67,"value":1429},")\n",{"type":61,"tag":191,"props":1431,"children":1432},{"class":193,"line":304},[1433,1437,1442,1446,1450,1454,1458,1463,1467,1472,1476,1480,1485,1489],{"type":61,"tag":191,"props":1434,"children":1435},{"style":317},[1436],{"type":67,"value":1378},{"type":61,"tag":191,"props":1438,"children":1439},{"style":323},[1440],{"type":67,"value":1441}," result ",{"type":61,"tag":191,"props":1443,"children":1444},{"style":234},[1445],{"type":67,"value":331},{"type":61,"tag":191,"props":1447,"children":1448},{"style":840},[1449],{"type":67,"value":1392},{"type":61,"tag":191,"props":1451,"children":1452},{"style":323},[1453],{"type":67,"value":428},{"type":61,"tag":191,"props":1455,"children":1456},{"style":234},[1457],{"type":67,"value":138},{"type":61,"tag":191,"props":1459,"children":1460},{"style":323},[1461],{"type":67,"value":1462},"commands",{"type":61,"tag":191,"props":1464,"children":1465},{"style":234},[1466],{"type":67,"value":138},{"type":61,"tag":191,"props":1468,"children":1469},{"style":228},[1470],{"type":67,"value":1471},"run",{"type":61,"tag":191,"props":1473,"children":1474},{"style":323},[1475],{"type":67,"value":1411},{"type":61,"tag":191,"props":1477,"children":1478},{"style":234},[1479],{"type":67,"value":296},{"type":61,"tag":191,"props":1481,"children":1482},{"style":203},[1483],{"type":67,"value":1484},"echo \"hello from e2b\"",{"type":61,"tag":191,"props":1486,"children":1487},{"style":234},[1488],{"type":67,"value":296},{"type":61,"tag":191,"props":1490,"children":1491},{"style":323},[1492],{"type":67,"value":1429},{"type":61,"tag":191,"props":1494,"children":1495},{"class":193,"line":313},[1496,1501,1505,1510,1515,1519],{"type":61,"tag":191,"props":1497,"children":1498},{"style":323},[1499],{"type":67,"value":1500},"console",{"type":61,"tag":191,"props":1502,"children":1503},{"style":234},[1504],{"type":67,"value":138},{"type":61,"tag":191,"props":1506,"children":1507},{"style":228},[1508],{"type":67,"value":1509},"log",{"type":61,"tag":191,"props":1511,"children":1512},{"style":323},[1513],{"type":67,"value":1514},"(result",{"type":61,"tag":191,"props":1516,"children":1517},{"style":234},[1518],{"type":67,"value":138},{"type":61,"tag":191,"props":1520,"children":1521},{"style":323},[1522],{"type":67,"value":1523},"stdout)\n",{"type":61,"tag":70,"props":1525,"children":1526},{},[1527],{"type":67,"value":1528},"Use lifecycle options when the sandbox should pause on timeout and resume on later activity:",{"type":61,"tag":180,"props":1530,"children":1532},{"className":1325,"code":1531,"language":1327,"meta":185,"style":185},"const sandbox = await Sandbox.create('base', {\n  lifecycle: { onTimeout: 'pause', autoResume: true },\n})\n",[1533],{"type":61,"tag":98,"props":1534,"children":1535},{"__ignoreMap":185},[1536,1592,1657],{"type":61,"tag":191,"props":1537,"children":1538},{"class":193,"line":194},[1539,1543,1547,1551,1555,1559,1563,1567,1571,1575,1579,1583,1588],{"type":61,"tag":191,"props":1540,"children":1541},{"style":317},[1542],{"type":67,"value":1378},{"type":61,"tag":191,"props":1544,"children":1545},{"style":323},[1546],{"type":67,"value":1383},{"type":61,"tag":191,"props":1548,"children":1549},{"style":234},[1550],{"type":67,"value":331},{"type":61,"tag":191,"props":1552,"children":1553},{"style":840},[1554],{"type":67,"value":1392},{"type":61,"tag":191,"props":1556,"children":1557},{"style":323},[1558],{"type":67,"value":1397},{"type":61,"tag":191,"props":1560,"children":1561},{"style":234},[1562],{"type":67,"value":138},{"type":61,"tag":191,"props":1564,"children":1565},{"style":228},[1566],{"type":67,"value":1406},{"type":61,"tag":191,"props":1568,"children":1569},{"style":323},[1570],{"type":67,"value":1411},{"type":61,"tag":191,"props":1572,"children":1573},{"style":234},[1574],{"type":67,"value":296},{"type":61,"tag":191,"props":1576,"children":1577},{"style":203},[1578],{"type":67,"value":1420},{"type":61,"tag":191,"props":1580,"children":1581},{"style":234},[1582],{"type":67,"value":296},{"type":61,"tag":191,"props":1584,"children":1585},{"style":234},[1586],{"type":67,"value":1587},",",{"type":61,"tag":191,"props":1589,"children":1590},{"style":234},[1591],{"type":67,"value":242},{"type":61,"tag":191,"props":1593,"children":1594},{"class":193,"line":224},[1595,1601,1606,1611,1616,1620,1624,1629,1633,1637,1642,1646,1652],{"type":61,"tag":191,"props":1596,"children":1598},{"style":1597},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[1599],{"type":67,"value":1600},"  lifecycle",{"type":61,"tag":191,"props":1602,"children":1603},{"style":234},[1604],{"type":67,"value":1605},":",{"type":61,"tag":191,"props":1607,"children":1608},{"style":234},[1609],{"type":67,"value":1610}," {",{"type":61,"tag":191,"props":1612,"children":1613},{"style":1597},[1614],{"type":67,"value":1615}," onTimeout",{"type":61,"tag":191,"props":1617,"children":1618},{"style":234},[1619],{"type":67,"value":1605},{"type":61,"tag":191,"props":1621,"children":1622},{"style":234},[1623],{"type":67,"value":286},{"type":61,"tag":191,"props":1625,"children":1626},{"style":203},[1627],{"type":67,"value":1628},"pause",{"type":61,"tag":191,"props":1630,"children":1631},{"style":234},[1632],{"type":67,"value":296},{"type":61,"tag":191,"props":1634,"children":1635},{"style":234},[1636],{"type":67,"value":1587},{"type":61,"tag":191,"props":1638,"children":1639},{"style":1597},[1640],{"type":67,"value":1641}," autoResume",{"type":61,"tag":191,"props":1643,"children":1644},{"style":234},[1645],{"type":67,"value":1605},{"type":61,"tag":191,"props":1647,"children":1649},{"style":1648},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[1650],{"type":67,"value":1651}," true",{"type":61,"tag":191,"props":1653,"children":1654},{"style":234},[1655],{"type":67,"value":1656}," },\n",{"type":61,"tag":191,"props":1658,"children":1659},{"class":193,"line":245},[1660,1665],{"type":61,"tag":191,"props":1661,"children":1662},{"style":234},[1663],{"type":67,"value":1664},"}",{"type":61,"tag":191,"props":1666,"children":1667},{"style":323},[1668],{"type":67,"value":1429},{"type":61,"tag":70,"props":1670,"children":1671},{},[1672,1673,1679],{"type":67,"value":778},{"type":61,"tag":98,"props":1674,"children":1676},{"className":1675},[],[1677],{"type":67,"value":1678},"Sandbox.connect()",{"type":67,"value":1680}," when a CLI step already created the sandbox:",{"type":61,"tag":180,"props":1682,"children":1684},{"className":1325,"code":1683,"language":1327,"meta":185,"style":185},"import 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",[1685],{"type":61,"tag":98,"props":1686,"children":1687},{"__ignoreMap":185},[1688,1715,1722,1786,1846],{"type":61,"tag":191,"props":1689,"children":1690},{"class":193,"line":194},[1691,1695,1699,1703,1707,1711],{"type":61,"tag":191,"props":1692,"children":1693},{"style":840},[1694],{"type":67,"value":1339},{"type":61,"tag":191,"props":1696,"children":1697},{"style":323},[1698],{"type":67,"value":1344},{"type":61,"tag":191,"props":1700,"children":1701},{"style":840},[1702],{"type":67,"value":1349},{"type":61,"tag":191,"props":1704,"children":1705},{"style":234},[1706],{"type":67,"value":286},{"type":61,"tag":191,"props":1708,"children":1709},{"style":203},[1710],{"type":67,"value":8},{"type":61,"tag":191,"props":1712,"children":1713},{"style":234},[1714],{"type":67,"value":1053},{"type":61,"tag":191,"props":1716,"children":1717},{"class":193,"line":224},[1718],{"type":61,"tag":191,"props":1719,"children":1720},{"emptyLinePlaceholder":1367},[1721],{"type":67,"value":1370},{"type":61,"tag":191,"props":1723,"children":1724},{"class":193,"line":245},[1725,1729,1733,1737,1741,1745,1749,1754,1759,1763,1768,1772,1777,1782],{"type":61,"tag":191,"props":1726,"children":1727},{"style":317},[1728],{"type":67,"value":1378},{"type":61,"tag":191,"props":1730,"children":1731},{"style":323},[1732],{"type":67,"value":1383},{"type":61,"tag":191,"props":1734,"children":1735},{"style":234},[1736],{"type":67,"value":331},{"type":61,"tag":191,"props":1738,"children":1739},{"style":840},[1740],{"type":67,"value":1392},{"type":61,"tag":191,"props":1742,"children":1743},{"style":323},[1744],{"type":67,"value":1397},{"type":61,"tag":191,"props":1746,"children":1747},{"style":234},[1748],{"type":67,"value":138},{"type":61,"tag":191,"props":1750,"children":1751},{"style":228},[1752],{"type":67,"value":1753},"connect",{"type":61,"tag":191,"props":1755,"children":1756},{"style":323},[1757],{"type":67,"value":1758},"(process",{"type":61,"tag":191,"props":1760,"children":1761},{"style":234},[1762],{"type":67,"value":138},{"type":61,"tag":191,"props":1764,"children":1765},{"style":323},[1766],{"type":67,"value":1767},"env",{"type":61,"tag":191,"props":1769,"children":1770},{"style":234},[1771],{"type":67,"value":138},{"type":61,"tag":191,"props":1773,"children":1774},{"style":323},[1775],{"type":67,"value":1776},"SANDBOX_ID",{"type":61,"tag":191,"props":1778,"children":1779},{"style":234},[1780],{"type":67,"value":1781},"!",{"type":61,"tag":191,"props":1783,"children":1784},{"style":323},[1785],{"type":67,"value":1429},{"type":61,"tag":191,"props":1787,"children":1788},{"class":193,"line":304},[1789,1793,1797,1801,1805,1809,1813,1817,1821,1825,1829,1833,1838,1842],{"type":61,"tag":191,"props":1790,"children":1791},{"style":317},[1792],{"type":67,"value":1378},{"type":61,"tag":191,"props":1794,"children":1795},{"style":323},[1796],{"type":67,"value":1441},{"type":61,"tag":191,"props":1798,"children":1799},{"style":234},[1800],{"type":67,"value":331},{"type":61,"tag":191,"props":1802,"children":1803},{"style":840},[1804],{"type":67,"value":1392},{"type":61,"tag":191,"props":1806,"children":1807},{"style":323},[1808],{"type":67,"value":428},{"type":61,"tag":191,"props":1810,"children":1811},{"style":234},[1812],{"type":67,"value":138},{"type":61,"tag":191,"props":1814,"children":1815},{"style":323},[1816],{"type":67,"value":1462},{"type":61,"tag":191,"props":1818,"children":1819},{"style":234},[1820],{"type":67,"value":138},{"type":61,"tag":191,"props":1822,"children":1823},{"style":228},[1824],{"type":67,"value":1471},{"type":61,"tag":191,"props":1826,"children":1827},{"style":323},[1828],{"type":67,"value":1411},{"type":61,"tag":191,"props":1830,"children":1831},{"style":234},[1832],{"type":67,"value":296},{"type":61,"tag":191,"props":1834,"children":1835},{"style":203},[1836],{"type":67,"value":1837},"cat important_file.md",{"type":61,"tag":191,"props":1839,"children":1840},{"style":234},[1841],{"type":67,"value":296},{"type":61,"tag":191,"props":1843,"children":1844},{"style":323},[1845],{"type":67,"value":1429},{"type":61,"tag":191,"props":1847,"children":1848},{"class":193,"line":313},[1849,1853,1857,1861,1865,1869],{"type":61,"tag":191,"props":1850,"children":1851},{"style":323},[1852],{"type":67,"value":1500},{"type":61,"tag":191,"props":1854,"children":1855},{"style":234},[1856],{"type":67,"value":138},{"type":61,"tag":191,"props":1858,"children":1859},{"style":228},[1860],{"type":67,"value":1509},{"type":61,"tag":191,"props":1862,"children":1863},{"style":323},[1864],{"type":67,"value":1514},{"type":61,"tag":191,"props":1866,"children":1867},{"style":234},[1868],{"type":67,"value":138},{"type":61,"tag":191,"props":1870,"children":1871},{"style":323},[1872],{"type":67,"value":1523},{"type":61,"tag":76,"props":1874,"children":1876},{"id":1875},"python-sdk",[1877],{"type":67,"value":1878},"Python SDK",{"type":61,"tag":70,"props":1880,"children":1881},{},[1882,1884,1889],{"type":67,"value":1883},"Use the context manager with ",{"type":61,"tag":98,"props":1885,"children":1887},{"className":1886},[],[1888],{"type":67,"value":103},{"type":67,"value":1890}," for short-lived tasks:",{"type":61,"tag":180,"props":1892,"children":1896},{"className":1893,"code":1894,"language":1895,"meta":185,"style":185},"language-py shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from e2b import Sandbox\n\nwith Sandbox.create(\"base\") as sandbox:\n    result = sandbox.commands.run('echo \"hello from e2b\"')\n    print(result.stdout)\n","py",[1897],{"type":61,"tag":98,"props":1898,"children":1899},{"__ignoreMap":185},[1900,1908,1915,1923,1931],{"type":61,"tag":191,"props":1901,"children":1902},{"class":193,"line":194},[1903],{"type":61,"tag":191,"props":1904,"children":1905},{},[1906],{"type":67,"value":1907},"from e2b import Sandbox\n",{"type":61,"tag":191,"props":1909,"children":1910},{"class":193,"line":224},[1911],{"type":61,"tag":191,"props":1912,"children":1913},{"emptyLinePlaceholder":1367},[1914],{"type":67,"value":1370},{"type":61,"tag":191,"props":1916,"children":1917},{"class":193,"line":245},[1918],{"type":61,"tag":191,"props":1919,"children":1920},{},[1921],{"type":67,"value":1922},"with Sandbox.create(\"base\") as sandbox:\n",{"type":61,"tag":191,"props":1924,"children":1925},{"class":193,"line":304},[1926],{"type":61,"tag":191,"props":1927,"children":1928},{},[1929],{"type":67,"value":1930},"    result = sandbox.commands.run('echo \"hello from e2b\"')\n",{"type":61,"tag":191,"props":1932,"children":1933},{"class":193,"line":313},[1934],{"type":61,"tag":191,"props":1935,"children":1936},{},[1937],{"type":67,"value":1938},"    print(result.stdout)\n",{"type":61,"tag":70,"props":1940,"children":1941},{},[1942],{"type":67,"value":1528},{"type":61,"tag":180,"props":1944,"children":1946},{"className":1893,"code":1945,"language":1895,"meta":185,"style":185},"sandbox = Sandbox.create(\n    \"base\",\n    lifecycle={\"on_timeout\": \"pause\", \"auto_resume\": True},\n)\n",[1947],{"type":61,"tag":98,"props":1948,"children":1949},{"__ignoreMap":185},[1950,1958,1966,1974],{"type":61,"tag":191,"props":1951,"children":1952},{"class":193,"line":194},[1953],{"type":61,"tag":191,"props":1954,"children":1955},{},[1956],{"type":67,"value":1957},"sandbox = Sandbox.create(\n",{"type":61,"tag":191,"props":1959,"children":1960},{"class":193,"line":224},[1961],{"type":61,"tag":191,"props":1962,"children":1963},{},[1964],{"type":67,"value":1965},"    \"base\",\n",{"type":61,"tag":191,"props":1967,"children":1968},{"class":193,"line":245},[1969],{"type":61,"tag":191,"props":1970,"children":1971},{},[1972],{"type":67,"value":1973},"    lifecycle={\"on_timeout\": \"pause\", \"auto_resume\": True},\n",{"type":61,"tag":191,"props":1975,"children":1976},{"class":193,"line":304},[1977],{"type":61,"tag":191,"props":1978,"children":1979},{},[1980],{"type":67,"value":1429},{"type":61,"tag":70,"props":1982,"children":1983},{},[1984],{"type":67,"value":1985},"For workflows that share a sandbox across steps, keep the sandbox ID and connect to it later:",{"type":61,"tag":180,"props":1987,"children":1989},{"className":1893,"code":1988,"language":1895,"meta":185,"style":185},"from e2b import Sandbox\n\nsandbox = Sandbox.connect(sandbox_id)\nresult = sandbox.commands.run(\"cat important_file.md\")\nprint(result.stdout)\n",[1990],{"type":61,"tag":98,"props":1991,"children":1992},{"__ignoreMap":185},[1993,2000,2007,2015,2023],{"type":61,"tag":191,"props":1994,"children":1995},{"class":193,"line":194},[1996],{"type":61,"tag":191,"props":1997,"children":1998},{},[1999],{"type":67,"value":1907},{"type":61,"tag":191,"props":2001,"children":2002},{"class":193,"line":224},[2003],{"type":61,"tag":191,"props":2004,"children":2005},{"emptyLinePlaceholder":1367},[2006],{"type":67,"value":1370},{"type":61,"tag":191,"props":2008,"children":2009},{"class":193,"line":245},[2010],{"type":61,"tag":191,"props":2011,"children":2012},{},[2013],{"type":67,"value":2014},"sandbox = Sandbox.connect(sandbox_id)\n",{"type":61,"tag":191,"props":2016,"children":2017},{"class":193,"line":304},[2018],{"type":61,"tag":191,"props":2019,"children":2020},{},[2021],{"type":67,"value":2022},"result = sandbox.commands.run(\"cat important_file.md\")\n",{"type":61,"tag":191,"props":2024,"children":2025},{"class":193,"line":313},[2026],{"type":61,"tag":191,"props":2027,"children":2028},{},[2029],{"type":67,"value":2030},"print(result.stdout)\n",{"type":61,"tag":76,"props":2032,"children":2034},{"id":2033},"practical-defaults",[2035],{"type":67,"value":2036},"Practical Defaults",{"type":61,"tag":83,"props":2038,"children":2039},{},[2040,2052,2065,2078],{"type":61,"tag":87,"props":2041,"children":2042},{},[2043,2045,2050],{"type":67,"value":2044},"Use the ",{"type":61,"tag":98,"props":2046,"children":2048},{"className":2047},[],[2049],{"type":67,"value":1420},{"type":67,"value":2051}," template unless a task requires a specific template.",{"type":61,"tag":87,"props":2053,"children":2054},{},[2055,2057,2063],{"type":67,"value":2056},"Prefer ",{"type":61,"tag":98,"props":2058,"children":2060},{"className":2059},[],[2061],{"type":67,"value":2062},"bash -lc",{"type":67,"value":2064}," for multi-command CLI execution.",{"type":61,"tag":87,"props":2066,"children":2067},{},[2068,2070,2076],{"type":67,"value":2069},"Put temporary files under ",{"type":61,"tag":98,"props":2071,"children":2073},{"className":2072},[],[2074],{"type":67,"value":2075},"\u002Ftmp",{"type":67,"value":2077}," or the current working directory inside the sandbox unless the task requires a specific path.",{"type":61,"tag":87,"props":2079,"children":2080},{},[2081,2083,2089,2090,2096],{"type":67,"value":2082},"For workloads that need code execution with ",{"type":61,"tag":98,"props":2084,"children":2086},{"className":2085},[],[2087],{"type":67,"value":2088},"run_code",{"type":67,"value":130},{"type":61,"tag":98,"props":2091,"children":2093},{"className":2092},[],[2094],{"type":67,"value":2095},"runCode",{"type":67,"value":2097},", use the Code Interpreter SDK.",{"type":61,"tag":2099,"props":2100,"children":2101},"style",{},[2102],{"type":67,"value":2103},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2105,"total":194},[2106],{"slug":4,"name":4,"fn":5,"description":6,"org":2107,"tags":2108,"stars":26,"repoUrl":27,"updatedAt":28},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2109,2110,2111,2112],{"name":21,"slug":22,"type":16},{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},{"name":24,"slug":25,"type":16},{"items":2114,"total":194},[2115],{"slug":4,"name":4,"fn":5,"description":6,"org":2116,"tags":2117,"stars":26,"repoUrl":27,"updatedAt":28},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2118,2119,2120,2121],{"name":21,"slug":22,"type":16},{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},{"name":24,"slug":25,"type":16}]