https://github.com/marceloboeira/confirm-before
✅ Are you sure? No? Confirm Before - Sanity check for your shell commands
https://github.com/marceloboeira/confirm-before
alias cli confirmation-modal rust wrapper
Last synced: 12 months ago
JSON representation
✅ Are you sure? No? Confirm Before - Sanity check for your shell commands
- Host: GitHub
- URL: https://github.com/marceloboeira/confirm-before
- Owner: marceloboeira
- License: mit
- Created: 2018-02-15T16:04:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-22T10:59:58.000Z (about 7 years ago)
- Last Synced: 2025-02-27T02:42:26.742Z (about 1 year ago)
- Topics: alias, cli, confirmation-modal, rust, wrapper
- Language: Rust
- Homepage:
- Size: 16.6 KB
- Stars: 16
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
No? Confirm Before
Sanity check for your shell commands
## Installing
```
brew tap marceloboeira/formulas
brew install marceloboeira/formulas/confirm-before
```
## Motivation
I have recently started working with a lot of DevOps CLIs that interact with staging and production servers.
My shell setup includes aliases like:
```
alias ks=`kubectl --context staging`
alias kp=`kubectl --context production`
```
However, I frequently find myself almost running something wrong by not paying attention if its production/staging. Therefore, I decided to create this small 'command wrapper' for me to make sure if I really want to run that command against production. e.g.:
```
alias kp=`confirm-before kubectl --context production`
```
Then, ...
```
$ kp apply -F *
Are you sure? (y/n)
```
## Future
I might create other sanity check levels/modes:
```
$ alias dangerous=`confirm-before --math dangerous --production`
$ dangerous get foo
How much is 19 - 3?
```
Conditionals, because it can become very annoying to confirm read-only commands...
```
$ alias dangerous=`confirm-before --matching delete|d|rm|apply dangerous --production`
$ dangerous delete foo
Are you sure? (y/n)
...
$ dangerous get foo -> doesn't match the regexp
```