portKill is a Windows 11 portable port viewer and process terminator.
It is intentionally small: the GUI shows who owns local TCP/UDP ports, and the CLI provides the same core workflow for terminal use. It does not run in the background, does not modify firewall rules, does not write to the registry, and never terminates a process automatically.
Chinese documentation: README.zh.md
- View local TCP and UDP endpoints.
- Show protocol, local address, local port, remote address, remote port, TCP state, PID, process name, and process path.
- Search by port, PID, process name, address, state, or path.
- Filter by protocol, IP version, and TCP state.
- Default GUI view focuses on TCP
LISTENINGrows and UDP rows; established TCP connections can be shown with the details toggle. - End a process only after manual confirmation.
- Protect PID
0, PID4, and the runningportKillprocess from termination. - Portable package with
portKill.exe,portKill-cli.exe, andREADME.txt.
The application uses a minimal Tauri shell with vanilla HTML, CSS, and JavaScript. The system layer is Rust and Windows API calls. The code does not parse netstat output.
The main APIs used are GetExtendedTcpTable, GetExtendedUdpTable, OpenProcess, QueryFullProcessImageNameW, and TerminateProcess.
.
├── README.md
├── README.zh.md
├── scripts/
│ ├── build-portable.ps1
│ └── generate-icon.ps1
├── src-tauri/
│ ├── Cargo.toml
│ ├── tauri.conf.json
│ ├── icons/
│ └── src/
│ ├── lib.rs
│ ├── main.rs
│ └── bin/portKill-cli.rs
└── ui/
├── index.html
├── style.css
└── app.js
Use the portable package under dist\portKill-portable after building:
dist\portKill-portable\portKill.exe
dist\portKill-portable\portKill-cli.exe
The final zip is:
dist\portKill-windows-x64-portable.zip
List ports:
.\portKill-cli.exe listList only listener-style rows, which means TCP LISTENING and UDP:
.\portKill-cli.exe list --listeners-onlyFilter by protocol, TCP state, or text:
.\portKill-cli.exe list --protocol tcp --state LISTENING
.\portKill-cli.exe list --query nginxFind a local port:
.\portKill-cli.exe find --port 3000
.\portKill-cli.exe find --port 3000 --jsonEnd a process:
.\portKill-cli.exe kill --pid 12345
.\portKill-cli.exe kill --port 3000Without --yes, the CLI asks for confirmation. To skip the prompt:
.\portKill-cli.exe kill --pid 12345 --yes
.\portKill-cli.exe kill --port 3000 --yesRequirements:
- Windows 11 x64.
- Rust MSVC toolchain.
- Visual Studio Build Tools or Visual Studio with
vcvars64.bat. - Windows SDK.
- WebView2 runtime, included with Windows 11.
Run tests:
cd D:\cache\portKill\src-tauri
cargo testBuild the CLI:
cargo build --release --bin portKill-cliBuild the GUI exe directly:
cargo build --release --bin portKillIf cargo-tauri is installed, the portable build script uses cargo tauri build --no-bundle. If it is not installed, the script falls back to cargo build --release --bin portKill, which still produces the portable GUI executable.
From the repository root:
powershell -ExecutionPolicy Bypass -File .\scripts\build-portable.ps1The script:
- Generates the local icon.
- Loads the Visual Studio x64 build environment.
- Runs
cargo test. - Builds
portKill-cli.exe. - Builds
portKill.exe. - Copies release files to
dist\portKill-portable. - Creates
dist\portKill-windows-x64-portable.zip.
portKill ends processes, not ports. A port is owned by a process, so the GUI and CLI both use the wording "end process" instead of "kill port".
The tool refuses to terminate PID 0, PID 4, and its own process. Other protected or elevated processes may also fail with a Windows permission error, which is shown to the user.
The current implementation has been verified with:
cargo test
cargo build --release --bin portKill-cli
cargo build --release --bin portKillThe test suite covers port byte order conversion, TCP state mapping, IPv4/IPv6 formatting, filter behavior, protected PID behavior, temporary TCP/UDP socket discovery, and termination of a test child process.