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

    Class DevboxOps

    Devbox SDK interface for managing devboxes.

    The DevboxOps class provides a high-level abstraction for managing devboxes, which are isolated development environments running in Runloop's cloud infrastructure. Devboxes can be created from blueprints or snapshots, and support command execution, file operations, and lifecycle management.

    This interface is accessed via RunloopSDK.devbox. You should construct a RunloopSDK instance and use it from there:

    const runloop = new RunloopSDK();
    const devbox = await runloop.devbox.create({ name: 'my-devbox' });
    const result = await devbox.cmd.exec('echo "Hello, World!"');
    Index

    Methods

    • Create a new Devbox and wait for it to reach the running state. This is the recommended way to create a devbox as it ensures it's ready to use.

      Supports the convenient SDK mount syntax for StorageObjects:

      mounts: [{ '/path/on/devbox': storageObject }]
      

      Parameters

      • Optionalparams: SDKDevboxCreateParams

        Parameters for creating the devbox, with SDK mount syntax support.

      • Optionaloptions: RequestOptions<unknown> & { polling?: Partial<PollingOptions<DevboxView>> }

        Request options including polling configuration.

      Returns Promise<RunloopSDK.Devbox>

      A Devbox instance.

      const runloop = new RunloopSDK();
      const devbox = await runloop.devbox.create({ name: 'my-devbox' });

      devbox.cmd.exec('echo "Hello, World!"');
      // Create devbox with mounted storage object
      const storageObject = await runloop.storageObject.uploadFromFile('./config.txt', 'config.txt');
      const devbox = await runloop.devbox.create({
      name: 'devbox-with-file',
      mounts: [{ '/home/user/config.txt': storageObject }]
      });
    • Create a new devbox from a blueprint ID.

      Parameters

      • blueprintId: string

        The ID of the blueprint to use.

      • Optionalparams: Omit<DevboxCreateParams, "blueprint_id" | "blueprint_name" | "snapshot_id">

        Additional parameters for creating the devbox (excluding blueprint_id, snapshot_id, and blueprint_name).

      • Optionaloptions: RequestOptions<unknown> & { polling?: Partial<PollingOptions<DevboxView>> }

        Request options including polling configuration.

      Returns Promise<RunloopSDK.Devbox>

      A Devbox instance.

    • Create a new devbox from a blueprint name.

      Parameters

      • blueprintName: string

        The name of the blueprint to use.

      • Optionalparams: Omit<DevboxCreateParams, "blueprint_id" | "blueprint_name" | "snapshot_id">

        Additional parameters for creating the devbox (excluding blueprint_id, snapshot_id, and blueprint_name).

      • Optionaloptions: RequestOptions<unknown> & { polling?: Partial<PollingOptions<DevboxView>> }

        Request options including polling configuration.

      Returns Promise<RunloopSDK.Devbox>

      A Devbox instance.

    • Create a new devbox from a snapshot.

      Parameters

      • snapshotId: string

        The ID of the snapshot to use.

      • Optionalparams: Omit<DevboxCreateParams, "blueprint_id" | "blueprint_name" | "snapshot_id">

        Additional parameters for creating the devbox (excluding snapshot_id, blueprint_id, and blueprint_name).

      • Optionaloptions: RequestOptions<unknown> & { polling?: Partial<PollingOptions<DevboxView>> }

        Request options including polling configuration.

      Returns Promise<RunloopSDK.Devbox>

      A Devbox instance.

      const devbox = await Devbox.createFromSnapshot(
      runloop,
      snapshot.id,
      { name: 'restored-devbox' }
      );