Categorygithub.com/DDaaaaann/kpop-cli
repositorypackage
0.0.0-20241031205524-57c95760e80e
Repository: https://github.com/ddaaaaann/kpop-cli.git
Documentation: pkg.go.dev

# README


Logo

KPOP-CLI

Kill Process on Port

A CLI solution to kill any process on any port!
Installation »

Usage · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Features
  3. Installation
  4. Usage
  5. Example
  6. License
  7. Contributing

About The Project

A command-line tool for killing processes running on a specified port. This tool is useful for developers who encounter errors stating that a port is already in use.

Features

  • Kill a process running on a specified port.
  • Autodetect the port in use from error messages in the terminal.
  • Cross-platform compatibility (Unix and Windows).
  • Includes help command for usage instructions.
  • Man page support for easy reference.
  • Autocompletion for command-line inputs.
  • Search command line history for previously used ports (nice to have).

Installation

Using APT (Debian/Ubuntu)

sudo apt install kpop-cli

Using Homebrew (macOS)

brew install DDaaaaann/kpop-cli/kpop-cli

Using Winget (Windows)

winget install DDaaaaann.kpop-cli

From source

To install the tool from source, clone the repository and build it:

git clone https://github.com/DDaaaaann/kpop-cli.git
cd kpop-cli
go build

Usage

To kill a process on a specified port, run the following command:

kpop [-f] [-q] <port>

Replace with the port number you want to free.

Autodetecting Port

To automatically detect and kill the process on the last used port, just run:

kpop

The autodetect functionality scans previous temrinal output.

Help command

To see usage instructions, run:

kpop -h or kpop --help

Example

To kill a process running on port 8080:

$ kpop 8080
Kill process using port 8080 (PID 12345)? (y/n)
Killed process 12345 on port 8080.

If you run into an "address already in use" error while starting a server, use the autodetect feature:

$ kpop
Kill process using port 8080 (PID 12345)? (y/n)
Killed process 12345 on port 8080.

License

This project is licensed under the GNU General Public License (GPL) v3. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have suggestions or improvements.