Stream stdout and stderr
GET /v1/machines/{id}/ws?channel=exec (sending exec_start and reading
exec_stdout/exec_stderr/exec_exit), so there is no curl equivalent. The
non-streaming POST /v1/machines/{id}/exec endpoint returns only the final
result.
Passing callbacks to machine.commands.run(...) without background=True uses
the same streaming path:
Connect to a running process
GET /v1/machines/{id}/ws?channel=exec with an exec_connect message, so
there is no curl equivalent.
Use connect(pid) for background processes that are still running. It attaches
to the exec WebSocket and waits for the process exit event when possible.
Live background streaming
background=True with callbacks starts the command through the exec
WebSocket and returns a BackgroundCommand after an exec_started message. The
CLI equivalent is nullspace machine process stream with --cwd, --env, and
--timeout flags.
Behavior
Streaming usesGET /v1/machines/{id}/ws?channel=exec. SDK callers send
exec_start for new commands or exec_connect for existing PIDs and then read
exec_started, exec_stdout, exec_stderr, exec_exit, and error messages.
Use the REST get_logs endpoint when you only need logs after the process has
started.