Skip to main content

Check what's using a port and optionally kill it

Project description

portcheck

Check what's using a port and optionally kill it.

Simple, fast, with JSON output for automation.

Installation

pip install portcheck-cli

Usage

Check a specific port

# See what's on port 8080
portcheck check 8080

# Kill whatever's using port 8080
portcheck check 8080 --kill

# Force kill without confirmation
portcheck check 8080 --kill -f -y

# Check UDP port
portcheck check 53 --udp

# Get JSON output
portcheck check 8080 --json

Scan a range of ports

# Scan ports 8000-9000
portcheck scan 8000 9000

# Get JSON output
portcheck scan 3000 3100 --json

List all listening ports

portcheck list

# JSON output
portcheck list --json

Kill a process by PID

portcheck kill 12345
portcheck kill 12345 -f -y  # Force, no confirm

JSON Output

All commands support --json for machine-readable output:

[
  {
    "port": 8080,
    "protocol": "TCP",
    "status": "LISTEN",
    "pid": 12345,
    "local_address": "127.0.0.1:8080",
    "name": "python",
    "cmdline": "python -m http.server 8080",
    "user": "ape"
  }
]

For AI Agents

See SKILL.md for agent-optimized documentation.

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

portcheck_cli-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

portcheck_cli-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file portcheck_cli-0.1.0.tar.gz.

File metadata

  • Download URL: portcheck_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for portcheck_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a42b19d29d87a1cb4a6d0e188ef8a7501164ebc96dc8dbf4edfa53cb8a18ee85
MD5 309d769ced2cf84c198f3ffc70e516b6
BLAKE2b-256 56f12b9cbba8d5038626abadad16cf7d6c741422d93af106c4cca74be9fb98f1

See more details on using hashes here.

File details

Details for the file portcheck_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: portcheck_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for portcheck_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1be52330adbce476061a5886212d8cf499a5f7cb62d9c78f0f66404c717422a7
MD5 fd1dba02e0ee9b8ca53f1747c8c3e746
BLAKE2b-256 f8137fbc78e32e97eff20a9058004794595852fe91b1cfc059f2834b2825ede9

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