CLI tool for organizing your own scripts on linux
I have long hated managing my custom scripts. I plop them in a bin/ dir, then I forget what scripts I have, what arguments they take, and have to sometimes ls ~/bin/ or even nvim ~/bin/script to see what they do. So I made a tool called clh ( for 'Command Line Helper' ) that organizes all the scripts for me, plus has some handy features. To execute a custom script, you do: clh group/script_name ,…
Managing custom scripts can be a headache. You might place them in a bin/ directory, but it's easy to lose track of what you have and how to use them. To simplify this process, I created a tool called clh, short for Command Line Helper. This tool makes it easier to organize your scripts and provides useful features.
To run a custom script using clh, you would execute it with the command clh group/script_name. However, you have the flexibility to clh bin a script and then call it directly from any location. The tool can be installed from my Gitlab repository.
Here's an overview of some built-in commands that clh offers:
- group: This can be omitted when using the command.
- alias: You can assign an alias for a script or subscript.
- bin: Create a symlink in the `bin/` directory pointing to the target script.
- edit: Create or edit a script.
- globalize: Convert a group into a global callable script.
- help: View help information for a specific command.
- move: Move a clh script from the source to the destination.
- rm: Delete a script (note that this action cannot be undone).
- source: Convert a script to be loaded using the `source` command instead of being executed directly.
For more detailed information on a specific command, you can use the command clh help [group]/[subgroup].
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.