process-killer-cli
v1.0.8
Published
A utility to safely find and kill processes using specific ports on Linux/macOS. Perfect for backend developers dealing with port conflicts.
Maintainers
Readme
Process Killer CLI ⚡
A fast, cross-platform utility to safely kill processes using specific ports on Windows, macOS, and Linux.
🎯 Features
✨ Cross-Platform - Works on Windows, macOS, and Linux
🎯 Interactive Menu - Easy OS selection (no need to memorize commands)
🛡️ Safe - Always asks for confirmation before killing processes
⚙️ Zero Dependencies - Uses only Node.js built-in modules
🚀 Fast - Kills ports instantly
🎨 Beautiful UI - Colorized output with Unicode borders
📊 Developer Info - Shows package info on success
📦 Installation
npm install -g process-killer-cliThe -g flag installs globally, making the command available everywhere.
🚀 Quick Start
process-killerThen follow the prompts:
- Select OS - Choose your operating system (1=Windows, 2=macOS, 3=Linux)
- Enter Port - Type the port number (e.g., 3001, 8080, 5000)
- Confirm - Review the process info and confirm
- Done! - Port is freed and ready to use
💡 Common Use Cases
Kill Node.js Server
$ process-killer
Select your Operating System:
1) Windows
2) macOS
3) Linux
Enter your choice (1, 2, or 3): 2
✓ macOS selected
Enter the port number you want to stop (e.g., 8087): 3000
➜ Searching for processes using port 3000...
Found process with PID: 12345 using port 3000
Process Name: node
Port: 3000
PID: 12345
Do you want to kill this process? (y/n): y
✓ Port 3000 has been killed!
You can now start your backend server on this port.
Kill Java Application (Port 8080)
$ process-killer
...
Enter the port number you want to stop: 8080
✓ Port 8080 has been killed!Kill Python Flask (Port 5000)
$ process-killer
...
Enter the port number you want to stop: 5000
✓ Port 5000 has been killed!🖥️ Supported Operating Systems
| OS | Status | Notes |
| ----------- | ------------------ | -------------------------------------- |
| Windows | ✅ Fully Supported | Uses netstat, tasklist, taskkill |
| macOS | ✅ Fully Supported | Uses lsof, ps, fuser |
| Linux | ✅ Fully Supported | Uses lsof, ps, fuser |
📋 Requirements
- Node.js >= 12.0.0
- npm or yarn
🔧 How It Works
Windows
- Uses
netstat -anoto find process by port - Uses
tasklistto get process name - Uses
taskkill /PID X /Fto terminate process
macOS & Linux
- Uses
lsof -ti:PORTto find process by port - Uses
psto get process name - Uses
fuser -k PORT/tcpto terminate process
⚠️ Troubleshooting
Port Still Shows as In Use
Some ports enter TIME_WAIT state. Wait 30-60 seconds and try again.
Permission Denied (macOS/Linux)
The tool may need elevated privileges:
sudo process-killerProcess Not Found
Verify the port number is correct using:
Windows:
netstat -ano | findstr :3000macOS/Linux:
lsof -i :3000Command Not Found
Make sure you installed it globally with the -g flag:
npm install -g process-killer-cli🗑️ Uninstall
npm uninstall -g process-killer-cli📚 Advanced Usage
Manual Port Killing (Without Tool)
Windows:
netstat -ano | findstr :3000
taskkill /PID 12345 /FmacOS/Linux:
lsof -i :3000
sudo kill -9 12345
# OR
sudo fuser -k 3000/tcp🔄 Update to Latest Version
npm install -g process-killer-cli@latest📝 What's New in v1.0.8
- ✨ Fixed installation documentation
- 🎨 Beautiful colorized UI with Unicode borders
- 🌍 Cross-platform support (Windows, macOS, Linux)
- 📋 Interactive OS selection menu
- 🎯 Safe operation with confirmation
- 📊 Developer information display
- ⚡ Zero external dependencies
🤝 Contributing
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
📄 License
MIT © Milon Mia
This project is open source and available under the MIT License.
👨💻 Author
Milon Mia
- GitHub: @devmilon923
- npm: process-killer-cli
- Email: [email protected]
🙏 Support
If you found this tool helpful, please:
- ⭐ Star on GitHub
- 📢 Share with friends
- 🐛 Report issues
- 💡 Suggest improvements
FAQ
Q: Is it safe to use?
A: Yes! The tool always asks for confirmation before killing any process.
Q: Can I use this on Windows?
A: Yes! Full native Windows support without WSL.
Q: Do I need to remember commands?
A: No! Interactive menu guides you through every step.
Q: What if I kill the wrong process?
A: The tool shows process details before killing, so you can verify.
Q: Can I use this in scripts?
A: This tool is interactive. For automation, use OS-specific commands directly.
Q: Why do I need the -g flag?
A: The -g flag installs the tool globally so you can use the process-killer command from any folder on your computer.
🎓 Learn More
📞 Feedback
Have questions or suggestions? Open an issue on GitHub: GitHub Issues
Made with ❤️ for Developers
Happy coding! 🚀
