DEV Community

Cover image for From Zero Rust to DevOps: Building a System Monitor with GitHub Copilot CLI
Sanjay Kumar Sah
Sanjay Kumar Sah Subscriber

Posted on

From Zero Rust to DevOps: Building a System Monitor with GitHub Copilot CLI

GitHub Copilot CLI Challenge Submission

This is a submission for the GitHub Copilot CLI Challenge

What I Built

I built rust-tui-dashboard, a terminal-based system monitor (similar to htop or btop) written entirely in Rust.

As a Full-Stack developer primarily experienced with JavaScript and the MERN stack, I have always wanted to learn Rust. However, the steep learning curve—specifically the borrow checker and strict type system—was intimidating. For this challenge, I decided to use the GitHub Copilot CLI as my "Senior Rust Engineer" to guide me through building a production-ready application from scratch.

Key Features:

  • Visual Gauges: Real-time CPU & Memory usage visualized with colorful progress bars (Cyan & Yellow).
  • Disk Alerts: Tracks partition usage (which hilariously warned me that my own drive is 97.5% full!).
  • Network Stats: Live upload/download speed tracking.
  • Cross-Platform: Runs on Linux, macOS, and Windows.
  • Automated Builds: A CI/CD pipeline set up via GitHub Actions.

Demo

Here is the final result running in my terminal:

Rust TUI Dashboard

Repository: rust-tui-dashboard

My Experience with GitHub Copilot CLI

Building this project was a journey of "Prompt -> Error -> Explanation -> Fix." The Copilot CLI didn't just write code for me; it taught me why the code worked (or didn't).

1. The "Hello World" Moment

I started with an empty folder and didn't even know the command to initialize a Rust project.
Prompt: how to initialize a new rust project named dev-dashboard
Result: It gave me cargo new dev-dashboard immediately. I was up and running in seconds.

how to initialize a new rust project named dev-dashboard

2. Overcoming the "Generic" Hallucination

This was the most valuable interaction. I used the ratatui library for the UI, but the code Copilot initially suggested threw a complex compilation error:
error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied

struct takes 0 generic arguments but 1 generic argument was supplied

Instead of pasting this into Google, I asked the CLI:

Prompt: struct takes 0 generic arguments but 1 generic argument was supplied

The Fix: Copilot correctly identified that the library version I installed had a breaking API change (Frame<B> became just Frame). It explained the difference, and while its initial code fix was slightly aggressive (it removed generics from everything), the explanation gave me enough context to manually fix the Terminal struct generics while simplifying the Frame struct. It turned a potential 2-hour debugging session into a 5-minute fix.

3. From Text to "Eye Candy"

Initially, my dashboard was just text blocks. I wanted it to look professional.

Prompt: "Update the ui function. Instead of displaying CPU Usage as simple text, use the ratatui::widgets::Gauge widget. Set the percent to app.cpu_usage and color it Cyan."

It instantly scaffolded the Gauge widget code, giving me professional-looking progress bars without me needing to read the entire documentation.

4. The DevOps Bonus

I didn't want users to have to compile the code themselves.

Prompt: "Create a GitHub Actions workflow file named .github/workflows/release.yml to build the project on push."

Copilot generated a perfect YAML file. Now, every time I push code, GitHub Actions automatically compiles my Rust binary and uploads it as an artifact.

Copilot generated a perfect Github Action workflow

Conclusion

The GitHub Copilot CLI bridged the gap between my JavaScript knowledge and Rust's strict environment. It allowed me to build a tool that I actually use now—if only to remind me to clean up my hard drive (seriously, only 7GB left!).

Top comments (0)