@runloop/api-client - v1.18.1
    Preparing search index...

    Execution object for tracking async command execution with streaming support.

    The Execution class represents an asynchronous command execution on a devbox. It provides methods to track the execution state, wait for completion, and control the execution (e.g., kill it if needed).

    Executions are typically created via devbox.cmd.execAsync():

    import { RunloopSDK } from '@runloop/api-client-ts';

    const runloop = new RunloopSDK();
    const devbox = runloop.devbox.fromId('devbox-123');

    // Start async execution with streaming
    const execution = await devbox.cmd.execAsync('npx http-server -p 8080', {
    stdout: (line) => console.log(`[LOG] ${line}`),
    stderr: (line) => console.error(`[ERROR] ${line}`),
    });

    // Do other work while command runs...

    // End the process early
    const excution.kill();
    Index

    Accessors

    Methods

    • Get the current state of the execution.

      Parameters

      • Optionaloptions: RequestOptions<unknown>

      Returns Promise<DevboxAsyncExecutionDetailView>

      const execution = await devbox.cmd.execAsync('npx http-server -p 8080');
      const state = await execution.getState();
      console.log(`Status: ${state.status}`);
    • Kill the execution if it's still running.

      Parameters

      • Optionaloptions: RequestOptions<unknown>

        Request options

      Returns Promise<void>

      Promise that resolves when the execution is killed