Connection-backed operations, including commands, file access, terminals, and display access, automatically start a stopped Devbox. Explicitly call
start() when you need to wait for readiness before another operation.devboxes.create()
Create a Devbox and return an operational handle. Devboxes start by default. Set start: false to create one without activating it.
Example
Create a Linux Devbox from an image:API reference
Arguments and options
CreateDevboxInput
required
The Devbox name and configuration.
OperationOptions
Cancellation and timeout options. See Shared operation options.
Return value
Returns aDevbox handle. Its id, name, and info properties describe the created Devbox. A started Devbox reports info.state as "running"; one created with start: false reports "stopped".
More examples
Create a macOS Devbox
Create a stopped Devbox from a blueprint
devboxes.get()
Fetch a Devbox by ID or name. Unlike list(), this call resolves the current runtime state.
Example
API reference
Arguments and options
string
required
The Devbox ID or name.
OperationOptions
Cancellation and timeout options. See Shared operation options.
Return value
Returns a newDevbox handle whose info.state is "running" or "stopped".
devboxes.list()
Return one page of Devboxes. Listing avoids per-Devbox runtime lookups, so each returned handle has info.state set to "unknown" and no instanceId.
Example
API reference
Arguments and options
ListDevboxesOptions
Pagination, filtering, cancellation, and timeout options.
Return value
Returnsitems: Devbox[] and an optional opaque nextCursor. Pass nextCursor as the next call’s cursor, or use iterate() to traverse every page automatically. Call refresh() on a listed handle before relying on its runtime state.
devboxes.iterate()
Iterate over all Devboxes, fetching subsequent pages automatically. Handles have the same "unknown" state semantics as list().
Example
API reference
Arguments and options
Omit<ListDevboxesOptions, "cursor">
The
limit, orderBy, ephemeral, signal, and timeoutMs options from list(). Pagination cursors are managed internally.Return value
Returns an async iterator that yields eachDevbox from every page.
devboxes.start()
Start a Devbox and wait for readiness. Start it by ID or name, or use devbox.start() when you already have a Devbox object.
- By ID or name
- Devbox Object
devboxes.stop()
Stop a Devbox and invalidate its cached connection. Stop it by ID or name, or use devbox.stop() when you already have a Devbox object.
- By ID or name
- Devbox Object
devboxes.delete()
Delete a Devbox and invalidate its cached connection. Delete it by ID or name, or use devbox.delete() when you already have a Devbox object.
- By ID or name
- Devbox Object
devbox.refresh()
Re-fetch this Devbox, resolve its authoritative runtime state, and replace the handle’s info snapshot.
Example
API reference
Arguments and options
OperationOptions
Cancellation and timeout options. See Shared operation options.
Return value
Returns the same handle with current information andinfo.state set to "running" or "stopped".
devbox.update()
Update mutable Devbox settings and replace the handle’s info snapshot. This method preserves the state and instance ID currently recorded by the handle.
Example
API reference
Arguments and options
UpdateDevboxInput
required
The settings to update.
OperationOptions
Cancellation and timeout options. See Shared operation options.
Return value
Returns the same handle with updatedinfo. Call refresh() if another actor may have changed the Devbox’s runtime state.
Devbox information
Every handle exposes immutableid and name accessors and a read-only info snapshot. Lifecycle methods replace this snapshot, so read devbox.info again after awaiting one of those methods.
get(), refresh(), start(), and stop() resolve runtime state. list() and iterate() report "unknown" and omit instanceId. Connection-backed operations update the local snapshot to "running", but info is not a live subscription to server-side changes.
The optional shape contains vCPUs, memoryMB, and optional architecture and os fields. Other optional fields are absent when the service does not provide them.
Shared operation options
All methods on this page acceptOperationOptions.
OperationOptions
Controls cancellation and timeout behavior.
Related documentation
Run commands
Execute structured commands and shell scripts.
Work with files
Transfer and manipulate Devbox files.
Use blueprints
Define reusable Devbox configurations.