shellfirm
rm -rf *git reset --hardbefore saving?kubectl delete nswhich going to delete all resources under this namespace?- And more!
Do you want to learn from people that made those mistakes??
shellfirm will intercept any risky patterns (default or defined by you) and prompt you a small challenge for double verification, kinda like a captcha for your terminal.
#######################
# RISKY COMMAND FOUND #
#######################
)
How it works?
shellfirm evaluate all shell command behind the scene.
If a risky pattern is detected, you will get a prompt with a warning and double verification will requests.
Example

Installation
- Install via brew
&&
- Download zsh plugin:
- Finally, add the
shellfirmas the plugin in your .zshrc file as:
plugins=(... shellfirm)
Risky command:
| Group | Path | Enable By Default |
|---|---|---|
base |
base.yaml | true |
git |
git.yaml | true |
fs |
fs.yaml | true |
kubernetes |
kubernetes.yaml | false shellfirm config update --check-group kubernetes |
After installing shellfirm tool the config stored in the path: ~/.shellfirm/config.yaml
You can always manage your out risky command:
Checks examples:
challenge: Math # Math, Enter, Yes
includes:
- base
- fs
- git
checks:
- is: git reset
method: Contains
enable: true
description: "This command going to reset all your local changes."
from: git
- is: "rm.+(-r|-f|-rf|-fr)*"
method: Regex
enable: true
description: "You are going to delete everything in the path."
from: fs
- is: ">.+/dev/sda"
method: Regex
enable: true
description: "Writing the data directly to the hard disk drive and damaging your file system."
from: fs
- is: "mv+.*/dev/null"
method: Regex
enable: true
description: "The files will be discarded and destroyed."
from: fs
:information_source: to define custom check (that not include int the shillfirm check) add new check to config.yaml file with from: custom.
- is: "special check"
method: Regex
enable: true
description: "Example of custom check."
from: custom
Add new group checks:
Remove new group checks:
Disable specific check
Edit configuration file in ~/.shellfirm/config.yaml and change the check to enable:false.
Change challenge
currently we supporting 3 different challenges when a command is detected:
Math- Default challenge which requires you to solve a math question.Enter- Requite onlyEnterto continue.Yes- Requiteyesto continue.
You can change the default challenge by running the command:
At any time you can exit with the challenge by ^C
Updates
- Update
shellfirm:
Contributing
See the contributing directory for more developer documentation.