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

    Class DevboxCmdOps

    Command execution operations for a devbox. Provides methods for executing commands synchronously and asynchronously.

    Index

    Methods

    Methods

    • Execute a command asynchronously without waiting for completion. Optionally provide callbacks to stream logs in real-time as they are produced.

      Callbacks fire in real-time as logs arrive. When you call execution.result(), it will wait for both the command to complete and all streaming to finish.

      Parameters

      Returns Promise<RunloopSDK.Devbox.Execution>

      Execution object for tracking and controlling the command

      const execution = await devbox.cmd.execAsync('long-running-task.sh', {
      stdout: (line) => console.log(`[LOG] ${line}`),
      });

      // Do other work while command runs...

      const result = await execution.result();
      if (result.success) {
      console.log('Task completed successfully!');
      }