CLI Reference for Aliases
AIS CLI supports user-defined aliases, similar to the Unix alias command. Defining your own alias for an existing command can make the AIS CLI more intuitive and efficient to use.
Auto-complete options also hold for the alias you create!
The current set of default aliases (which you may also redefine or remove at any time) includes:
Table of Contents
Create an Alias
ais alias set ALIAS AIS_COMMAND
Create an alias “ALIAS” for existing AIS_COMMAND.
Note: ALIAS must be a single word, or multiple words connected with - (hyphen) or _ (underscore). The arguments following ALIAS constitute the full ais command.
The ais command can be put inside quotes for readability.
For example, ais alias set show-clu show cluster and ais alias set show-clu "show cluster" create the same alias for show cluster.
Examples
Remove Alias
ais alias rm ALIAS
Removes existing alias “ALIAS”.
Examples
List Aliases
ais alias show or ais alias
List all created aliases.
ais alias with no arguments lists all previously added aliases — the same behavior you expect from Unix shell alias.
Note that aliases are also shown in the app-level help message (ais -h).
Examples
List aliases
View aliases from app-level help
Reset Aliases
ais alias reset
Clear all created aliases, and only keep the defaults.
Example
Alias Configuration File
As with other CLI configurations, aliases are stored in the CLI config file.
All aliases are stored under "aliases" as a map of strings (ALIAS to AIS_COMMAND).
Users can manually add aliases to the config file, but all commands must follow the rules for creating an alias. E.g., aliases:
are ignored because the name of the first one is not a single (or hyphenated ) word, while the AIS command of the second one does not exist.