Aliases
Aliases allows you to shorten and customise enbas commands to make the experience of using enbas more easier and familiar to you.
An alias is a custom command that is mapped to an operation. For example you can create an alias called “my-followers” to get the list of your followers by mapping it to “show followers from account –my-account”.
You can create, edit, rename and delete an alias using the alias target. For more details about the available operations available to the target run the command below:
enbas help --target alias
Your aliases are stored in your configuration file. It is possible to edit your configuration file to create and update aliases but you are encouraged to manage your aliases with enbas as it supports validating your aliases before saving the changes to your configuration file.
Built-in aliases
help
prints the usage documentation
This is an alias for show usage.
login
performs the login process for you to log into your GoToSocial instance
This is an alias for create access.
version
prints the application’s build information
This is an alias for show version.
whoami
prints the name of the account that you are signed into
This is an alias for verify access.
Validation
When creating or renaming an alias, enbas validates the name against the below validation rules before saving the alias to the configuration file.
- The alias name must be a single word with no spaces.
- The name must only contain alpha-numeric characters and hyphens.
- The name must be at least 3 characters long.
- The name must start and end with an alpha-numeric character.
- The name must not be a built-in action word (e.g. create).
- The name must not be a built-in alias.
If you create an invalid alias directly in your configuration file and attempt to use it, enbas will detect it and fail to perform the operation.
You can use the name of an existing target as an alias. For example you can create an alias called “lists” mapped to “show lists”.
Examples
- Create and use an alias to show the list of your aliases.
enbas create alias --name aliases --operation "show aliases" enbas aliases - Create and use an alias called “boost” to boost a status.
enbas create alias --name boost --operation "reblog status --status-id" enbas boost 01AV6D5YIKKEWDTLXTGVTTRW9dCHOLGJ - Create and use an alias called “fave” to like a status.
enbas create alias --name fave --operation "favourite status --status-id" enbas fave 01AV6D5YIKKEWDTLXTGVTTRW9dCHOLGJ - Create and use an alias to make a quick public toot.
enbas create alias --name toot --operation "create status --content-type plain --visibility public --content" enbas toot "Hello, Fediverse 👋"