Skip to content

Environment

Category: Core

Source: environment.dart

Classes

Environment

Runtime environment abstraction for paths and environment variables.

Constructor

dart
factory Environment.detect({
    String? cwd,
    Map<String, String>? vars,
    bool? isWindows,
  })
dart
factory Environment.test({
    required String home,
    String? cwd,
    Map<String, String> vars = const {},
    bool isWindows = false,
  })

Properties

PropertyTypeDescription
cwdString
homeString
varsMap&lt;String, String&gt;
isWindowsbool
glueHomeOverrideString?Explicit override for the Glue home directory. When set (via the GLUE_HOME environment variable), glueDir returns this path directly instead of $HOME/.glue. null when not overridden.
glueDirString get
configPathString get
configYamlPathString get
credentialsPathString get
modelsYamlPathString get
sessionsDirString get
logsDirString get
skillsDirString get
cacheDirString get
glueDirString get
configPathString get
configYamlPathString get
credentialsPathString get
modelsYamlPathString get
sessionsDirString get
logsDirString get
skillsDirString get
cacheDirString get
catalogCachePathString getPath the refreshed remote catalog is written to and loaded from. Honours $GLUE_CATALOG_CACHE so tests and power users can redirect it without touching $GLUE_HOME. Used by `glue catalog refresh

Methods

String sessionDir(SessionId sessionId)
String shortenPath(String path)

Replace a leading [home] with ~ for compact display. Returns [path] unchanged when [home] is empty or [path] doesn't sit beneath it.

void ensureDirectories()

Released under the MIT License.