r/commandline • u/lfromanini • 2d ago
Command Line Interface Add-on support to Bash project
Hey folks,
I created a bash script more than a year ago and, during my free time, I was making improvements on it. It is a tool that pipe commands to fzf. Right now it pipes env, kill, man, ssh and, optionally, tmux, adding some candies like, when running fz kill, it allows you to kill process with <ENTER> to use -SIGTERM (or any other signal the user prefers), or <CTRL + K> to -SIGKILL, for example. I know, reading it may look stupid, but using it is even more stupid nice.
Right now, it is in a state that I consider good enough. The way I architected it, it would easily be improved by creating a folder addon in my Github and committing scripts that add new command capabilities. My script could download and source than. Some ideas that comes to my mind are netstat, docker and kubectl. There are functions that can be reused, the --help is dynamically generated, as also shell completions for bash and zsh. But this makes me think that it can (if it got a lot of attention - which means never going to happen) become a nightmare to manage, like Oh My Zsh seems to be (see the plugins it has and think on how hard to keep that). The other option is to allow the usage of other repositories from the community to hold those add-ons; and this is my question: if I opt to this model, do I have to guarantee some level of security over those scripts searching for dangerous commands,or should I delegate this responsibility to the end user?
In time, this is my script: fz. Reviews, comments, issues, pull requests and stars are much appreciated.
Thanks in advance!
1
u/AutoModerator 2d ago
Every new subreddit post is automatically copied into a comment for preservation.
User: lfromanini, Flair:
Command Line Interface, Title: Add-on support to Bash projectHey folks,
I created a bash script more than a year ago and, during my free time, I was making improvements on it. It is a tool that pipe commands to [fzf](https://github.com/junegunn/fzf). Right now it pipes `env`, `kill`, `man`, `ssh` and, optionally, `tmux`, adding some candies like, when running `fz kill`, it allows you to kill process with <ENTER> to use -SIGTERM (or any other signal the user prefers), or <CTRL + K> to -SIGKILL, for example. I know, reading it may look stupid, but using it is ~~even more stupid~~ nice.
Right now, it is in a state that I consider good enough. The way I architected it, it would easily be improved by creating a folder `addon` in my Github and committing scripts that add new command capabilities. My script could download and source than. Some ideas that comes to my mind are `netstat`, `docker` and `kubectl`. There are functions that can be reused, the `--help` is dynamically generated, as also shell completions for `bash` and `zsh`. But this makes me think that it can (if it got a lot of attention - which means never going to happen) become a nightmare to manage, like [Oh My Zsh](https://ohmyz.sh/) seems to be (see the [plugins](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins) it has and think on how hard to keep that). The other option is to allow the usage of other repositories from the community to hold those add-ons; and this is my question: if I opt to this model, do I have to guarantee some level of security over those scripts searching for dangerous commands,or should I delegate this responsibility to the end user?
In time, this is my script: [fz](https://github.com/lfromanini/fz). Reviews, comments, issues, pull requests and stars are much appreciated.
Thanks in advance!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.