DaytonaEnvironment class

A persistent remote workspace sandbox backed by Daytona.

Provides isolated remote shell execution and file CRUD operations in the cloud.

Inheritance

Constructors

DaytonaEnvironment({String? apiKey, String? apiUrl, String? image, Duration timeout = const Duration(seconds: 300), Map<String, String>? envVars, Directory? workingDir, Directory? workingDirectory, Client? httpClient})
Creates a Daytona execution environment.

Properties

apiKey → String?
Daytona API key. If null, resolved from DAYTONA_API_KEY env var.
final
apiUrl → String?
Daytona API URL endpoint. Defaults to https://app.daytona.io/api.
final
envVars → Map<String, String>?
Environment variables configured inside the sandbox.
final
hashCode → int
The hash code for this object.
no setterinherited
image → String?
Sandbox image or template identifier.
final
isInitialized ↔ bool
Whether this environment has been initialized and not yet closed.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sandboxId → String?
Active Daytona sandbox identifier, if initialized.
no setter
scope → EnvironmentScope
Which agent runs share one resource of this environment.
no setterinherited
timeout → Duration
Sandbox execution timeout.
final
workingDir → Directory
Returns the sandbox working directory (/workspaces by default).
no setteroverride
workingDirectory → Object
Workspace root used by environment operations when known, falling back to Directory.current.absolute for backward compatibility.
no setterinherited

Methods

close() → Future<void>
Releases any resources retained by the environment.
override
execute(String command, {Duration? timeout = const Duration(seconds: 30), Context? ctx}) → Future<ExecutionResult>
Executes command within workingDirectory, optionally using ctx.
override
initialize({Context? ctx}) → Future<void>
Performs any setup required before tool calls, optionally using ctx.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readFile(Object path, {Context? ctx}) → Future<Uint8List>
Reads bytes from a file relative to workingDirectory, optionally using ctx.
override
readFileStream(Object path, {Context? ctx}) → Stream<List<int>>
Streams raw byte chunks from a file relative to workingDirectory.
inherited
toString() → String
A string representation of this object.
inherited
writeFile(Object path, covariant Object content, {Context? ctx}) → Future<void>
Writes content (String or List<int>) to a file relative to workingDirectory.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited