#port #tui #monitor #process

bin+lib portsage

A TUI tool to monitor processes and their listening ports

1 unstable release

new 0.1.0 May 10, 2025

#2510 in Command line utilities

MIT license

29KB
702 lines

๐Ÿš€ PortSage - Process + Port Explorer

PortSage is a sleek TUI (Terminal User Interface) tool that helps you:

  • ๐Ÿงญ Explore processes on your machine
  • ๐Ÿ” Filter by name, command, PID, or port
  • ๐Ÿ“ View ports associated with each process
  • ๐Ÿช„ Inspect process details in a floating modal
  • ๐Ÿ—‘๏ธ Kill processes interactively with confirmation dialog
  • ๐Ÿ“‹ Copy PID to clipboard with one key

โœจ Features

๐Ÿ“Š Process Overview

  • Lists all processes
  • Shows PID, name, ports, and command line
  • Port-bound processes are sorted to the top

๐ŸŽฏ Filter Mode

  • Press : to enter filter mode
  • Matches against name, command, and PID

๐Ÿ”Ž Detail Mode

  • Press Tab to open process detail window

  • Shows full metadata including:

    • CPU usage, memory
    • Executable path
    • Current working directory
    • Listening ports

๐Ÿ“‹ Copy PID

  • Press Enter to copy the selected PID to clipboard
  • Confirmation message appears for 2 seconds

โŒ Kill Process

  • Press x to open confirmation dialog
  • Press y to kill the process (SIGKILL)
  • Press n or Esc to cancel
  • โœ… Success message shown after killing

๐ŸŽฎ Key Bindings

Key Action
j / Down Move down
k / Up Move up
: Enter filter mode
Tab Show detail
Enter Copy PID to clipboard
x Kill process (confirm)
q / Esc Quit

๐Ÿ› ๏ธ Install & Run

cargo build --release
./target/release/portsage --tui

๐Ÿ“ฆ Install from crates.io

cargo install portsage

โ„๏ธ Install via Nix Flakes

nix run github:mei28/PortSage

๐Ÿ“ฆ CLI Options

USAGE:
    portsage [OPTIONS]

OPTIONS:
    -f, --filter <STRING>   Filter keyword
    -p, --port <PORT>       Filter by port
        --json              Output as JSON (non-TUI)
        --kill <PID>        Kill process by PID
        --tui               Launch interactive TUI

๐Ÿงช Requirements

  • ๐Ÿฆ€ Rust 1.70+
  • Linux/macOS (requires lsof)

Dependencies

~9โ€“22MB
~337K SLoC