Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Update commit
Vasek Mlejnsky73bfed151268
diff --git a/apps/web/src/app/(docs)/docs/commands/background/page.mdx b/apps/web/src/app/(docs)/docs/commands/background/page.mdxnew file mode 100644index 000000000..e971fc722--- /dev/null+++ b/apps/web/src/app/(docs)/docs/commands/background/page.mdx@@ -0,0 +1,34 @@+# Running commands in background++To run commands in background, pass the `background` option to the `commands.run()` method. This will return immediately and the command will continue to run in the sandbox.+You can then later kill the command using the `commands.kill()` method.++<CodeGroup>+```js+import { Sandbox } from '@e2b/code-interpreter'++const sandbox = await Sandbox.create()++// Start the command in the background+const command = await sandbox.commands.run('echo hello; sleep 10; echo world', {+ background: true, // $HighlightLine+ onStdout: (data) => {+ console.log(data)+ },+})++// Kill the command+await command.kill()+```+```python+from e2b_code_interpreter import Sandbox++sandbox = Sandbox()++# Start the command in the background+command = sandbox.commands.run('echo hello; sleep 10; echo world', on_stdout=lambda data: print(data), background=True)++# Kill the command+command.kill()+```+</CodeGroup>diff --git a/apps/web/src/components/Navigation/routes.tsx b/apps/web/src/components/Navigation/routes.tsxindex fe39d1faf..e5507fe26 100644--- a/apps/web/src/components/Navigation/routes.tsx+++ b/apps/web/src/components/Navigation/routes.tsx@@ -367,18 +367,18 @@ export const routes: NavGroup[] = []},{- title: '* Commands',+ title: 'Commands',items: [{- title: '* Overview',+ title: 'Overview',href: '/docs/commands',},{- title: '* Streaming',+ title: 'Streaming',href: '/docs/commands/streaming',},{- title: '* Run commands in background',+ title: 'Run commands in background',href: '/docs/commands/background',},]