devports
See what's running on your local ports.
A developer-friendly CLI that scans your local ports, identifies what's running on each one, checks service health, and displays everything in a clean terminal table.
Local Services
---------------------------------------------------------------
PORT | SERVICE | STATUS | ADDRESS
---------------------------------------------------------------
3000 | next-dev | ● healthy (3ms) | 127.0.0.1
5173 | vite | ● healthy (1ms) | 127.0.0.1
5432 | postgres [docker] | ● healthy (2ms) | 0.0.0.0
6379 | redis [docker] | ● healthy (1ms) | 0.0.0.0
8000 | fastapi | ● healthy (5ms) | 127.0.0.1
8080 | api-server | ● down | 0.0.0.0
9090 | prometheus [docker] | ● healthy (4ms) | 0.0.0.0
---------------------------------------------------------------
7 service(s) found
Features
- Port scanning -- discovers all listening TCP ports via
ss - Service identification -- maps ports to friendly names using a built-in database of 30+ common services, process name matching, and command-line analysis
- Docker integration -- detects Docker containers and tags them accordingly
- Health checking -- probes each port with a TCP connection and reports healthy/down/unknown with response time in milliseconds
- JSON output -- structured output for scripting and piping
- Live watch mode -- auto-refreshing view that updates as services start and stop
- Open in browser -- launch a service by port number or name
- Kill by port -- terminate a process by the port it listens on
- PID and command display -- optional columns showing process IDs and full command lines
Installation
pip install devports
Requires Python 3.10+ and a Linux system with ss available (standard on all modern distributions).
Usage
Scan all ports
devports
Show process IDs
devports --pid
Show full command lines
devports --cmd
Skip health checks
devports --no-health
JSON output
devports --json
Returns a JSON array with port, service, pid, process, address, tags, and health information for each entry. Useful for scripting:
devports --json | jq '.[].service'
Live watch mode
devports watch
devports watch --interval 5
devports watch --pid
Auto-refreshing terminal UI. Updates every 2 seconds by default. Press Ctrl+C to stop.
Open a service in the browser
devports open 3000
devports open next-dev
Accepts a port number or a service name (partial match). Uses xdg-open or wslview on WSL.
Kill a process by port
devports kill 8080
Sends SIGTERM to the process listening on the given port.
How It Works
- Scan -- Reads listening TCP sockets from
ss -tlnpHand enriches each entry with data from/proc(command line, process name) - Identify -- Matches each port against a known-port database, maps process names to service names, and parses command lines to detect frameworks (Next.js, Vite, FastAPI, Django, Spring, etc.)
- Docker -- Queries
docker psto match published port bindings to container names and tags them with[docker] - Health check -- Opens a TCP connection to each port and measures response time; reports healthy, down, or unknown
- Display -- Renders a formatted table using Rich, or outputs structured JSON
Service Detection
devports uses four layers to identify what is running on each port:
| Layer | Method | Example |
|---|---|---|
| Docker containers | docker ps port bindings |
postgres container on 5432 |
| Process name map | Match process name to known services | redis-server -> redis |
| Known port database | 30+ common dev ports | 5173 -> vite, 9092 -> kafka |
| Command-line analysis | Parse cmdline for framework keywords |
node .../next/... -> next-dev |
Layers are evaluated in order. The first match wins.
For generic runtimes like node, python, and java, devports inspects the full command line to detect specific frameworks: Next.js, Vite, Nuxt, Remix, Express, NestJS, Django, Flask, FastAPI, Gunicorn, Jupyter, Spring, and Tomcat.
Contributing
git clone https://github.com/Ltbltbltbltb/devports.git
cd devports
pip install -e ".[dev]"
pytest
ruff check src/
License
Metadata
Release files for devports 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| devports-0.1.0.tar.gz | 17.0 kB | Without provenance | Details for devports-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| devports-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for devports-0.1.0-py3-none-any.whl |
Total release size: 29.0 kB
Release files / devports-0.1.0.tar.gz
| Download URL | devports-0.1.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3e740e33f4182ef1aa8ed5003d7dfe4ef624abc94e838dc78e7c1286ea866d4
|
|
BLAKE2b-256 checksum How to use checksums |
c2125585770963959637c47b5f9bfefa3c6f63ff22ab91968f66da429f98957d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / devports-0.1.0-py3-none-any.whl
| Download URL | devports-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
336905c5482237baa195fc26e0964b2c751af906494af9f6f68d470c1a677508
|
|
BLAKE2b-256 checksum How to use checksums |
88127df130594ae09725e8c6fe0ce7acc66a69a5c9a81e0a87b3a74857cef422
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for devports 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.