A Go library for hardware discovery and inspection on Linux, Windows, and macOS without requiring root privileges.
ghw is a Go library for hardware discovery and inspection that allows developers to programmatically retrieve detailed information about system components like CPU, memory, storage, and network devices. It solves the problem of accessing hardware data without requiring root privileges, providing a consistent API across Linux, Windows, and macOS.
Go developers building system tools, monitoring applications, or infrastructure software that needs to query hardware specifications, such as DevOps engineers, SREs, and platform developers.
Developers choose ghw because it offers rootless hardware inspection, cross-platform support, and a well-documented, consistent API, eliminating the need for shelling out to privileged commands like dmidecode or parsing low-level system files manually.
Go HardWare discovery/inspection library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Accesses hardware information without requiring root privileges by using direct system queries, avoiding the need for privileged commands like dmidecode.
Works on Linux and Windows with partial macOS compatibility, ensuring broad deployment across different operating systems without major rewrites.
Provides detailed modules for CPU, memory, storage, network, PCI, GPU, and more, with rich structs including cache hierarchies and NIC capabilities.
Allows capturing and reading hardware information from snapshots, enabling offline analysis or testing in containerized or virtualized environments.
The library has only partial support for macOS, limiting its effectiveness for developers exclusively targeting Apple hardware or needing full feature parity.
For some network capabilities, ghw relies on external programs like ethtool, which may not be installed or permitted in secure environments, and disabling tools reduces data availability.
In containerized setups, ghw requires specific bind mounts like /dev/disk and /run to access full information, adding complexity to deployment and configuration.