CliRuntime class abstract

Provides access to process and platform runtime information.

This exposes system-level information that is distinct from the CLI's virtual working directory (cwd). While cli.cwd() returns the CLI's navigated directory, cli.runtime.processDirectory returns the actual process working directory (Directory.current).

Example:

// CLI's virtual working directory
print(cli.cwd());  // '/project' (navigated with cd)

// Actual process directory
print(cli.runtime.processDirectory);  // '/home/user' (process cwd)

// Platform information
print(cli.runtime.operatingSystem);  // 'macos'
print(cli.runtime.pid);  // 12345
Implementers

Constructors

CliRuntime()

Properties

environment → Map<String, String>
Environment variables as a map.
no setter
executable → String
Path to the Dart executable running this process.
no setter
executableArguments → List<String>
Arguments passed to the executable.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isAndroid → bool
Whether running on Android.
no setter
isIOS → bool
Whether running on iOS.
no setter
isLinux → bool
Whether running on Linux.
no setter
isMacOS → bool
Whether running on macOS.
no setter
isWindows → bool
Whether running on Windows.
no setter
localHostname → String
Local hostname.
no setter
numberOfProcessors → int
Number of processors available.
no setter
operatingSystem → String
Operating system name (e.g., 'linux', 'macos', 'windows').
no setter
operatingSystemVersion → String
Operating system version.
no setter
pathSeparator → String
Path separator for the current platform ('/' or '').
no setter
pid → int
The process ID of the current Dart VM.
no setter
processDirectory ↔ String
The actual process working directory (Directory.current.path).
getter/setter pair
processDirectoryObject → Directory
The Directory object for the current process directory.
no setter
resolvedExecutable → String
The resolved path to the Dart executable.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
script → Uri
The script URI being executed.
no setter
version → String
The Dart version string.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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