Skip to main content

Real-time port and process monitor with dev port alerts and built-in config UI

Project description

🖥️ PortWatch — Real-Time Port & Process Monitor

A sleek, cross-platform desktop app to monitor, filter, and kill processes using dev ports — with conflict alerts and customizable port lists via UI.

Built with Python + Textual TUI — works on Windows, macOS, Linux.


✨ Features

Live Process Table — See all running processes, ports, PIDs, and statuses
Dev Port Conflict Detection — Highlights ports you’ve marked as “dev” (e.g., 3000, 8080)
Desktop Notifications — Get alerts when dev ports are in use ⚠️
One-Click Kill — Terminate any process with confirmation
Smart Filters — Filter by “All”, “New”, or “Conflict”
Built-in Port Config UI — No manual .portconfig editing! Add/remove/reset ports via GUI
Persistent Config — Your dev port list is saved automatically to .portconfig
Cross-Platform — Works on Windows, macOS, Linux


🚀 Quick Start

1. Install

pip install portwatch

Or if installing from source:

git clone https://github.com/MadushankaRajapaksha/portwatch
cd portwatch
pip install -e .

Requires Python 3.9+


2. Run

portwatch

→ Opens interactive TUI app.


🎯 How to Use

🔍 Main Screen

You’ll see a live table of processes using network ports:

PID PORT PROCESS STATUS ACTION NOTE
1234 3000 node.exe LISTEN KILL 🆕 NEW
5678 5432 postgres.exe LISTEN KILL ⚠️ Conflict

⚙️ Manage Dev Ports (NO MANUAL FILE EDITING!)

Click the “⚙️ Config” button → opens Port Config Modal

  • Add Port — Type port number (e.g., 3001) → click “Add Port”
  • 🗑️ Delete Port — Select row → click “Delete Selected”
  • 🔄 Reset to Default — Restores common dev ports (3000, 8080, 5432, etc.)
  • Close — Saves automatically — no manual .portconfig editing needed!

✅ All changes are saved instantly to .portconfig — you never need to touch the file.


🧭 Filter Processes

Use the filter bar:

  • Text Filter — Type app name or port (e.g., “node” or “3000”)
  • Toggle Filters:
    • All — Show everything
    • 🆕 New — Only processes appeared since last scan
    • ⚠️ Conflict — Only processes using your marked dev ports

☠️ Kill a Process

  1. Click any row in the table (or use arrow keys + Enter)
  2. Confirm “Kill?” in popup
  3. Process is terminated — table auto-refreshes

🔔 Notifications

When a process starts using a dev port (e.g., 3000), you’ll get a desktop notification:

“⚠️ Port 3000 in use by node.exe”

❗ If notifications don’t work, you’ll see a one-time alert modal explaining it.


📁 Configuration

Your dev port list is stored in .portconfig in the app directory — but you should never edit it manually.

Example auto-generated .portconfig:

'3000': React Dev
'8080': Backend API
'5432': PostgreSQL
'27017': MongoDB

✍️ Use the “⚙️ Config” UI to manage this — it’s safer and instantly reloads in the app.


🛠️ Troubleshooting

❌ “Notifications not working”

  • Windows: Make sure “Focus Assist” is off
  • macOS: Go to System Settings → Notifications → Allow notifications for Terminal/Python
  • Linux: Install libnotify-binsudo apt install libnotify-bin

App will show a warning modal if notifications are disabled.


🐛 App crashes or shows errors

Run in dev mode for logs:

textual run -d portwatch

📦 Dependencies

  • textual — TUI framework
  • psutil — Process/port scanning
  • plyer — Desktop notifications
  • pyyaml — Config file handling

📄 License

MIT — Use freely for personal or commercial projects.


🙌 Contributing

PRs welcome! Especially for:

  • Export/import config
  • Process graphs
  • Dark/light mode toggle
  • Keyboard shortcuts

💬 Support

Open an issue on GitHub or message @yourusername.


🔐 No more manual .portconfig editing — Use the UI. It’s faster, safer, and updates live.


✅ Save this as README.md in your project root.


🧩 Bonus: Add to setup.py or pyproject.toml

If distributing via pip:

[project]
name = "portwatch"
version = "0.1.0"
description = "Real-time port and process monitor with dev port alerts"
readme = "README.md"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

portwatch-0.0.8.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

portwatch-0.0.8-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file portwatch-0.0.8.tar.gz.

File metadata

  • Download URL: portwatch-0.0.8.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for portwatch-0.0.8.tar.gz
Algorithm Hash digest
SHA256 95affd3e7a7877ecc667008ff9564b3e2d89c3d0f5c03ad25b19ca8a383b28d3
MD5 8fdee32edf88db5f7a4e9e81c80ad19b
BLAKE2b-256 efb4af0934e2fe5d4989c0da3df88a0bf4b9fd18d902a77931fe8f3f68e78c66

See more details on using hashes here.

File details

Details for the file portwatch-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: portwatch-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for portwatch-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7ad7756d500cd92c0344e13f4b6cd9874087358619b8adfdd4cf40a24a1f59ee
MD5 4b8a7c17041e1b90b3af4c35f9282eeb
BLAKE2b-256 9e4e2b604aacac35043ca04b3a390e7e6519d8c0c0b5d89ec87a94839e079856

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page