commands.run() メソッドを使用できます。
import { Sandbox } from 'novita-sandbox/code-interpreter'
const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('ls -l')
console.log(result)
await sandbox.kill()
from novita_sandbox.code_interpreter import Sandbox
sandbox = Sandbox.create()
result = sandbox.commands.run('ls -l')
print(result)
sandbox.kill()