CLIΒΆ
The extra-platforms command-line tool detects and reports the architecture, platform, shell, terminal, CI system, and agent of the current environment.
InvocationΒΆ
$ uvx extra-platforms
$ extra-platforms
$ python -m extra_platforms
$ uv run extra-platforms
OptionsΒΆ
The full option list is rendered live from the CLIβs own parser, so it never drifts from the code:
usage: extra-platforms [-h] [--json] [--version]
Detect and report the architecture, platform, shell, terminal, CI, and agent
of the current environment.
options:
-h, --help show this help message and exit
--json output results as JSON
--version show program's version number and exit
--json is the option worth highlighting: it swaps the default human-readable report for a single JSON object, handy for scripting and piping into tools like jq (see JSON output below).
Default outputΒΆ
The default output prints each detected trait with its metadata, followed by summary tables of all detected traits and groups:
$ extra-platforms
extra-platforms 13.5.3
ββ Architecture ββ π± ARM64 (AArch64) ββ[AARCH64]ββββββββββββ
id: aarch64
aliases: arm64
name: ARM64 (AArch64)
icon: π±
url: https://en.wikipedia.org/wiki/AArch64
current: True
machine: arm64
symbol: AARCH64
detection: is_aarch64()
pytest: @skip_aarch64, @unless_aarch64
groups: ALL_ARCHITECTURES, ALL_ARM, ALL_TRAITS, ARCH_64_BIT, LITTLE_ENDIAN
ββ Platform ββ π macOS ββ[MACOS]ββββββββββββββββββββββββββββ
id: macos
(...)
JSON outputΒΆ
The --json flag produces a single JSON object with all detected traits and groups:
$ extra-platforms --json
{
"version": "13.5.3",
"architecture": {
"id": "aarch64",
"name": "ARM64 (AArch64)",
"icon": "π±",
"url": "https://en.wikipedia.org/wiki/AArch64",
"current": true,
"machine": "arm64",
"processor": null,
"aliases": ["arm64"],
"symbol": "AARCH64",
"detection": "is_aarch64",
"groups": ["ALL_ARCHITECTURES", "ALL_ARM", "ALL_TRAITS", "ARCH_64_BIT", "LITTLE_ENDIAN"]
},
"platform": { "..." : "..." },
"shell": { "..." : "..." },
"terminal": { "..." : "..." },
"ci": { "..." : "..." },
"agent": { "..." : "..." },
"groups": [
{
"id": "all_arm",
"name": "ARM architectures",
"icon": "π±",
"symbol": "ALL_ARM",
"detection": "is_any_arm",
"canonical": true
}
]
}
Each trait section contains:
Field |
Description |
|---|---|
Unique trait identifier |
|
Human-readable name |
|
Single-glyph icon |
|
Reference URL |
|
Whether this trait matches the current environment |
|
Alternative IDs for this trait |
|
Uppercase symbol for Python imports ( |
|
Detection function name ( |
|
Groups this trait belongs to |
Trait-specific fields (like machine, version, codename) are included when available.
Scripting examplesΒΆ
Extract the current platform ID:
$ extra-platforms --json | jq --raw-output .platform.id
macos
List all detected group names:
$ extra-platforms --json | jq --raw-output '.groups[].name'
ARM architectures
All BSD
All Unix
(...)
Check if running in CI:
$ extra-platforms --json | jq '.ci.id != "unknown_ci"'
false