execution_id before the command finishes. Use that ID to check its status, read its output, or cancel it. If the machine is sleeping, it wakes before the command starts.
For an interactive terminal where you type commands as you work, use SSH.
Run a Linux command
The examples below require an existing machine. Use itsmachine_id wherever a machine ID is shown. To create one, see Create a machine.
The following example runs echo "hello world" on the remote machine. Commands follow the argument-vector convention described in execve(2): the first item names the executable, and each remaining item is one argument. The CLI accepts a JSON array. SDKs use a list or array in your language.
Arguments are passed directly to the executable. To use shell features such as &&, pipes, or variable expansion, invoke a shell explicitly. For example, ["sh", "-c", "echo hello world && ls -la"] runs both commands on the machine.
execution_id and use it in the following requests. Assign it to EXECUTION_ID in the CLI, execution_id in Python, or executionId in TypeScript and Go.
Receiving an ID means the execution was created. Check its status to find out whether the command succeeded.
Check whether the command finished
Retrieve the execution using the ID returned when you created it. Repeat this request until the status issucceeded, failed, cancelled, or expired. These are terminal states, meaning the execution has finished.
When retry_after_ms is present, wait at least that many milliseconds before checking again.
wake_in_progress, queued, and running. Terminal states are succeeded, failed, cancelled, and expired.
Read output
Once the command finishes, read its standard output (stdout) and standard error (stderr). For the echo example, stdout contains hello world. If the command failed, inspect its exit code, error details, and stderr.
The output response also includes total byte counts and truncation flags. Each inline stream is capped at 64 KiB.
Execution options
Use these options when creating an execution from the CLI or an SDK.
The following example passes text to
cat, which copies standard input to standard output. It sets the working directory, an environment variable, and a one-minute timeout.
dedalus machines executions create --help for the available flags, or use the SDK documentation for your language.
Read execution events
Events provide an ordered log of lifecycle changes andstdout or stderr chunks. Results are cursor-paginated.
List executions
List executions on a machine, newest first. Results are cursor-paginated.cursor from a prior response’s next_cursor to fetch the next page. Use limit to set the page size.
