@nexssp/command
15.01.2022 Upgrade - Now works also with import
as module.
Easy repetable shell commands... just to save time.. for mulitpleOSes
See examples below..
Note
This Nexss Programmer's plugin is the effect of the refactoring the Nexss Programmer @nexssp/cli which development has been started in 2018. Now this module can be also used as separate program without the Nexss Programmer.
You can do very easy backup of your commands and share as files are *.yml format.
Example
nexssp-command add npmup "npm version patch && git push && npm publish"
nexssp-command add npmup "npm version patch && git push && npm publish" -g
nexssp-command add npmup "npm version patch && git push && npm publish" --plaform=linux -g
nexssp-command npmup
nexssp-command npmup -g
nexssp-command list
nexssp-command list
nexssp-command delete npmup
nexssp-command delete npmup -g
Install
npm i -g @nexssp/command
Now you can use nexssp-command
.
Usage
Let say you wrote some big command and you do it everyday,.. just very often
echo 'myexample command which is long and repeatable' && ls && mkdir abc && cd abc && ls && echo 'this can be loooooong..'
Add Commands
nexssp-command add nameOfCommand "echo 'myexample command which is long and repeatable' && ls && mkdir abc && cd abc && ls && echo 'this can be loooooong..'"
Run Command
nexssp-command nameOfCommand
nexss cmd nameOfCommand
List Commands
This is OS dependent. Please see advanced example below. You can specify different commands for different OSes. @nexssp/commands also recognize the different distros..
nexssp-command list
nexss cmd list
Delete commands
nexssp-command delete
nexss cmd delete
There is much more..
More advanced example
As you can see below you can specify different commands OS and even distro name and version dependent,
name: Advanced Example of @nexssp/commands
commands:
win32:
- name: init
command: scoop install xpdf-tools
linux:
- name: init
command-ALPINE3: apt-get -y install poppler-utils
command-ARCH: pacman -S --noconfirm xpdf
command-UBUNTU: apt install xpdf
command-UBUNTU18: apt install xpdfA
command-UBUNTU20: apt install xpdfB
command: apt-get -y install xpdf
darwin:
- name: init
command: brew install xpdf
Where commands are stored?
There are 2 kinds of commands. Global and local.
Global commands
Global commands are stored in your home directory. ~/.nexss/_nexss_global.yml
on Linux and C:\Users\USER\.nexss\_nexss_global.yml
.
Local commands
Local are stored in the current folder or the first parent folder which contains _nexss.yml
file
You can specify custom global file by --global=myfilename