Skip to main content
Use the runCode/run_code method to run bash code inside the sandbox. You’ll need to pass the language parameter with value bash.
import { Sandbox } from '@e2b/code-interpreter'

const sbx = await Sandbox.create()
const execution = await sbx.runCode('echo "Hello, world!"', { language: 'bash' })
console.log(execution)
from e2b_code_interpreter import Sandbox

sbx = Sandbox.create()
execution = sbx.run_code("echo 'Hello, world!'", language="bash")
print(execution)