A lightweight cross-platform status bar app that monitors and manages development processes running on configurable ports. The app provides real-time process detection and allows you to kill individual processes or all processes at once.
Supported Platforms:
- âś… macOS: Native system tray with full functionality
- âś… Linux: Native system tray with full functionality (requires GTK packages)
- âś… Windows: Native system tray with full functionality
- âś… Console Mode: Works on all platforms without GUI dependencies
Join our Discord community for discussions, support, and updates:
- Real-time Monitoring: Scans configurable ports every 5 seconds using
lsofcommands - Process Detection: Identifies processes by name, PID, and Docker containers
- Safe Process Termination: Uses SIGTERM → SIGKILL termination strategy
- Configurable Port Ranges: Monitor specific ports or port ranges
- Ignore Lists: Exclude specific ports or processes from monitoring
- Docker Support: Detect and display Docker container information
- PID Display: Optional PID display for better process identification
- Graceful Error Handling: Handles permission errors and process failures
- Log Level Control: Configurable logging verbosity (info, warn, error, none)
- macOS: Native system tray with dynamic context menu and visual status icon
- Linux: Native system tray with dynamic context menu and visual status icon
- Windows: Native system tray with dynamic context menu and visual status icon
- Console Mode: Cross-platform console interface with real-time updates (recommended for full-screen mode)
- Individual Process Killing: Kill specific processes by clicking menu items
- Bulk Process Killing: Kill all detected processes with one click
- Ignore Configuration: Exclude system processes (Chromecast, AirDrop, etc.)
- Docker Integration: Display container names and IDs for Docker processes
The status bar icon provides instant visual feedback:
- Green: 0 processes (safe, no development servers)
- Orange: 1-9 processes (some development servers)
- Red: 10+ processes (many development servers)
Hover over the icon to see the exact process count in the tooltip.
- Kill All Processes: Terminates all detected development processes
- Individual Process Entries:
- Docker containers: "Kill: Port 3001: node [Docker: my-react-app]"
- Regular processes: "Kill: Port 3001: node" (or "Kill: Port 3001: node (PID 1234)" with
--show-pid)
- Quit: Exits the application gracefully without affecting monitored processes
Safety Features:
- The "Kill All Processes" option terminates only development processes (respects ignore lists)
- The "Quit" option exits the application without killing any processes
- Individual process killing respects ignore configurations
- macOS 10.15 or later
- Rust 1.70 or later
lsofcommand (included with macOS)- Docker (optional, for container monitoring)
- Linux with GTK support
- Rust 1.70 or later
lsofcommand- Docker (optional, for container monitoring)
- Required packages for system tray:
libatk1.0-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxdo-dev - Note: If GTK packages are missing, the app automatically falls back to console mode
- Windows 10 or later
- Rust 1.70 or later
netstatcommand (included with Windows)tasklistcommand (included with Windows)- Docker (optional, for container monitoring)
- Rust 1.70 or later
lsofcommand (Unix-like systems)netstatcommand (Windows)- Docker (optional, for container monitoring)
- No GUI dependencies required
The latest binaries for all platforms are automatically built and released on GitHub when a release is published.
# macOS/Linux: Download and run the installer
curl -fsSL https://raw.githubusercontent.com/kagehq/port-kill/main/install-release.sh | bash
# Windows: Download and run the installer
# Download install-release.bat and run it, or use:
# powershell -Command "Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/kagehq/port-kill/main/install-release.bat' -OutFile 'install-release.bat' && install-release.bat"Note: If no releases are available yet, the install scripts will guide you to build from source instead.
- Download from Releases: Go to GitHub Releases and download the appropriate binary for your platform
- Direct Downloads:
- macOS:
port-kill-macos(system tray) orport-kill-console-macos(console mode) - Linux:
port-kill-linux(system tray) orport-kill-console-linux(console mode) - Windows:
port-kill-windows.exe(system tray) orport-kill-console-windows.exe(console mode)
- macOS:
- Archive Downloads: Compressed archives with both binaries for each platform
Option 1: Automated Release (Recommended)
# Create a new release with automatic tag creation
./release.sh 0.1.0This will:
- Create a git tag
v0.1.0 - Push the tag to GitHub
- Automatically trigger release creation
- Build and upload binaries for all platforms
Option 2: Manual Release
- Go to the repository on GitHub
- Click "Releases" in the right sidebar
- Click "Create a new release"
- Set the tag version (e.g.,
v0.1.0) - Add a title and release notes
- Click "Publish release"
Both methods will automatically trigger the build workflow and upload all platform binaries.
- Clone the repository:
git clone <repository-url>
cd port-kill- Install and build (recommended):
./install.shOr manually:
./build-macos.sh
./run.sh- Clone the repository:
git clone <repository-url>
cd port-kill- Install required packages:
# Ubuntu/Debian
sudo apt-get install libatk1.0-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxdo-dev
# Fedora/RHEL
sudo dnf install atk-devel gdk-pixbuf2-devel gtk3-devel libxdo-devel
# Arch Linux
sudo pacman -S atk gdk-pixbuf2 gtk3 libxdo- Install and build (recommended):
./install.shOr manually:
./build-linux.sh
./run-linux.sh- Clone the repository:
git clone <repository-url>
cd port-kill- Install Rust (if not already installed):
# Download and run rustup-init.exe from https://rustup.rs/- Install and build (recommended):
./install.shOr manually:
build-windows.bat
run-windows.batConsole mode works on all platforms without GUI dependencies:
# Build (works on any platform)
cargo build --release
# Run console mode
./target/release/port-kill-console --console --ports 3000,8000 --verbosePlatform-Specific Run Scripts:
- macOS: Use
./run.sh - Linux: Use
./run-linux.sh - Windows: Use
run-windows.bat
- Start the Application: Run the appropriate script for your platform with default settings (ports 2000-6000)
- Monitor Status: Check the status bar for the process count indicator
- Access Menu: Click on the status bar icon to open the context menu
- Kill Processes:
- Click "Kill All Processes" to terminate all development processes
- Click individual process entries to kill specific processes
- Quit: Click "Quit" to exit the application
The application now supports configurable port ranges and specific port monitoring:
# Monitor ports 3000-8080
./run.sh --start-port 3000 --end-port 8080 # macOS
./run-linux.sh --start-port 3000 --end-port 8080 # Linux
run-windows.bat --start-port 3000 --end-port 8080 # Windows
# Monitor ports 8000-9000
./run.sh -s 8000 -e 9000 # macOS
./run-linux.sh -s 8000 -e 9000 # Linux
run-windows.bat -s 8000 -e 9000 # Windows# Monitor only specific ports (common dev ports)
./run.sh --ports 3000,8000,8080,5000 # macOS
./run-linux.sh --ports 3000,8000,8080,5000 # Linux
run-windows.bat --ports 3000,8000,8080,5000 # Windows
# Monitor React, Node.js, and Python dev servers
./run.sh -p 3000,3001,8000,8080 # macOS
./run-linux.sh -p 3000,3001,8000,8080 # Linux
run-windows.bat -p 3000,3001,8000,8080 # Windows# Run in console mode for debugging
./run.sh --console --ports 3000,8000,8080
# Console mode with verbose logging
./run.sh -c -p 3000,8000,8080 -v
# Console mode with PIDs shown
./run.sh --console --show-pid --ports 3000,8000,8080
# Console mode for full-screen mode users (recommended)
./run.sh --console --log-level warn --ports 3000,8000,8080
#### Log Level Control
```bash
# Show all logs (default)
./run.sh --log-level info --ports 3000,8000
# Show only warnings and errors
./run.sh --log-level warn --ports 3000,8000
# Show only errors
./run.sh --log-level error --ports 3000,8000
# Show no logs (quiet mode)
./run.sh --log-level none --ports 3000,8000
# Verbose mode (overrides log-level)
./run.sh --verbose --ports 3000,8000# Monitor ports including Docker containers
./run.sh --docker --ports 3000,3001,8000,8080
# Monitor port range with Docker support
./run.sh -d -s 3000 -e 8080
# Console mode with Docker monitoring
./run.sh --console --docker --ports 3000,8000,8080# Ignore common system ports (Chromecast, AirDrop, etc.)
./run.sh --ignore-ports 5353,5000,7000
# Ignore specific process names
./run.sh --ignore-processes Chrome,ControlCe,rapportd
# Combine both ignore options
./run.sh --ignore-ports 5353,5000,7000 --ignore-processes Chrome,ControlCe
# Console mode with ignore options
./run.sh --console --ignore-ports 5353,5000,7000 --ignore-processes Chrome,ControlCeCommon System Processes to Ignore:
- Port 5353: Google Chromecast service
- Port 5000: Apple AirDrop service (ControlCe)
- Port 7000: Apple AirDrop service
- Process "Chrome": Google Chrome browser
- Process "ControlCe": Apple Control Center/AirDrop
- Process "rapportd": Apple Rapport service
Docker Features:
- Detects processes running inside Docker containers
- Shows container names prominently in the menu and console output (no PID for containers)
- Automatically stops containers when killing processes
- Uses
docker stopfor graceful termination,docker rm -fas fallback
--start-port, -s: Starting port for range scanning (default: 2000)--end-port, -e: Ending port for range scanning (default: 6000)--ports, -p: Specific ports to monitor (comma-separated, overrides start/end range)--ignore-ports: Ports to ignore (comma-separated, e.g., 5353,5000,7000 for Chromecast/AirDrop)--ignore-processes: Process names to ignore (comma-separated, e.g., Chrome,ControlCe)--console, -c: Run in console mode instead of status bar mode--verbose, -v: Enable verbose logging (overrides --log-level)--log-level: Control logging verbosity (info, warn, error, none) (default: info)--docker, -d: Enable Docker container monitoring (includes containers in process detection)--show-pid, -P: Show process IDs (PIDs) in the display output--help, -h: Show help information--version, -V: Show version information
- Main Thread: Handles UI events and menu interactions with winit event loop
- Process Monitor: Scans for processes every 5 seconds using
lsof - Menu Updates: Updates context menu every 3 seconds when processes change
- Process Killing: Runs in background threads to maintain UI responsiveness
The application uses the following command to detect processes:
lsof -ti :PORT -sTCP:LISTEN- SIGTERM: First attempts graceful termination
- SIGKILL: If process doesn't terminate within 500ms, forces termination
- Error Handling: Gracefully handles permission errors and already-terminated processes
Monitors ports 2000-6000 (broad range covering common development server ports)
tray-icon: macOS status bar integrationwinit: Event loop managementnix: Signal handling for process terminationcrossbeam-channel: Thread communicationtokio: Async runtimeanyhow: Error handlingserde: Data serialization
# Platform-specific builds
./build-macos.sh # macOS with tray icon
./build-linux.sh # Linux with GTK tray
build-windows.bat # Windows with tray icon
# Generic build (macOS configuration only)
cargo build --release
# Build console mode only
cargo build --release --bin port-kill-console# Run with info logging
RUST_LOG=info ./run.sh
# Run with debug logging
RUST_LOG=debug ./run.sh --verbose
# Run tests
cargo test
cargo test -- --nocapture # With output
# Code quality checks
cargo clippy # Lint code
cargo fmt # Format codeThis project uses GitHub Actions for automated building and testing:
-
Build and Test (
.github/workflows/build.yml): Runs on pull requests and pushes to main/master- Builds binaries for all platforms (macOS, Linux, Windows)
- Tests that binaries can run and show help
- Tests console mode functionality
-
Build and Release (
.github/workflows/release.yml): Runs when a new release is published- Builds optimized binaries for all platforms
- Creates compressed archives and individual binary files
- Uploads all assets to the GitHub release
To test the build scripts locally:
# macOS
./build-macos.sh
# Linux
./build-linux.sh
# Windows
build-windows.batFor comprehensive debugging information, see the DEBUGGING.md file.
# Run comprehensive debug script
./debug-portkill.sh
# Run with debug logging
RUST_LOG=debug ./run.sh --verbose
# Run in console mode (more stable)
port-kill-console --console --ports 3000,8000If you encounter permission errors when trying to kill processes:
- Ensure the application has the necessary permissions
- Some system processes may be protected
- Check if the process is owned by another user
If a process is not being detected:
- Verify the process is listening on a port in the 2000-6000 range
- Check if the process is using TCP (not UDP)
- Ensure the process is in LISTEN state
If the application fails to start:
- Check if another instance is already running
- Verify all dependencies are installed
- Check system logs for error messages
If the system tray menu is not accessible when applications are in full-screen mode:
-
Use Console Mode: The most reliable solution is to use console mode:
./run.sh --console --ports 3000,8000
-
Exit Full-Screen: Temporarily exit full-screen mode to access the system tray
-
Use Mission Control: On macOS, use Mission Control (F3 or three-finger swipe up) to access the menu bar
-
Alternative Access: The app provides console output with process status updates, so you can monitor activity even when the menu is not accessible
If the Linux system tray is not working or processes are not showing:
-
Run the debug script to diagnose issues:
./debug_linux.sh
-
Install GTK packages (required for system tray):
# Ubuntu/Debian sudo apt-get install libatk1.0-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxdo-dev pkg-config # Fedora/RHEL sudo dnf install atk-devel gdk-pixbuf2-devel gtk3-devel libxdo-devel pkg-config # Arch Linux sudo pacman -S atk gdk-pixbuf2 gtk3 libxdo pkg-config
-
Use console mode (works without GUI dependencies):
./run-linux.sh --console --ports 3000,8000 --verbose
-
Check display environment:
- Ensure you're running in a desktop environment (not SSH without X11 forwarding)
- Verify
DISPLAYenvironment variable is set:echo $DISPLAY - Try running in a terminal emulator (not pure console)
-
Common Linux issues:
- Tray icon not showing: Check if you're in a desktop environment with system tray support
- Processes not detected: Verify
lsofis installed and working:lsof -i :3000 - GTK errors: Install missing GTK packages or use console mode
- Permission issues: Run with appropriate permissions or use
sudoif needed
-
For detailed debugging:
RUST_LOG=debug ./run-linux.sh --console --ports 3000,8000
If Docker integration is not working:
- Ensure Docker Desktop is running
- Verify
dockercommand is available in PATH - Check Docker permissions and access
- Ensure containers are running and accessible
- Try running with
--verboseflag for detailed logging
This project is licensed under the FSL-1.1-MIT License. See the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
