0.0.14 • Published 3 years ago

killcommand v0.0.14

Weekly downloads
326
License
MIT
Repository
github
Last release
3 years ago

Kill Command

STILL IN BETA

So...I heard some processes of yours aren't behaving!
I will hunt the ones that cross the line and let you know. And if you want them gone, just trust your friend here.

You can specify the threshold to be alerted when any process crosses the line, or even define a limit which should kill any process that dares crossing it!

You're welcome.

image

image

Also, how to kill any process that is using a given port, you ask? Yeah, just let me know which port you want to free and I take care of that for you.

Install

npm install -g killcommand

Running it

killcommand [command] [--options]

Commands

CommandDescription
startStarts killcommand (Default action if you don't send any command)
stopStops killcommand, if running
topShows a list with the current top processes
killKills a given command by pid, name or port that it's using.See examples bellow
listAlias to --list. Shows a list of running processes matching a pattern

Options

Available options:

Option, AliasDescription
--stopStops the current daemon, if any
--listShows a list of running processes matching a pattern
--help, -hShow this help content
--version, -vShows the current version
--verboseShow log/debugging messages
--alert <Int>If any process passes this <Int>%, the alert is triggeredDefault is 90%
--limit <Int>If any process passes this <Int>%, it is killed on sightDefault is 0% (use 0 todisable this option)
--interval <Int>Interval time (in seconds) for checking top processesDefault is 5
--ignore <Str>A list of programs that are ignored
--alert-ignoredShould show the alert, even for ignored programs when they.cross the line?
--interactiveStarts NOT as a daemon, but interactive in the currentterminal. You can use Ctrl+C to exit.

Examples:

Just start it with default options:

~$ killcommand
~$ # OR
~$ killcommand start

Stop it:

~$ killcommand stop

See top processes and their names:

~$ killcommand top

Start daemon ignoring glimpse and blender processes. Also, will alert if any process reaches 50% of CPU and automatically kill any process that crosses the 80% limit (except the ignored ones):

~$ killcommand --alert=50 --limit=80 --ignore=glimpse --ignore=blender

Ignoring all chrome processes including their renderers

~$ killcommand --ignore="%google%chrome%"

Kills all tabs of brave browser

~$ killcommand kill "%brave%renderer%"

Kills all tabs of brave browser automatically answering yes to any question

~$ killcommand kill "%brave%renderer%" --yes
~$ # OR
~$ killcommand kill "%brave%renderer%" --no-questions-asked

Kills whichever program is listening in port 3000

~$ killcommand kill :3000

Get the name of the process by its PID:

~$ killcommand list 1680

Get the list of processes from "Google Chrome" browser:

~$ killcommand list "chrome"

Get the list of processes from "Google Chrome" browser, but only the renderers (tabs):

~$ killcommand list "chrome%renderer"

Developing

If you want to run it locally while applying changes to it, you can clone the project, then run it like this:

node ./cli.js --interactive --verbose [--other-options]

This way you can see the logs and abort it more easily.

Image credits

Header: Homem vetor criado por freepik - br.freepik.com

Contribute

  • By sending Pull Requests
  • By sending feedback or opening the issues
  • By donating:

Buy us a coffee :)

BTC: 1GuTME1bGbk7hY7ssrUBh3M1k4AeyVCSjW ETH: 0x49f1612d4a8e9165f2eb94be79af9dbbf3815af5

0.0.14

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago