https://github.com/peerigon/alium
Save CLI commands as aliases on a directory basis
https://github.com/peerigon/alium
Last synced: 6 months ago
JSON representation
Save CLI commands as aliases on a directory basis
- Host: GitHub
- URL: https://github.com/peerigon/alium
- Owner: peerigon
- License: mit
- Created: 2019-07-26T13:11:19.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-26T06:13:20.000Z (about 2 years ago)
- Last Synced: 2025-09-23T18:56:03.359Z (10 months ago)
- Language: TypeScript
- Size: 532 KB
- Stars: 5
- Watchers: 10
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# alium 🍝
Save CLI commands as aliases on a directory basis!
[](https://circleci.com/gh/peerigon/alium/tree/master)
*Requires node >= 10.x*
## Installation
1. `npm install alium -g` or `yarn global add alium` or similar.
2. put this in your `~/.bashrc` or somewhere suitable:
```sh
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
}
```
3. `source ~/.bashrc` before you try to use `ali`
4. That's it 🎉
## Usage
### Quickstart
```
Options:
-v, --version output the version number
-l, --list List aliases in this directory
-p, --pick Pick from aliases for this directory
-s, --save [alias] Save an alias for this directory
-r, --remove [alias] remove alias from this directory
-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
```sh
# After you have run
$ some-long-winded-command --with parameters --you can --never ./remember
# You can now do
$ ali -s "!!"
# To save a new alias for the aforementioned command
$ ali -s "some-long-winded-command --with parameters --you can --never ./remember"
```
## Licence
MIT
## Sponsors
[
](https://peerigon.com)