shirou/gopsutil ? reverse-engineered prompt

Reverse engineered prompt

Build me a Go library that works like psutil, so I can easily get system info from a program without doing a lot of low level work myself.

I want functions for things like CPU usage, memory, disk space, network stats, running processes, host details, load average, and sensors where the platform supports it. The results should come back as simple structs, be easy to print, and also convert nicely to JSON. It should work across Linux, macOS, Windows, FreeBSD, OpenBSD, Solaris, and other supported systems as much as possible, and try to avoid using cgo if you can.

Please keep the API clean and consistent, and include any platform specific extras where they make sense. If you need to check the latest system details or docs online while building it, go ahead. I’d also like a small example showing how to read total memory and print it.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab