Skip to main content

A robust CLI tool to track, manage, and free up local development ports safely.

Project description

Port Doctor

A small CLI for tracking which local port is reserved for which dev task — and for freeing one up when something's squatting on it.

Features

  • Reserve a port for a task, so you remember why it's taken
  • List your reservations with live status (free, or in use and by what)
  • Free one or more ports by killing whatever's listening on them (asks for confirmation first)
  • Scan every listening port on the system, or just your dev-oriented ports
  • Inspect likely framework/container labels for running processes
  • Tail best-effort logs for the process behind a port

Installation

pip install port-doctor

Requires Python 3.7+ and psutil (installed automatically). Works on Linux, macOS, and Windows.

Usage

# Reserve a port for a task
port-doctor reserve 3000 "Claude Code"

# The shorter alias works too
pd reserve 3000 "Claude Code"

# List your reservations and their live status
port-doctor list
pd list

# Free a port — kills the listening process (prompts for confirmation)
port-doctor free 3000
pd free 3000

# Free multiple ports or a range, and preview first
pd free 3000 8000 5432 --dry-run
pd free 3000-3005

# Remove a reservation without touching any running process
port-doctor unreserve 3000
pd unreserve 3000

# See every listening port on the system, reserved or not
port-doctor active
pd active

# Focus on dev-like ports and labels only
pd active --dev

# Best-effort tail of a process's redirected logs
pd logs 8000

Add -y/--yes to free, --dry-run to preview kills, -f/--force to reserve, or --dev to active to focus on likely development servers.

Notes

  • Reservations live in ~/.port-doctor.json.
  • Inspecting or killing processes you don't own may require sudo/Administrator, depending on your OS.

License

MIT

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

port_doctor-0.2.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

port_doctor-0.2.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file port_doctor-0.2.0.tar.gz.

File metadata

  • Download URL: port_doctor-0.2.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for port_doctor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a9447178819ca639ad8481cd4196598e48ce58d8f33b6816c180f043ca3353d5
MD5 3a7dbbd8dc14c19b8d237b2dd62236dc
BLAKE2b-256 91bc5a252d2e5c4804a7cb4f0487c0c0279d87f5a0474ae8ad76b963b46119ee

See more details on using hashes here.

File details

Details for the file port_doctor-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: port_doctor-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for port_doctor-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fea9a3469f8feee7f82237b5859fd7e05351b51ec814fd17fc0cca58396c570c
MD5 a7f2f07b657bf60531849c3c6ea8fc41
BLAKE2b-256 dad685ab9656eee6d1928f7177fe63db3a05fedbe45cfb16c88ea079f470db38

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