Shell Commands
Running Commands
Section titled “Running Commands”result = cell.command("ls -la /data/")print(result.stdout)print(result.exit_code)Background Execution
Section titled “Background Execution”handle = cell.command("python long_script.py", background=True)
# Do other work...
handle.wait(timeout_ms=60000)print(handle.stdout)Piping and Chaining
Section titled “Piping and Chaining”result = cell.command("echo 'hello' | tr 'h' 'H'")print(result.stdout) # "Hello"Process Management
Section titled “Process Management”# List running processesprocesses = cell.processes()for p in processes: print(f"PID {p.pid}: {p.command}")
# Kill a processhandle.kill()