简体中文
-c
e2b template build -c "<your-start-command>"
e2b template build
e2b.toml
template_id = "0r0efkbfwzfp9p7qpc1c" dockerfile = "e2b.Dockerfile" template_name = "my-agent-sandbox" start_cmd = "<your-start-command>"
import { Sandbox } from '@e2b/code-interpreter' // 生成您的自定义沙箱 const sandbox = await Sandbox.create({ id: 'my-agent-sandbox', // 如果您在生成沙箱时指定 onStderr 和 onStdout,您将看到启动命令的日志。 onStderr: output => console.log("stderr", output.line), onStdout: output => console.log("stdout", output.line), }) // 关闭沙箱 await sandbox.close()
e2b sandbox logs <sandbox-id>