The Alias fiend a-fiend
manages shell aliases for you and prints reminders for recently added aliases.
Install using go get github.com/hugowetterberg/a-fiend
(or download the latest binary release) and add this to your shell profile:
[[ -s "${HOME}/.a-fiend/source.sh" ]] && source $HOME/.a-fiend/source.sh
The fiend will keep this file up to date when you add and remove aliases.
Add aliases like so:
▶ a-fiend add aliasname 'echo Dir is `realpath .`'
Successfully saved the alias aliasname="echo Dir is `realpath .`"
List your current aliases:
▶ a-fiend list
alias aliasname='echo Dir is `realpath .`'
Start a new shell to load the added aliases (or live reload using a-fiend list | source /dev/stdin
):
Last login: Wed Oct 28 11:08:41 on ttys003
alias aliasname=echo Dir is `realpath .`
~
▶ aliasname
Dir is /Users/hugo
Delete an alias:
▶ a-fiend delete aliasname
Successfully deleted the alias "aliasname"
Change the reminder duration (the default is 168h)
▶ a-fiend source -reminders 48h
Add an alias for reloading aliases, like so:
▶ a-fiend add alias-reload 'a-fiend list | source /dev/stdin'
This allows you to easily start using aliases without starting a new session or re-sourcing everything.
If the reminders just annoy you you can either run a-fiend source -reminders 0h
or change the entry in your profile to a-fiend list | source /dev/stdin
to just include the aliases as-is.