alium 🍝
Save CLI commands as aliases on a directory basis!
Installation
-
npm install alium -g
or yarn global add alium
or similar.
-
put this in your ~/.bashrc
or somewhere suitable
ali () {
ali-cleanup () {
sleep 1 && test -f ~/.alium/cmd && rm -f ~/.alium/cmd;
}
alium-bin $@;
if [ $? -eq 23 ]; then
ali-cleanup & test -f ~/.alium/cmd && source ~/.alium/cmd
fi
}
-
source ~/.bashrc
before you try to use ali
-
That's it 🎉
Usage
Quickstart
Options:
-v, --version output the version number
-l, --list List aliases
-s, --save [alias] Save an alias
-r, --remove [alias] remove alias
-h, --help output usage information
To add a new command to the current directory: ali -s "my-command"
Note: env variables have to be escaped: ali -s "echo \$SHELL"
ali
will then ask you what to name the new alias.
List all available aliases: ali -l
or just ali
.
Remove alias: ali -r foobar
Typical usage
$ some-long-winded-command --with parameters --you can --never ./remember
$ ali -s "!!"
$ ali -s "some-long-winded-command --with parameters --you can --never ./remember"