Skip to content

Latest commit

 

History

100 Commits

Folders and files

Repository files navigation

Rust CLI Sysinfo (RCS)

Release Link to PRs Rust Report Card Codacy Badge Gitberg logo

Rust-CLI-Sysinfo (RCS) is a lightweight, cross-platform, modular Rust utility for the terminal that displays the status of customizable system services

RCS Features

  • Comprehensive System Status

    • Displays system diagnostics right out of the box:
      • CPU hardware details and real-time usage
      • GPU hardware details
      • Operating system
      • Kernel/OS build version
      • IP address
      • Hostname
      • Currently logged-in user(s)
      • System uptime
      • System load averages (over one, five, and 15 minutes)
      • Memory usage
      • Disk usage (defaults to /home, customizable via -d/--disk)
  • Customizable Services Layout

    • Select exactly which service components to display and specify their order using service tokens (see -s/--services for details)
  • Custom New Services

    • New system services can be added easily by creating a new service file, dropping it into the src/services folder: RCS will automatically detect and render it as an available new service
  • Visual Service Status Indicators

    • Color-coded output for CPU, memory, and disk utilization thresholds:

      • Normal: $\color{green}{\text{Green}}$
      • Warning: $\color{yellow}{\text{Yellow}}$
      • Critical: $\color{red}{\text{Red}}$
  • Configuration-Free

    • No complex dotfiles or external configurations to track down
    • Manage everything directly via command-line flags
  • Highly Efficient

    • Written in Rust for maximum performance, compiling down to a single binary with no external runtime dependencies

RCS Screenshots

The Default RCS Output

The standard output of the utility displays components with status-aware color coding:

Screenshot showing Rust CLI Sysinfo output

The RCS Help Output

Call rust-cli-sysinfo -h (or --help) to view the complete CLI options:

Screenshot showing Rust CLI Sysinfo output

Customizing RCS with Service Tokens

Run rust-cli-sysinfo -s (or --services) to display all available individual service tokens:

Screenshot showing Rust CLI Sysinfo output

Customized RCS Output

You can combine tokens to isolate and reorder specific services. For example, to focus exclusively on logged-in users (USR), OS details (OS), memory (RAMU), disk (DSKU), CPU (CPU), and GPU (GPU), use the service token layout string:

rust-cli-sysinfo -s USR-OS-RAMU-DSKU-CPU-GPU

This will result in the following output:

Screenshot showing Rust CLI Sysinfo output

Creating New RCS Services

Want to create a new service that doesn't yet exist in RCS?

RCS follows the Open–Closed Principle (OCP) where every service is implemented within its own Rust source file and automatically registers with the utility at compile time. No need to edit or modify existing source files: just add a separate new service file and rebuild the project.

To create a new RCS service:

  1. Create a new .rs file inside the src/services directory (e.g., ip_address.rs). Use an existing service file in src/services or inspect the well-documented template.rs file as a good starting point.

  2. Build the project (cargo build --release). Your new module will instantly integrate into the default output stack.

One service.
One file.
Done.

Requirements & Installation

Requirements

  • Run-Time

    • Any standard modern Linux, MacOS, or Windows environment
    • Rust-CLI-Sysinfo releases include a pre-compiled binary that runs natively on a Linux AMD64 architecture
      • Future releases may also include pre-compiled binaries for other platforms
  • Build-Time

    • If you're interested in compiling from source, you'll need a functioning installation of the Rust toolchain (using Cargo)

Installation

Grab the pre-compiled binary directly from the GitHub Releases Page and place it somewhere in your local system path:

cp rust-cli-sysinfo ~/.local/bin/

That's it! You can now run rust-cli-sysinfo from within any terminal session.

Compiling from Source

If you prefer to compile this project from sources, here are the steps:

git clone https://github.com/richbl/rust-cli-sysinfo.git
cd rust-cli-sysinfo
cargo build --release --bin rust-cli-sysinfo
cp target/release/rust-cli-sysinfo ~/.local/bin/

Done!

Usage

Simply invoke the tool from your terminal session:

rust-cli-sysinfo

To display help, use the -h or --help flag:

rust-cli-sysinfo -h

Shell Integration (Recommended)

Adding the binary call to the end of your shell startup configuration script (e.g., ~/.bashrc or ~/.zshrc) will render rust-cli-sysinfo services output in your environment every time a new session starts up.

Nice!

Roadmap

RCS is designed to remain lean and fast, but some goals for upcoming releases include:

  • Streamline modular service generation patterns (Zero-touch compilation)

  • [-] Additional metric services:

    • Network interfaces (IP address added in v0.9.0)
    • Thermal sensor(s)
    • What else?
  • [-] Cross-platform compatibility expansion (macOS and Windows support profiles)

    • Currently in progress, with a focus on utilizing the most appropriate cross-platform Rust crates for each supported service:

      RCS Platform
      Service Token Linux Windows Mac
      CPU CPU $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$
      GPU(s) GPU $\color{green}{\huge\circledast}$ $\color{yellow}{\huge\circledast}$ $\color{yellow}{\huge\circledast}$
      OS OS $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$
      Kernel KNL $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$
      IP Address IP $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$
      Hostname HST $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$
      User(s) USR $\color{green}{\huge\circledast}$ $\color{red}{\huge\circledast}$ $\color{red}{\huge\circledast}$
      Uptime UPT $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$
      Load Averages LOAD $\color{green}{\huge\circledast}$ n/a $\color{green}{\huge\circledast}$
      CPU Usage CPUU $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$
      Memory Usage RAMU $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$
      Disk Usage DSKU $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$
      Template TPL $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$ $\color{green}{\huge\circledast}$

    Compatibility Notes:

    • The GPU service (GPU) is currently Linux-only (using platform-specific calls), as the underlying sysinfo crate does not yet support cross-platform GPU detection. This is expected to change in a future release of sysinfo, at which point RCS will be updated to support GPU detection on those platforms as well

    • The User(s) service (USR) is not yet implemented on Windows and MacOS, as a cross-platform solution for identifying actively "logged-in" users has not yet been identified

    • The Load Average service (LOAD) is not available on Windows, as the concept of load averages is not applicable to that platform

Releases

Packages

Used by

Contributors

Languages