Every developer has a "favorite" annoying workflow. Mine was hunting down zombie processes that refused to release my local dev ports.
If you've ever typed this into your terminal for the 5th time in an hour, you know the pain:
lsof -i :3000
kill -9 <PID>
I decided to automate this friction away by building Recoil—a tactical system monitor for macOS that lets you "snipe" these processes directly from your system tray.
The Goal: High Performance, Low Overhead
When building a system utility that stays open all day, Electron was out of the question. I didn't want a 150MB helper app just to kill a process.
I chose Tauri v2 because it allowed me to:
Leverage the System Webview: Resulting in a ~5MB bundle.
Use Rust for System Tasks: Directly interfacing with system APIs for telemetry and process management.
React for UI: Keeping the interface modern and "tactical."
Technical Deep Dive: The Rust Core
In Recoil, we use Rust to handle the heavy lifting of scanning ports. Here’s a simplified look at how we interface with system commands to find those port-hogging PIDs:
// A peek into the command logic
#[tauri::command]
pub fn get_active_ports() -> Vec<PortInfo> {
// We use a combination of sysinfo and lsof logic
// to map ports to process names and IDs safely.
let mut system = System::new_all();
system.refresh_all();
// ... logic to filter and return active listeners
}
By keeping the scanning logic in the Rust "backend" of the Tauri app, we ensure that the UI remains responsive even when the system is under heavy load.
The Result: The "Sniper" Experience
The core of Recoil is the Sniper Button. It's a visual way to reclaim your environment.
Key Features:
Live Port Monitoring: Automatically detects new listeners.
Tactical Telemetry: Real-time CPU and Memory tracking.
Minimal Footprint: Idles at negligible RAM usage compared to similar Electron-based monitors.
Lessons Learned building with Tauri v2
Tauri v2 is a huge step forward, especially with the improved plugin system. Implementing system tray support and window shadowing was significantly smoother than in v1. If you're coming from the web world and want to build "real" system tools, this is the stack to watch.
Open Source & Feedback
Recoil is open-source and I’m currently looking for contributors to help optimize it for Windows and Linux.
Check out the repo: https://github.com/CodeMaverick143/recoil
Live Site: https://recoil.xplnhub.tech
I'd love to hear how you all handle port conflicts in your daily workflow. Are you still a kill -9 purist, or have you moved to GUI tools?
Top comments (0)