1.1.2 • Published 2 years ago
custom-cli-commands v1.1.2
Custom CLI Commands
Installation:
npm i -g custom-cli-commands
Create custom CLI commands by globally aliasing shell scripts collected in a single location.
cli -d edit # Open the scripts directory.
cli -d code # You can also open it in vscode.
# Write your script in a shell file in this directory.
cli -d new my-alias my-script-file.sh # Link an alias to the shell file.
cli my-alias # Use your alias to run the script from any location.
Note: if your script accesses other files in the scripts directory, you'll need to ensure that it references these files using the correct base directory.
BASEDIR=$(dirname $0)
node $BASEDIR/other-file.js