GuillaumeGomez/sysinfo
Cross-platform library to fetch system information
Healthy across all four use cases
weakest axisPermissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 1d ago
- ✓12 active contributors
- ✓MIT licensed
Show all 6 evidence items →Show less
- ✓CI configured
- ✓Tests present
- ⚠Single-maintainer risk — top contributor 85% of recent commits
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/guillaumegomez/sysinfo)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/guillaumegomez/sysinfo on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: GuillaumeGomez/sysinfo
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/GuillaumeGomez/sysinfo shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across all four use cases
- Last commit 1d ago
- 12 active contributors
- MIT licensed
- CI configured
- Tests present
- ⚠ Single-maintainer risk — top contributor 85% of recent commits
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live GuillaumeGomez/sysinfo
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/GuillaumeGomez/sysinfo.
What it runs against: a local clone of GuillaumeGomez/sysinfo — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in GuillaumeGomez/sysinfo | Confirms the artifact applies here, not a fork |
| 2 | License is still MIT | Catches relicense before you depend on it |
| 3 | Default branch main exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 31 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of GuillaumeGomez/sysinfo. If you don't
# have one yet, run these first:
#
# git clone https://github.com/GuillaumeGomez/sysinfo.git
# cd sysinfo
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of GuillaumeGomez/sysinfo and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "GuillaumeGomez/sysinfo(\\.git)?\\b" \\
&& ok "origin remote is GuillaumeGomez/sysinfo" \\
|| miss "origin remote is not GuillaumeGomez/sysinfo (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(MIT)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"MIT\"" package.json 2>/dev/null) \\
&& ok "license is MIT" \\
|| miss "license drift — was MIT at generation time"
# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
&& ok "default branch main exists" \\
|| miss "default branch main no longer exists"
# 4. Critical files exist
test -f "src/lib.rs" \\
&& ok "src/lib.rs" \\
|| miss "missing critical file: src/lib.rs"
test -f "src/common/system.rs" \\
&& ok "src/common/system.rs" \\
|| miss "missing critical file: src/common/system.rs"
test -f "src/unix/mod.rs" \\
&& ok "src/unix/mod.rs" \\
|| miss "missing critical file: src/unix/mod.rs"
test -f "Cargo.toml" \\
&& ok "Cargo.toml" \\
|| miss "missing critical file: Cargo.toml"
test -f "src/c_interface.rs" \\
&& ok "src/c_interface.rs" \\
|| miss "missing critical file: src/c_interface.rs"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 31 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~1d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/GuillaumeGomez/sysinfo"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
sysinfo is a Rust crate that provides a cross-platform abstraction layer for querying system information (CPU, memory, disk, processes, networks, hardware components) across 8+ operating systems including Linux, Windows, macOS, FreeBSD, Android, and iOS. It unifies the fragmented OS-specific APIs (procfs on Linux, WMI on Windows, IOKit on macOS) into a single idiomatic Rust interface, with graceful no-op behavior on unsupported platforms via the IS_SUPPORTED_SYSTEM constant. Monolithic single-crate design: src/common/ contains shared trait definitions (Component, Disk, Network, User, System in system.rs), src/unix/ segregates POSIX implementations (apple/, linux/, bsd/ subdirs), src/windows/ for Windows-specific code, src/c_interface.rs wraps the Rust API for C consumers. Platform selection happens at compile-time via conditional compilation (cfg attributes). Examples in examples/ (simple.rs, simple.c for C binding demo), benchmarks in benches/basic.rs.
👥Who it's for
Rust developers building system monitoring tools, performance dashboards, process managers, or resource-aware applications who need portable system metrics without writing platform-specific code. DevOps engineers integrating monitoring into Rust services. Game engine developers needing to query hardware capabilities across target platforms.
🌱Maturity & risk
Production-ready and actively maintained. Version 0.39.0 with comprehensive CI via GitHub Actions (.github/workflows/CI.yml) and Cirrus (.cirrus.yml), clear migration guides (migration_guide.md), and structured platform addition docs (ADDING_NEW_PLATFORMS.md). MSRV set to Rust 1.95. However, pre-1.0 versioning and the 'system' feature flag gating process enumeration indicate some API stability is still being refined.
Single maintainer (Guillaume Gomez) creates typical open-source sustainability risk. Large dependency surface via Windows crate for WMI/COM (Win32_System_Wmi, Win32_System_Com) and objc2 bindings for macOS/iOS, increasing supply-chain exposure. Breaking changes possible across minor versions pre-1.0 (see migration_guide.md). Platform-specific code paths (src/unix/apple vs src/windows) mean bugs in one OS may not surface in CI running on different host.
Active areas of work
Active development on macOS/iOS support (extensive src/unix/apple/ hierarchy with ARM-specific component code in macos/component/arm.rs), Windows disk/component queries via WMI, and cross-platform refinement. Recent work visible in structured issue templates (.github/ISSUE_TEMPLATE/) and CI maturity. No specific PR data visible, but CHANGELOG.md and migration_guide.md suggest ongoing API evolution and platform completeness work.
🚀Get running
git clone https://github.com/GuillaumeGomez/sysinfo.git
cd sysinfo
cargo build
cargo run --example simple
Daily commands:
Development: cargo build (debug), cargo build --release (optimized). Examples: cargo run --example simple (Rust), cargo run --example simple.c (C FFI). Tests: cargo test (via CI.yml). Benchmarks: cargo bench (benches/basic.rs).
🗺️Map of the codebase
src/lib.rs— Main library entry point and public API exports; defines coreSystemstruct and platform selection logic.src/common/system.rs— Platform-agnostic system abstraction with trait definitions for CPU, disk, process, and network data collection.src/unix/mod.rs— Unix platform dispatcher; routes to Linux, macOS, BSD implementations via conditional compilation.Cargo.toml— Dependency and feature configuration; controls platform-specific code compilation (Windows, component detection).src/c_interface.rs— FFI C bindings header; exposes Rust API to C/C++ callers with type definitions in sysinfo.h.src/common/mod.rs— Common data structures (Component, Disk, Network, User); reused across all platform implementations.ADDING_NEW_PLATFORMS.md— Extension guide for adding new OS support; required reading before implementing platform-specific code.
🛠️How to make changes
Add Support for a New Unix-Like OS
- Create new directory under src/unix/{os_name}/ with structure: mod.rs, system.rs, cpu.rs, disk.rs, process.rs, network.rs, component.rs (if applicable) (
src/unix/{os_name}/mod.rs) - Define pub struct System; and implement the System trait from src/common/system.rs with methods for new(), refresh(), get_processes(), etc. (
src/unix/{os_name}/system.rs) - Add conditional module import in src/unix/mod.rs: #[cfg(target_os = "{os_name}")] mod {os_name}; and re-export the System struct (
src/unix/mod.rs) - Update Cargo.toml feature gate logic if OS requires specific dependencies (like libc features) (
Cargo.toml) - Document the new OS in src/lib.rs module-level docs and README.md supported OSes list (
src/lib.rs)
Add a New Data Type (e.g., Memory Info)
- Create src/common/memory.rs with pub struct Memory { total: u64, available: u64, ... } and impl Memory { pub fn new() } (
src/common/memory.rs) - Add #[derive(Serialize, Deserialize)] and update src/serde.rs if custom serialization needed (
src/common/memory.rs) - Add pub fn memory(&self) -> &Memory; method to System trait in src/common/system.rs (
src/common/system.rs) - Implement memory collection in each platform (src/unix/linux/system.rs, src/unix/apple/system.rs, etc.) by parsing OS-specific APIs (
src/unix/linux/system.rs) - Add default feature flag in Cargo.toml (e.g., "memory") and gate the type with #[cfg(feature = "memory")] (
Cargo.toml)
Extend Process Information Collection
- Identify the platform: open src/unix/linux/process.rs, src/unix/apple/process.rs, or src/unix/bsd/freebsd/process.rs (
src/unix/linux/process.rs) - Locate the process data structure (usually defined in parent module) and add a new field (e.g., open_fds: u32) (
src/unix/linux/process.rs) - Add collection logic in the process refresh/enumerate function by parsing /proc/[pid]/fd (Linux), lsof (macOS), or procstat (FreeBSD) (
src/unix/linux/process.rs) - Add getter method pub fn open_fds(&self) -> u32 to Process trait and all platform implementations (
src/common/system.rs)
Add C FFI Function for New API
- Add Rust wrapper function in src/c_interface.rs following pattern: pub extern "C" fn sysinfo_new_function(...) -> *mut Type (
src/c_interface.rs) - Add corresponding C function declaration to src/sysinfo.h with proper docstring explaining parameters and return value (
src/sysinfo.h) - For borrowed references, use null-check guards and (*ptr).method() pattern; for owned data, use Box::into_raw() (
src/c_interface.rs) - Update examples/simple.c with usage example of the new C function (
examples/simple.c)
🪤Traps & gotchas
Differential update requirement: System struct must call refresh_*() before reading; first call returns 0/empty (documented in README with ⚠️ warning but easy to miss). Platform variability: Same method may have different precision/availability across OSes (e.g., process.disk_usage() unavailable on some platforms). Feature flag interactions: Disabling 'system' feature disables process enumeration entirely; combining feature flags has subtle side effects (see Cargo.toml component/disk deps on objc2-core-foundation variants). C ABI stability: src/sysinfo.h is manually maintained and must be kept in sync with src/c_interface.rs; no automatic binding generation. ARM vs Intel macOS: src/unix/apple/macos/component/arm.rs has separate code path; cross-compilation requires targeting correct arch.
🏗️Architecture
💡Concepts to learn
- Differential Update Pattern — sysinfo queries many metrics (CPU usage, network throughput) by comparing current vs. previous snapshots; understanding this is critical to avoid returning zero on first call
- Conditional Compilation (cfg attributes) — sysinfo compiles entirely different code paths per OS target (src/unix/apple vs src/windows) at compile-time via Rust cfg(target_os); essential for cross-platform Rust design
- Foreign Function Interface (FFI) & C ABI — src/c_interface.rs and src/sysinfo.h bridge Rust to C; understanding repr(C), unsafe pointer handling, and ABI stability is required to extend C bindings
- Objective-C Interop via objc2 — macOS/iOS implementations use objc2-core-foundation and objc2-io-kit to call Apple frameworks (IOKit for thermals, Foundation for processes); specific to Apple platform support
- WMI (Windows Management Instrumentation) — Windows code uses WMI queries via windows crate for hardware discovery (disks, components); understanding COM/OLE and VARIANT is needed for Windows extensions
- procfs Virtual Filesystem — Linux implementation reads /proc and /sys pseudo-filesystems for process, CPU, memory, and network stats; understanding procfs structure is essential for Linux-specific debugging
- Feature Flags & Dependency Graph — Cargo features (component, disk, network, system, user) gate large dependency sets (windows crate, objc2 frameworks); understanding feature interactions prevents bloated binaries and build failures
🔗Related repos
starship/starship— Prompt engine that uses sysinfo for system stats display (git integration, battery, time); major downstream consumersharkdp/hyperfine— Benchmarking tool that may use sysinfo for system info reporting during benchmarksogham/exa— Ls replacement that uses sysinfo for file metadata and system context (deprecated but illustrative of ecosystem usage)giampaolo/psutil— Python equivalent; reference implementation for cross-platform system metrics (inspiration for sysinfo's trait-based design)heim-rs/heim— Alternative Rust system info crate with async API; direct competitor for same use cases (process monitoring, disk queries)
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive platform coverage tests for benches/basic.rs
The benchmark file exists but likely lacks platform-specific test coverage. Given that sysinfo supports 8+ platforms (Linux, macOS, Windows, FreeBSD, NetBSD, iOS, Android, Raspberry Pi), the benchmark should explicitly test each platform's code paths. This ensures performance regressions aren't introduced when modifying platform-specific implementations in src/unix/*, src/windows/, etc.
- [ ] Extend benches/basic.rs to include platform-gated benchmarks using #[cfg(target_os = "...")] for each supported OS
- [ ] Add benchmarks for CPU updates (referencing md_doc/minimum_cpu_update_interval.md constraints)
- [ ] Add benchmarks for disk, network, component, and user data fetching on each platform
- [ ] Document benchmark baseline expectations in a BENCHMARKS.md file
Implement missing CI workflow for BSDs and alternative Unix platforms
.github/workflows/CI.yml likely tests Linux, macOS, and Windows, but FreeBSD and NetBSD support (with src/unix/bsd/freebsd/* and implied NetBSD code) are not validated in CI. This leaves these platforms at risk of bitrot. Adding FreeBSD to CI via Cirrus (already configured in .cirrus.yml but potentially incomplete) would catch regressions early.
- [ ] Review and extend .cirrus.yml to explicitly test src/unix/bsd/freebsd/ code paths
- [ ] Ensure .github/workflows/CI.yml documents why FreeBSD is handled via Cirrus instead of GitHub Actions
- [ ] Add a test matrix in .cirrus.yml covering FreeBSD versions and architectures (if multiple)
- [ ] Verify that ADDING_NEW_PLATFORMS.md reflects the current CI strategy for non-Linux/macOS/Windows platforms
Add feature-gated unit tests for optional components (disk, network, component, user)
The Cargo.toml defines modular features (component, disk, network, system, user), but there are likely no dedicated unit tests in src/common/ that validate each feature flag independently. This means building with --no-default-features or individual features could silently break. Adding comprehensive feature-gated tests ensures each combination is valid.
- [ ] Create src/common/tests.rs with #[cfg(test)] modules gated by #[cfg(feature = "component")], etc.
- [ ] Add test cases in src/common/component.rs, src/common/disk.rs, src/common/network.rs, src/common/user.rs validating basic struct initialization
- [ ] Update Cargo.toml or create a .github/workflows test matrix that tests all feature combinations: default, --no-default-features, and individual features
- [ ] Document feature compatibility expectations (e.g., 'system is always available') in md_doc/ if not already present
🌿Good first issues
- Add integration tests for src/common/disk.rs querying; currently no dedicated test files in visible structure. Create tests/disk_integration.rs covering mount point enumeration, space queries, and platform-specific mount formats (procfs on Linux, GetDiskFreeSpaceEx on Windows).
- Document the refresh() differential update semantics with concrete examples in md_doc/ (e.g., 'Why does System::used_memory() return 0 on first call?'). Add a md_doc/update_semantics.md or expand existing docs with before/after examples.
- Implement missing process filtering: src/common/system.rs lacks methods like processes_by_name() or filtered query; add helper methods wrapping the existing processes() iterator with common filter patterns (uid, status, memory threshold).
⭐Top contributors
Click to expand
Top contributors
- @GuillaumeGomez — 85 commits
- @madsmtm — 3 commits
- @andylokandy — 2 commits
- @gaussfff — 2 commits
- @Skgland — 1 commits
📝Recent commits
Click to expand
Recent commits
ee9cd3b— Merge pull request #1655 from GuillaumeGomez/update (GuillaumeGomez)3ada0c4— Update crate version to0.39.0version (GuillaumeGomez)e05d7c9— Update CHANGELOG for0.39.0version (GuillaumeGomez)b62b067— Merge pull request #1654 from GuillaumeGomez/improve-network (GuillaumeGomez)03c0da0— Improve performance of network interfaces refresh by removing one call ofgetifaddrs(GuillaumeGomez)560ba18— Try to reducetest_tasksflakyness (GuillaumeGomez)f9832e6— Merge pull request #1653 from GuillaumeGomez/fix-soundness (GuillaumeGomez)c2d1bf3— Fix new clippy lint (GuillaumeGomez)15a763e— Manually rewriteunix::get_usersto fix unsoundness issue (GuillaumeGomez)c47edf6— Small cleanup (#1652) (GuillaumeGomez)
🔒Security observations
The sysinfo library is generally well-structured for a system information gathering crate. The primary security concerns are: (1) a critical configuration error with an invalid Rust edition that prevents proper compilation and security updates, (2) incomplete dependency declarations suggesting file truncation, and (3) inherent FFI risks associated with calling native C libraries across multiple platforms. The codebase lacks obvious injection vulnerabilities, hardcoded secrets, or exposed credentials. The platform-specific implementations are appropriate for a system monitoring tool. To improve security posture: fix the Cargo.toml configuration errors immediately, ensure comprehensive input validation in all FFI code, maintain up-to-date dependencies, and conduct regular security audits of the FFI boundaries.
- High · Invalid Rust Edition in Cargo.toml —
Cargo.toml. The Cargo.toml specifies edition = "2024", which is not a valid Rust edition. Valid editions are 2015, 2018, and 2021. This will cause compilation failures and prevents proper dependency resolution and security updates. Fix: Change edition to a valid value: "2021" (recommended for modern Rust projects) or "2018". - Medium · Incomplete Dependency Declaration in Cargo.toml —
Cargo.toml, line ~45 (system feature declaration). The 'system' feature declaration appears to be truncated in the provided Cargo.toml. The line 'wi' is incomplete, which suggests the file was cut off. This could indicate missing or incomplete dependencies that may not be properly resolved. Fix: Complete the truncated 'system' feature declaration by providing the full list of required dependencies. Verify the complete Cargo.toml file is correct and all dependencies are properly declared. - Medium · FFI Code Exposure —
src/c_interface.rs, src/unix/apple/ffi.rs, src/unix/bsd/*/ffi.rs, and other FFI files. The codebase contains multiple FFI (Foreign Function Interface) files that directly interact with C libraries across multiple platforms (Windows, macOS, BSD, Linux). While necessary for system information gathering, FFI code is inherently risky as it bypasses Rust's safety guarantees. Potential issues include buffer overflows, use-after-free, and type mismatches. Fix: Ensure all FFI code: (1) Validates all inputs from C libraries, (2) Uses appropriate error handling for all C calls, (3) Has comprehensive testing with fuzzing, (4) Follows SAFETY comments documenting invariants, (5) Regularly audits C code interactions. - Low · Deprecated Rust Version —
Cargo.toml, rust-version field. The minimum supported Rust version (MSRV) is set to 1.95, which is unusually high and likely a typo. Current stable Rust versions are in the 1.7x range. This value may indicate a configuration error or may prevent legitimate users from building the project. Fix: Verify and correct the MSRV to match the actual minimum supported version. Use a realistic version number (e.g., 1.70 for modern features) and test builds with that version. - Low · Wide C Interface Exposure —
src/c_interface.rs, src/sysinfo.h. The crate exposes a C interface through src/c_interface.rs and src/sysinfo.h. While useful for C interoperability, this expands the attack surface as C code lacks memory safety guarantees and may introduce vulnerabilities in consuming C/C++ code. Fix: Document the C interface thoroughly with security warnings. Ensure all C-callable functions properly validate inputs and handle error conditions. Consider versioning the C API separately. Provide security guidelines for C/C++ consumers. - Low · Sensitive File Structure —
src/common/component.rs, src/common/disk.rs, src/common/network.rs. The codebase includes platform-specific implementations for components, disk, network, and process information. Some of this data might be sensitive (e.g., process information, network configuration). Ensure proper access controls are in place at the OS level. Fix: Document which operations require elevated privileges. Provide warnings about the sensitivity of gathered information in documentation. Consider implementing optional permission checks.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.