portsmith
A local port management CLI for macOS, Linux, and Windows.
Installation
pip install portsmith
Or install from source:
git clone <repo>
cd portsmith
pip install -e .
Commands
portsmith list
Show all listening ports with PID, process name, port, protocol, and status. System ports (<1024) are highlighted in yellow, user ports in green.
portsmith list
# Only show ports opened from this terminal session
portsmith list --mine
# Machine-readable JSON output
portsmith list --json
--minenote: this flag filters to processes running under your OS user account. It removes system services (svchost, lsass, etc.) but will still show other user-owned background apps that happen to listen on ports (e.g. Chrome, cloud sync clients). It correctly catches dev servers started in any shell or terminal window.
portsmith kill <port>
Kill the process listening on a given port. Asks for confirmation unless --force is passed.
portsmith kill 8080
# Skip confirmation
portsmith kill 8080 --force
portsmith kill 8080 -f
portsmith watch
Live-updating view of all active ports, refreshing every 2 seconds. New ports are highlighted green, closed ports red. Exit with Ctrl+C.
portsmith watch
# Only watch ports opened from this terminal session
portsmith watch --mine
portsmith save <name>
Save a snapshot of all currently active user ports (port ≥1024) to ~/.portsmith/profiles/<name>.json.
portsmith save myproject
portsmith save dev-stack
portsmith restore <name>
Check a saved profile against currently running ports. Shows which saved processes are still running and which are missing, along with hints for restarting them.
portsmith restore myproject
portsmith profiles
List all saved profiles with their creation timestamp and port count.
portsmith profiles
Requirements
- Python 3.10+
- macOS, Linux, or Windows
Notes
- Ports below 1024 are system ports and may require
sudoto kill. portsmith restoredoes not restart processes — it only reports their status and suggests what needs to be restarted.- Profiles are stored in
~/.portsmith/profiles/as JSON files.
Metadata
Release files for portsmith 0.1.2
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 | |
|---|---|---|---|---|
| portsmith-0.1.2.tar.gz | 6.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| portsmith-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.8 kB
Release files / portsmith-0.1.2.tar.gz
| Download URL | portsmith-0.1.2.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e74c698715bebe2906c65898e1e8c0837384a8c025296087ad46a45a18acfdf1
|
|
BLAKE2b-256 checksum How to use checksums |
389015a6014ed9a03b1cafce24c06fa7093bd40574218ee0b5529f9fbf9c7d80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / portsmith-0.1.2-py3-none-any.whl
| Download URL | portsmith-0.1.2-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05f1672613262dc9b9d762981ba0ad2b949696f739b1b9f8a7b4c865cee406c5
|
|
BLAKE2b-256 checksum How to use checksums |
d276ddb402a414c01fbb0223c3560afe74b9c954436c5752e07bb111aeb2c4c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for portsmith 0.1.2
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.