{"slug": "purefetch-a-fastfetch-style-system-info-tool-in-rust-with-zero-dependencies", "title": "purefetch: a fastfetch-style system info tool in Rust with zero dependencies", "summary": "A developer built purefetch, a system-info fetcher in Rust with zero dependencies from crates.io, using only std and raw Linux syscalls. The tool produces a ~484 KiB binary and supports four architectures via QEMU testing. It includes ZFS-aware memory reporting and 24 distro logos.", "body_md": "I like `neofetch`\n\n/ `fastfetch`\n\n, but I wanted one with a genuinely *empty*\n\ndependency graph — nothing pulled from crates.io. So I built **purefetch**: a small\n\nsystem-info fetcher written entirely in Rust using only `std`\n\nplus raw Linux\n\nsyscalls.\n\nDisclosure up front:purefetch was built largely withAI assistance\n\n(Claude Code). I directed the design, and every change was reviewed and tested —\n\nincluding running it on four architectures under QEMU — but most of the code is\n\nAI-generated. I'd rather be honest about that than pretend otherwise.\n\n```\n       _,met$$$$$gg.          ooonea@unicorn\n    ,g$$$$$$$$$$$$$$$P.       ──────────────\n  ,g$$P\"     \"\"\"Y$$.\".        OS        Debian GNU/Linux 13.5 (trixie) x86_64\n ,$$P'              `$$$.     Host      ThinkPad P53 (20QQS0JD01)\n',$$P       ,ggs.     `$$b:   Kernel    6.12.94+deb13-amd64\n`d$$'     ,$P\"'   .    $$$    Uptime    6 days, 15 hours, 30 mins\n $$P      d$'     ,    $$P    Packages  2477 (dpkg), 1 (flatpak)\n $$:      $$.   -    ,d$$'    Shell     zsh 5.9\n $$;      Y$b._   _,d$P'      Display   1920x1080 (eDP-1)\n Y$$.    `.`\"Y$$$$P\"'         DE        GNOME 48.7\n `$$b      \"-.__              WM        Mutter (Wayland)\n  `Y$$                        Terminal  kitty 0.41.1\n   `Y$$.                      CPU       Intel(R) Core(TM) i7-9850H @ 4.60 GHz\n     `$$b.                    GPU       Quadro RTX 3000\n       `Y$$b.                 Memory    15.28 GiB / 62.61 GiB (24%)\n          `\"Y$b._             Swap      0 B / 8.00 GiB (0%)\n              `\"\"\"            Disk (/)  8.52 GiB / 489.57 GiB (2%)\n                              Locale    en_US.UTF-8\n                              Battery   76% (Not charging)\n```\n\nNo `libc`\n\ncrate, no `sysinfo`\n\n, no `nix`\n\n, no color crate — nothing from crates.io.\n\nAlmost everything is just reading and parsing `/proc`\n\nand `/sys`\n\n. The result is a\n\nsingle **~484 KiB** binary that builds offline.\n\nThe only things `std`\n\ncan't do are `statfs`\n\n(disk usage) and `ioctl`\n\n(terminal size\n\n/ tty check). Instead of pulling in a binding crate, those are issued as **raw Linux\nsyscalls** via\n\n`core::arch::asm!`\n\n:\n\n```\n#[cfg(target_arch = \"x86_64\")]\nunsafe fn syscall3(n: usize, a1: usize, a2: usize, a3: usize) -> isize {\n    let ret: isize;\n    core::arch::asm!(\n        \"syscall\",\n        inlateout(\"rax\") n as isize => ret,\n        in(\"rdi\") a1, in(\"rsi\") a2, in(\"rdx\") a3,\n        out(\"rcx\") _, out(\"r11\") _,\n        options(nostack),\n    );\n    ret\n}\n```\n\nEach architecture gets its own `syscall3`\n\n(a different instruction and register\n\nconvention) plus its syscall numbers. aarch64, riscv64 and loongarch64 share the\n\n\"asm-generic\" table (`statfs = 43`\n\n, `ioctl = 29`\n\n); x86_64 has its own.\n\nI validated all four **end-to-end under qemu-user** — cross-compiling to each\n\nOn ZFS-on-root, a naive `MemTotal - MemAvailable`\n\nmassively over-reports used RAM,\n\nbecause the ZFS ARC is kernel-slab cache that `MemAvailable`\n\ndoesn't count as\n\nreclaimable. purefetch subtracts the reclaimable ARC (`arcstats size - c_min`\n\n),\n\nwhich lines up with what `fastfetch`\n\nand ZFS-aware `htop`\n\nshow. On my box that's the\n\ndifference between \"37 GiB used\" (wrong) and \"15 GiB used\" (right).\n\nThe 24 distro logos live as plain text in `assets/logos/*.txt`\n\n, and a small Python\n\nscript generates `src/logo.rs`\n\n. Adding a logo is one text file plus a regen.\n\nIt also taught me a lesson. An early version of the generator emitted the color as\n\n`sgr: \"215;7;81\"`\n\ninstead of `\"38;2;215;7;81\"`\n\n— dropping the truecolor prefix. The\n\nterminal then read `\\e[215;7;81m`\n\nas \"code 215 (ignored) + 7 (reverse video)\", so\n\nevery logo rendered washed-out instead of its brand color. I missed it because my\n\nrender checks all ran with `--no-color`\n\n. Fixed in 0.1.2 — a good reminder to test the\n\nthing your users actually *see*.\n\n```\ncargo install purefetch\n```\n\nSource, issues and PRs: ** https://github.com/ooonea/purefetch** (MIT OR Apache-2.0).", "url": "https://wpnews.pro/news/purefetch-a-fastfetch-style-system-info-tool-in-rust-with-zero-dependencies", "canonical_source": "https://dev.to/ooonea/purefetch-a-fastfetch-style-system-info-tool-in-rust-with-zero-dependencies-19f0", "published_at": "2026-07-04 15:45:04+00:00", "updated_at": "2026-07-04 16:19:22.356240+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["purefetch", "Rust", "Linux", "QEMU", "ZFS", "Claude Code", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/purefetch-a-fastfetch-style-system-info-tool-in-rust-with-zero-dependencies", "markdown": "https://wpnews.pro/news/purefetch-a-fastfetch-style-system-info-tool-in-rust-with-zero-dependencies.md", "text": "https://wpnews.pro/news/purefetch-a-fastfetch-style-system-info-tool-in-rust-with-zero-dependencies.txt", "jsonld": "https://wpnews.pro/news/purefetch-a-fastfetch-style-system-info-tool-in-rust-with-zero-dependencies.jsonld"}}