Skip to main content

whatport

CI crates.io clispec

Find what process is listening on a TCP/UDP port, and free it. The fast, agent-friendly answer to "what's on :5099?" and "kill whatever it is."

Why

"Address already in use." Then the dance: lsof -i :5099, read the pid, kill, hope. whatport collapses that into one command with structured output: whatport 5099 tells you the owner; whatport kill 5099 frees it. JSON when piped, a table in a terminal.

Install

cargo install whatport

Quickstart

# What's on this port?
whatport 5099
# PORT   PROTO PID      PROCESS                USER       UPTIME    ADDRESS
# 5099   tcp   1234     node                   ruben      3h12m     127.0.0.1

# Just the data (JSON when piped)
whatport 5099 | jq '.listeners[0].pid'

# Free it (SIGTERM, or --force for SIGKILL)
whatport kill 5099
whatport kill 5099 --force

# Everything that's listening
whatport list
whatport list --proto udp

whatport <port> is shorthand for whatport inspect <port>.

Commands

command mutating what it does
whatport <port> / inspect <port> no the listener(s) on a port: pid, process, command, user, uptime, address
list no every listening TCP/UDP socket
kill <port> [--force] yes SIGTERM (or SIGKILL with --force) the owner(s); reports what it signalled
schema no the clispec v0.3 contract as JSON
completions <shell> no shell completion script

Global flags: -o/--output auto\|json\|text (auto = text on a TTY, JSON when piped) and --proto tcp\|udp\|all.

Output

  • Inspect/list: {"listeners":[{port, proto, addr, pid, process, command, user, uptime_secs}, …]}.
  • Kill: {"port", "signal", "killed":[{pid, process, ok, …}], "changed"}.

When the OS won't let you see the owner of a socket you don't own, the port and protocol are still shown and pid/process are omitted - run with sudo for full owner details rather than getting a silent gap.

Platforms

macOS and Linux. Pure Rust (netstat2 for the socket table, sysinfo for process details) - no shelling out to lsof/ss.

Exit codes

code meaning
0 success
1 nothing listening on the queried port
2 system error (socket/process table unreadable, or a kill failed)
3 usage error (bad arguments)

For agents (clispec)

whatport follows The CLI Spec: structured output on stdout, structured error envelopes on the last line of stderr, and a schema subcommand whose output validates against clispec.dev/schema/v0.3.json (checked by the test suite). Read-only commands are mutating: false; kill is the one mutating: true command.

License

MIT

Metadata

Release files for whatport 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whatport 0.1.1
File Size Uploaded Provenance Actions
whatport-0.1.1.tar.gz 38.7 kB Without provenance Details for whatport-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for whatport 0.1.1
File Actions
whatport-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for whatport-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
whatport-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for whatport-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
whatport-0.1.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for whatport-0.1.1-py3-none-macosx_11_0_arm64.whl
whatport-0.1.1-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for whatport-0.1.1-py3-none-macosx_10_12_x86_64.whl

Total release size: 2.2 MB

Release files / whatport-0.1.1.tar.gz

Download URL whatport-0.1.1.tar.gz
Size 38.7 kB
Tags Source
SHA-256 checksum
How to use checksums
eaf7598a4842e8853a971c6456b3391faf6223ded6dbad3ed5a080cb61bbdc53
BLAKE2b-256 checksum
How to use checksums
4f54c5ddd1ccdf809e6aa2599b660df66099a25fbaa6a99dc4156831da9faa07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.4 {"installer":{"name":"uv","version":"0.12.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / whatport-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL whatport-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 589.0 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
a5661a00c2501726ac9cf3fb11f6488d3bc5e4d70963ca46dc2ddb58116bbf26
BLAKE2b-256 checksum
How to use checksums
a034c581a7b4187f7b3408433a01c4b78eeb139e1ba38f6c4ad62bbea7db321e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.4 {"installer":{"name":"uv","version":"0.12.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / whatport-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL whatport-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 553.6 kB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
eddb211ad447b130fd1abd400847a69b8abaeebbb5a3c399bcea8cc7b8db6cb5
BLAKE2b-256 checksum
How to use checksums
a3d15059bf48f20f11476f6a55b3a5d890d2a83299f833ceff8e4c2a34a6276e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.4 {"installer":{"name":"uv","version":"0.12.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / whatport-0.1.1-py3-none-macosx_11_0_arm64.whl

Download URL whatport-0.1.1-py3-none-macosx_11_0_arm64.whl
Size 471.3 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
088dff3796cffe3ee7576afc8a68e7b4d92da72cfe914044472f13083ad2a745
BLAKE2b-256 checksum
How to use checksums
96b94a59a47c27e4a7c16dcfff4994aa92abe34900ce944396f942cd2031e420
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.4 {"installer":{"name":"uv","version":"0.12.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / whatport-0.1.1-py3-none-macosx_10_12_x86_64.whl

Download URL whatport-0.1.1-py3-none-macosx_10_12_x86_64.whl
Size 504.3 kB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
9483747d8420b0a15224dcac0196a81da68a3b6c7acbfb8a16e4a5515cc271f3
BLAKE2b-256 checksum
How to use checksums
4b011067ec67c5afcfb1822ccf7eb5e3a912303108e1e3dde7abacde0724679e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.4 {"installer":{"name":"uv","version":"0.12.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for whatport 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

5 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page