The standard code-interpreter template includes a Bash kernel for shell workflows that should be captured as notebook-style executions.
result = machine.run_code("""
pwd
printf 'hello from bash\n'
""", language="bash")

print("".join(result.logs.stdout))
const result = await machine.code.run(`
pwd
printf 'hello from bash\n'
`, { language: "bash" });

console.log(result.logs.stdout.join(""));
nullspace machine code run mch_123 "pwd
printf 'hello from bash\n'" --language bash
# returns a Server-Sent Events stream of JSON events
curl -N -X POST "${NULLSPACE_API_URL}/v1/machines/mch_123/code/execute" \
  -H "Authorization: Bearer ${NULLSPACE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"code": "pwd\nprintf '\''hello from bash\\n'\''", "language": "bash"}'
For ordinary process execution, prefer machine.commands.run(). Use Bash code interpreter cells when you want the output represented as a code execution with the same callbacks, results, and artifact handling as other interpreter cells.