Skip to content

Platform reference


PLATFORM_ID

PLATFORM_ID = __PLATFORM_ID

A short identifier for the current platform. Known values:

  • linux
  • windows
  • macos

PLATFORM_NAME

PLATFORM_NAME = __PLATFORM_NAME

The human readable name of the current platform. Known values:

  • Linux
  • Windows
  • macOS

DEFAULT_SHELL

DEFAULT_SHELL = __DEFAULT_SHELL

The default shell for the current platform. Values are taken from environment variables, with platform-specific fallbacks.

Platform Environment variables Fallback
linux SHELL bash
windows SHELL, COMSPEC cmd
macos SHELL zsh

join_command_args

join_command_args(args: list[str]) -> str

Create a valid shell command from a list of arguments.

Parameters:

Name Type Description Default
args list[str]

A list of command line arguments.

required

Returns:

Type Description
str

A single string of command line arguments.

get_machine_id

get_machine_id() -> UUID

Get a unique identifier for the current machine that is consistent across reboots and different processes. The following platform-specific methods are given priority:

Platform Method
linux The /sys/class/dmi/id/product_uuid, /etc/machine-id or /var/lib/dbus/machine-id files
windows The HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid registry key
macos The IOPlatformUUID property of the IOPlatformExpertDevice node in the I/O Registry

As a fallback, the ID will be generated using the MAC address.