A smart process killer CLI tool. Find and terminate processes by port, name, PID, or user with interactive selection, glob patterns, and graceful shutdown support.
curl -sSfL https://raw.githubusercontent.com/aiomayo/hdf/main/install.sh | shTo install system-wide:
curl -sSfL https://raw.githubusercontent.com/aiomayo/hdf/main/install.sh | sudo sh -s -- -b /usr/local/binTo install a specific version:
curl -sSfL https://raw.githubusercontent.com/aiomayo/hdf/main/install.sh | sh -s -- v0.0.1irm https://raw.githubusercontent.com/aiomayo/hdf/main/install.ps1 | iexgo install github.com/aiomayo/hdf@latestDownload pre-built binaries for Linux, macOS, and Windows from the releases page.
git clone https://github.com/aiomayo/hdf.git
cd hdf
go build -o hdf .# Kill process by port
hdf --port 8080
# Kill process by name (supports glob patterns)
hdf --name "node*"
# Kill process by PID
hdf --pid 1234
# Kill process by user
hdf --user root
# Dry run — preview without killing
hdf --port 8080 --dry-run
# Force kill
hdf --port 8080 --forcehdf uses a TOML config file that is auto-created with defaults on first run.
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/hdf/config.toml |
| Linux | ~/.config/hdf/config.toml |
| Windows | %LOCALAPPDATA%\hdf\config.toml |
The path follows the XDG Base Directory Specification. Set XDG_CONFIG_HOME to override.
All config options can be overridden with environment variables using the HDF_ prefix:
HDF_DEFAULT_FORCE=true hdf 8080
HDF_DEFAULT_VERBOSE=true hdf nodeProcesses matching these names are skipped during kill operations. Comparison is case-insensitive.
protected = ['init', 'systemd', 'launchd', 'kernel_task', 'WindowServer', 'loginwindow', 'sshd']Map short names to longer queries. Aliases are resolved before query classification, so they work with ports, names, and patterns.
[aliases]
db = "postgres"
web = "nginx"
dev = "3000"Usage:
hdf db # equivalent to: hdf postgres
hdf web # equivalent to: hdf nginx
hdf dev # equivalent to: hdf 3000Default timeout for --graceful mode before escalating to SIGKILL.
graceful_timeout = '5s'When true, hdf uses SIGKILL by default (equivalent to always passing --force).
default_force = falseWhen true, hdf runs in verbose mode by default (equivalent to always passing --verbose).
default_verbose = falseThe auto-generated config file looks like this:
default_force = false
default_verbose = false
graceful_timeout = '5s'
protected = ['init', 'systemd', 'launchd', 'kernel_task', 'WindowServer', 'loginwindow', 'sshd']
[aliases]