Windows-based real-time port inspection CLI tool
Project description
Portviz
Cross-Platform Port & Process Manager for Developers
Portviz is a developer-focused utility designed to inspect active network ports, identify the processes bound to them, and safely terminate processes without relying on complex system commands.
It simplifies debugging scenarios like “Address already in use” errors by providing structured, readable port information and streamlined process control.
🚀 Vision
Portviz is being built in structured phases:
- Core cross-platform port inspection engine (Python)
- CLI utility for fast terminal usage
- VS Code extension for in-editor visibility and control
- Project-level service and port orchestration layer
The long-term goal is to create a modular developer utility that integrates seamlessly into modern development workflows.
🎯 Problem It Solves
During development:
- Servers may crash but keep ports occupied
- “Port already in use” errors interrupt workflow
- Identifying and killing processes requires OS-specific commands
- Managing multiple services across different ports becomes difficult
Examples:
- macOS/Linux →
lsof -i :3000+kill -9 <PID> - Windows →
netstat -ano+taskkill /PID <PID>
Portviz abstracts these differences and provides a consistent interface.
🏗 Architecture Overview
Portviz follows a layered architecture:
1️⃣ Core Engine (Python)
- Detects operating system
- Executes system networking commands
- Parses raw command output
- Normalizes port data into structured objects
- Handles safe process termination
2️⃣ CLI Layer
- Displays structured port table
- Assigns custom IDs for safe termination
- Simplifies kill operations
- Supports filtered views (e.g., LISTEN state)
3️⃣ VS Code Extension (Planned)
- Sidebar port viewer
- Refresh button
- One-click process termination
- IDE workflow integration
This modular design ensures the engine can be reused across CLI tools and IDE integrations.
🧠 How It Works
- Detect OS (Windows/macOS/Linux)
- Execute appropriate system command:
lsof -i -P -nnetstat -ano
- Capture raw output
- Parse into structured objects:
- Port
- PID
- Process name
- Protocol
- Address
- State
- Return normalized data
- Allow safe process termination via PID mapping
📦 Features
- Cross-platform port inspection
- LISTEN port filtering
- PID-based safe termination
- Structured port object normalization
- OS abstraction layer
- Modular reusable core engine
🔮 Future Enhancements
Project-Level Service Management
- Workspace-based service configuration
- Define service name, port, start command, dependencies, and type
- One-click startup of all project services
- Real-time service health monitoring
- Port conflict detection
Service Topology Visualization
- Visual representation of frontend–backend–database architecture
- Live service status indicators
- Traffic flow tracking (where possible)
Developer Experience Improvements
- Interactive CLI mode
- Auto-refresh/watch mode
- Docker container awareness
- IPv4/IPv6 normalization
- Permission safety checks
- Performance optimizations
🧩 Example Future Configuration (Conceptual)
Portviz may support project-level configuration such as:
Frontend
- Port: 5173
- Command:
npm run dev
Backend
- Port: 8000
- Command:
nodemon server.js
Database
- Port: 5432
- External service (no start command)
This would allow Portviz to function as a lightweight local development orchestrator inside VS Code.
🔧 Tech Stack
- Python
- OS-level Networking Utilities (
lsof,netstat) - Subprocess-based Process Management
- Cross-Platform OS Detection
- CLI Architecture
- VS Code Extension API (Planned)
- Node.js Integration (Planned)
📌 Project Status
Currently in active development.
Phase 1 focuses on building a robust, reusable port inspection engine.
CLI and VS Code integration layers will be built on top of the core module.
📈 Long-Term Scope
- Publish as a pip package
- npm wrapper for JavaScript ecosystem
- VS Code Marketplace extension
- Project-level service orchestration
- Local architecture visualization
- Advanced developer workflow tooling
📄 License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file portviz-1.0.0.tar.gz.
File metadata
- Download URL: portviz-1.0.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a57fc3072cedea76b17121c259644629ba3f67c10334a095a7a5d00aab88e46
|
|
| MD5 |
154c28de9cec5c912b83e3bb1e515c96
|
|
| BLAKE2b-256 |
c7c7bd1ff9bdf6f0b900c686b85c6bfa52702d02ab40b2619989d694dafe7723
|
File details
Details for the file portviz-1.0.0-py3-none-any.whl.
File metadata
- Download URL: portviz-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c388dd39e0cc57b74985d2f72a3244ccf548469a636d883cb03c5301662437a
|
|
| MD5 |
d7db6c731d25eefc483efcbc542fbd4d
|
|
| BLAKE2b-256 |
9295bf5fe8d8efc84dc5fab768737d0c5030098caead3a84550f80efbec0b9a1
|