A simple alias manager
Aliax is a simple command line tool for creating permanent aliases to make your life easier.
Aliax creates and organises aliases in a structured way by saving each alias into a ‘group’.
Since this is a command line tool, it is recommended that you install it globally.
npm install -g aliax
In order for your shell to read the aliases which Aliax creates, some setup must be done.
To do this, simply run aliax setup
. You will be prompted to give the shell
which you make use of. This is because different shells make use of different script
on start up. Currently, the following shells are supported by Aliax:
To select your shell at the start of the script, use the following command:aliax setup --shell <shell>
where <shell>
is replaced by the name of your shell.
Running aliax setup
will do the following:
The setup command can also be used if you have changed shells as it will not override
any existing alias groups saved in the .aliases folder.
To begin creating a new alias, use the command aliax new
. The script will then
begin prompting you for the information needed to create the alias. The prompts
which you will be required to fill out are the following:
Once all this information is captured, the new alias will be created in the alias
group’s file.
You will have to create a new shell session, inorder for new aliases to become active.
This is because Aliax links aliases to your shells rc file which only get executed
on start up.
The first option which you will be prompted to give is the alias group. Alias
groups is how Aliax attempts to keep all aliases organised. A group represents the
file which is stored in .aliases
folder.
If an alias group is used for the first time, then that groups file gets created
and linked in the aliases.symlink
file.
The alias name which you provide will the new command given to your alias. This
name must be a single string, make up of characters, letters, and underscores.
Typing in this name in future shell sessions will execute the command which you
link to this alias.
The command type is a way of providing short-cuts to creating common aliases.
Currently the only short-cut available is the Change Directory command. If you
want to create an alias for a command which is not in the short-cut list, then
simply select Custom
and type in your own command.
Choosing this command type will create an cd
alias to change the current
working directory to the directory where this alias was made.
For example, if the user was in their Documents
directory and created the aliasdocs
, Aliax would make an alias for the following command: cd /Users/username/Documents
Choosing the custom command type will activate another prompt, in which you can type
any shell command. Aliax will then create an alias for this command, using the name
provided.
For example, if the you create a custom alias named g
and wrote the commandgit
when prompted, the command g
can be used as a short hand for git in future
shell sessions.
If you want to delete an alias, all you need to do is go the group file, in the.aliases
folder, and remove the line where it is defined. Then just start a new
shell session, and the alias will be gone for good.