____ ___ ____ _____ ____ _____ _____ _ __
| _ \ / _ \| _ \_ _| _ \| ____| ____| |/ /
| |_) | | | | |_) || | | |_) | _| | _| | ' /
| __/| |_| | _ < | | | __/| |___| |___| . \
|_| \___/|_| \_\|_| |_| |_____|_____|_|\_\
portpeek
Ultra-fast all-in-one port · process · TLS · network inspector for developers.
made by arien-dev • https://github.com/arien-dev/portpeek
Pure Python ≥ 3.10 standard library — zero runtime dependencies. Platform support is POSIX-only; Windows is not currently supported.
Scan results distinguish open, closed, timeout, and error; timeouts and
resolution failures are not reported as free ports. --timeout applies to each
TCP connection attempt; system DNS resolution can take longer. Hosts are scanned
sequentially and each host scan is capped at 64 concurrent workers.
Features
- Quick subcommands —
freeport,who/pid,list/ls,doctor/check,diff,ping,menu,repo - Classic scanner —
portpeek 3000, ranges,HOST:PORT, presets (web/db/dev/common),--cidr,--host-file - Local process intel — PID, user, full cmdline, bind address, uptime; Docker container/image when
docker-proxyholds the port - Deep doctor — DNS (A/AAAA + ms), TCP latency (min/avg/max/jitter/loss), TLS cert CN/SANs/expiry, HTTP status/headers, plain-English diagnosis
- Safety — warn when databases/caches bind on
0.0.0.0/:: - Export —
-o/--outputfor.json,.jsonl,.csv,.md,.txt(+--include-meta, auto filename) - Interactive menu — ASCII logo, ↑/↓ or j/k,
gopens GitHub, export after each scan
Installation
pip install "git+https://github.com/arien-dev/portpeek.git"
# or editable:
pip install -e /path/to/portpeek
Arch Linux (AUR)
The root PKGBUILD and .SRCINFO are prepared for AUR submission. To build
and test the package on Arch Linux:
sudo pacman -S --needed base-devel git python-build python-hatchling python-installer
makepkg --syncdeps --cleanbuild
To publish it, first verify that portpeek is not already present in the AUR,
create an AUR account, and add your SSH public key in your AUR account settings.
Then clone the AUR package repository, copy these two files into it, regenerate
.SRCINFO, and push:
ssh -T aur@aur.archlinux.org
git clone ssh://aur@aur.archlinux.org/portpeek.git aur-portpeek
cd aur-portpeek
cp /path/to/upstream/portpeek/PKGBUILD /path/to/upstream/portpeek/.SRCINFO .
makepkg --printsrcinfo > .SRCINFO
git add PKGBUILD .SRCINFO
git commit -m "Initial import"
git push
The PKGBUILD pins the upstream source commit. When updating the AUR package,
update pkgver and the commit in source, then regenerate .SRCINFO.
After the AUR package is accepted, users can install it with:
yay -S portpeek
Quick Subcommands
# Next free port for scripts
PORT=$(portpeek freeport)
PORT=$(portpeek freeport 4000-4100 --block 3 --copy)
# Who owns this port?
portpeek who 3000
portpeek pid 5432 --kill --yes # SIGTERM (add --force for SIGKILL)
# Everything listening locally
portpeek list
portpeek ls --public --dev-only --search postgres
# Deep diagnose (DNS + TCP + TLS + HTTP)
portpeek doctor example.com:443
portpeek check 127.0.0.1:8080
# Compare two environments
portpeek diff localhost staging.example.com web
# TCP ping (works when ICMP is blocked)
portpeek ping db.internal:5432 -c 5
# Open the repo
portpeek repo
Classic Scanner (backwards compatible)
portpeek 3000
portpeek 80 443 --services
portpeek 127.0.0.1:3000
portpeek example.com:443 --latency --banner
portpeek 80,443 3000-3010 --host 127.0.0.1
portpeek --preset web --services --latency
portpeek --preset db --proc --summary
portpeek 80,443 --cidr 192.168.1.0/29 --only-open
portpeek 3000-3050 --find-free
portpeek 4000-4100 --block 3
portpeek 3000,8080 --watch 1 --services
portpeek --preset web -o report.md --include-meta
portpeek 3000-3020 -o events.jsonl
portpeek 80,443 --quiet
Interactive Menu
portpeek menu
Arrow keys (↑/↓) or j/k to move, Enter to select, g for GitHub, q/Esc to quit.
- Active Local Ports
- Who is using Port X?
- Deep Port Doctor
- Common Web & Dev Ports Scan
- Databases & Cache Scan
- Find Free Port / Contiguous Block
- Live Watch Ports
- Custom Host / CIDR / Range Scan
- Open GitHub Repository
- Exit
Help
portpeek --help
portpeek freeport --help
portpeek doctor --help
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success / all scanned ports closed / TCP reachable (doctor/ping) |
| 1 | At least one open port, scan error/timeout, no free port, or unreachable TCP target |
| 2 | Usage / parse error |
| 130 | Interrupted (Ctrl+C) |
License
GPL 2.0 — arien-dev · github.com/arien-dev/portpeek
Metadata
Release files for py-portpeek 1.3.4
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 |
|---|---|---|---|---|
| py_portpeek-1.3.4.tar.gz | 39.7 kB | With provenance | Details for py_portpeek-1.3.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_portpeek-1.3.4-py3-none-any.whl | Python 3 | none | any | Details for py_portpeek-1.3.4-py3-none-any.whl |
Total release size: 80.9 kB
Release files / py_portpeek-1.3.4.tar.gz
| Download URL | py_portpeek-1.3.4.tar.gz |
|---|---|
| Size | 39.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1209640cd3668724c8e9435d1d17278247b3bc4ce82f0fa4dcd64500d865c992
|
|
BLAKE2b-256 checksum How to use checksums |
c07ef7086fbe2f14f36407b9bb1facb5206e21211a42393acdf80cff38a4ba6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / py_portpeek-1.3.4-py3-none-any.whl
| Download URL | py_portpeek-1.3.4-py3-none-any.whl |
|---|---|
| Size | 41.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eed02f1931e7024060f237dfe8125143a4b95a25fb1c5415f02e2b13e68e31b9
|
|
BLAKE2b-256 checksum How to use checksums |
7ee48d03e5abdf287c06e42e5eed4819ab9b3b7bef6b1e4dbf9de028e759b784
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for py-portpeek 1.3.4
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for py_portpeek-1.3.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA 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.