Small CLI that prints a JSON snapshot of this machine for troubleshooting and context.
cargo run -p system-info
cargo run -p system-info -- --pretty
cargo run -p system-info -- --pretty --indent=2The output is a single JSON object to stdout. Some fields are optional and will be null
or empty strings when the underlying command cannot run or returns no data.
{
"uname": { ... },
"user": { ... },
"env": { ... },
"dmi": { ... },
"xdg": { ... },
"cpu": { ... },
"proc": { ... },
"mkinitcpio": { ... },
"x11": { ... },
"pacman": { ... },
"lsblk": [ ... ],
"lspci": [ ... ],
"lsmod": [ ... ]
}Notes:
lsmodis intentionally last because it is the largest section.x11subfields can be missing if no X display is available.
kernel_release,machine
username,uid,gid,home_directory,login_shell
- Common environment variables:
user,logname,home,shell,path,lang,lc_all,lc_ctype,term
- BIOS and hardware identifiers from
/sys/class/dmi/id/*
- XDG environment variables such as
XDG_CACHE_HOME,XDG_RUNTIME_DIR,XDG_SESSION_TYPE, etc.
- Selected
lscpufields (architecture, model, cores, cache, virtualization, etc.)
cmdline,versionmeminfo.mem_totalfrom/proc/meminfo
modules,hooksfrom/etc/mkinitcpio.conf
xinput.devices: parsedxinput listxrandr.monitors: parsedxrandr --listmonitorsxrdb.resources: line list fromxrdb -queryxdpyinfo.dimensions,xdpyinfo.resolution
explicit:pacman -Qeoutput lines
- One entry per
lsblk --json --listrow with filesystem metadata. - Fields are stored as strings (including numbers) for simplicity.
- One entry per
lspci -nnkdevice with parsed IDs, subsystem info, and kernel modules.
- One entry per
lsmodline:module,size,used_by_count,used_by