> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dedaluslabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use Dedalus Cloud Services for the platform and Dedalus Machines for the Linux VM product.
> A default Machine has 1 vCPU, 4096 MiB of memory, 10 GiB of storage, and sleeps after 300 idle seconds.
> Raw mutating HTTP requests require Idempotency-Key. Official SDK clients generate one unless the caller overrides it.
> Raw and generated SDK SSH-session requests require public_key. The dedalus ssh CLI generates an ephemeral keypair.
> SSH authorization lasts 10 minutes before connection. A connected session closes after 30 idle minutes or 12 hours total.
> Sleeping stops compute billing. Persistent storage remains billable or counts against the included allowance.
> Do not infer deletion retention, Hobby storage overages, concurrent SSH limits, or unreleased feature availability.
> For raw API contracts, use the canonical control-plane OpenAPI document in the dedalus monorepo.

# Manage Machines

> List, inspect, watch, and update Dedalus Machines

Use these commands to inspect a machine or change its configuration. To create, sleep, wake, or
delete a machine, see [Lifecycle](/dcs/dm/lifecycle).

## List machines

List returns every machine in your account, including sleeping machines. Each item includes its
resources, autosleep setting, desired state, and current lifecycle phase.

<CodeGroup>
  ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark"}}
  dedalus machines list
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  machines = client.machines.list()
  ```

  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const machines = await client.machines.list();
  ```

  ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"}}
  machines, _ := client.Machines.List(ctx, dedalus.MachineListParams{})
  fmt.Println(len(machines.Items))
  ```
</CodeGroup>

<Accordion title="Parameters">
  <ParamField query="cursor" type="string">
    Pagination cursor from a prior page's `next_cursor`.
  </ParamField>

  <ParamField query="limit" type="integer">
    Maximum number of machines to return per page.
  </ParamField>
</Accordion>

## Retrieve a machine

Retrieve returns the latest view of one machine, including its resources, autosleep setting,
desired state, and lifecycle status.

<CodeGroup>
  ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark"}}
  dedalus machines retrieve --machine-id <machine_id>
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  machine = client.machines.retrieve(machine_id="<machine_id>")
  ```

  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const machine = await client.machines.retrieve({ machine_id: "<machine_id>" });
  ```

  ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"}}
  machine, _ := client.Machines.Get(ctx, dedalus.MachineGetParams{
      MachineID: machineID,
  })
  fmt.Println(machine.Status.Phase)
  ```
</CodeGroup>

<Accordion title="Parameters">
  <ParamField path="machine_id" type="string" required>
    The machine to retrieve.
  </ParamField>
</Accordion>

## Watch a machine

Watch streams lifecycle changes as Server-Sent Events (SSE). Each event contains the latest machine
state. The stream closes when the machine reaches its desired state, so use it instead of polling
after a lifecycle operation.

<CodeGroup>
  ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark"}}
  dedalus machines watch --machine-id <machine_id>
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  for machine in client.machines.watch(machine_id="<machine_id>"):
      print(machine.status.phase)
  ```

  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const stream = await client.machines.watch({ machine_id: "<machine_id>" });
  for await (const machine of stream) {
    console.log(machine.status.phase);
  }
  ```

  ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"}}
  stream := client.Machines.WatchStreaming(ctx, dedalus.MachineWatchParams{
      MachineID: machineID,
  })
  for stream.Next() {
      fmt.Println(stream.Current().Status.Phase)
  }
  ```
</CodeGroup>

<Accordion title="Parameters">
  <ParamField path="machine_id" type="string" required>
    The machine to watch.
  </ParamField>

  <ParamField header="Last-Event-ID" type="string">
    Resource version from a prior event. Use it to resume an interrupted stream.
  </ParamField>
</Accordion>

## Update a machine

Update changes one or more configured resources. Fields you leave out keep their current values.

<CodeGroup>
  ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark"}}
  dedalus machines update --machine-id <machine_id> --memory-mib 8192
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  client.machines.update(machine_id="<machine_id>", memory_mib=8192)
  ```

  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  await client.machines.update({ machine_id: "<machine_id>", memory_mib: 8192 });
  ```

  ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"}}
  client.Machines.Update(ctx, dedalus.MachineUpdateParams{
      MachineID: machineID,
      UpdateParams: dedalus.UpdateParams{
          MemoryMiB: dedalus.Int(8192),
      },
  })
  ```
</CodeGroup>

<Accordion title="Parameters">
  <ParamField path="machine_id" type="string" required>
    The machine to update.
  </ParamField>

  <ParamField body="vcpu" type="number">
    CPU allocated to the machine, measured in virtual CPUs.
  </ParamField>

  <ParamField body="memory_mib" type="integer">
    Memory allocated to the machine, measured in mebibytes (MiB).
  </ParamField>

  <ParamField body="storage_gib" type="integer">
    Persistent storage allocated to the machine, measured in gibibytes (GiB).
  </ParamField>

  <ParamField body="autosleep" type="string">
    Idle time before the machine sleeps. Accepts durations such as `30s`, `15m`, `2h`, raw seconds,
    or `never` to disable autosleep.
  </ParamField>
</Accordion>
