Osinfo
A Cross-Platform Module for Collecting OS Information in Golang
Install / Use
/learn @JustinTimperio/OsinfoREADME
osinfo
What is osinfo?
OSinfo is a cross-platform OS Version collection tool. It is designed to unify multiple OS detection methods in a single module that can easily be integrated into other projects.
Officially Supported:
| Windows | MacOS | Linux | BSD | |---------------------|-----------------------|---------------------|---------| | Windows Server 2012 | 10.6 - Snow Leopard | Ubuntu | FreeBSD | | Windows Server 2016 | 10.7 - Lion | Debian | OpenBSD | | Windows Server 2019 | 10.8 - Mountain Lion | MXLinux | | | Windows 7 | 10.9 - Mavericks | Mint | | | Windows 8 | 10.10 - Yosemite | Kali | | | Windows 10 | 10.11 - El Capitan | ParrotOS | | | | 10.12 - Sierra | OpenSUSE Leap | | | | 10.13 - High Sierra | OpenSUSE TumbleWeed | | | | 10.14 - Mojave | OpenSUSE SLES | | | | 10.15 - Catalina | Arch | | | | 11.0 - Big Sur | Manjaro | | | | | Alpine | | | | | Fedora | | | | | RHEL | | | | | CentOS | | | | | Oracle | |
Example Usage
- Create
fetchinfo.go
package main
import (
"fmt"
"github.com/JustinTimperio/osinfo"
)
func main() {
release := osinfo.GetVersion()
fmt.Printf(release.String())
}
go mod initgo mod tidygo run fetchinfo.go
Example Outputs
--------------------
Runtime: linux
Architecture: amd64
OS Name: Arch Linux
Version: rolling
Kernel: 5.11.2-arch1-1
Distro: arch
Package Manager: pacman
--------------------
Runtime: linux
Architecture: amd64
OS Name: Debian GNU/Linux 10 (buster)
Version: 10
Kernel: 4.19.0-13-amd64
Distro: debian
Package Manager: apt
--------------------
Runtime: windows
Architecture: amd64
OS Name: Windows Server 2016 Standard Evaluation
Version: 10
Build: 14393
--------------------
Runtime: darwin
Architecture: amd64
OS Name: Mac OS X
Version: 11.0.1
Version Name: MacOS - Big Sur
--------------------
Runtime: freebsd
Architecture: amd64
OS Name: FreeBSD 12.1-RELEASE
Version: 12.1-RELEASE
Kernel: 1201000
Package Manger: pkg
--------------------
Runtime: openbsd
Architecture: amd64
OS Name: OpenBSD 6.7
Version: 6.7
Kernel: GENERIC.MP#182
Package Manger: pkg_add
--------------------
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
352.0kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
