Access, store and use your favorite twilio aliases with this plugin
Via npm
or yarn
:
$ npm install -g twilio-cli
$ yarn global add twilio-cli
Via homebrew
:
$ brew tap twilio/brew && brew install twilio
See the Twilio CLI documentation for more information.
The following step will install the plugin from NPM and is recommended if you are interested in trying out the commands in the latest release.
$ twilio plugins:install plugin-alias
The following step will install the plugin from a local directory. Use this option if you are interested in modifying the plugin and testing it out from the Twilio CLI.
$ twilio plugins:link /path/to/plugin-alias
Prerequisites: Cloned repository locally
The following step will create a directory named "alias" in the local data directory of the user. Use this command before running any other alias command to setup the necessary directory structure.
$ twilio alias:setup
$ twilio --help alias
USAGE
$ twilio alias
...
twilio alias:setup
twilio alias:add
twilio alias:delete
twilio alias:use
twilio alias:list
twilio alias:import
twilio alias:export
twilio alias:reset
Setup local directory for storing aliases
USAGE
$ twilio alias:setup
EXAMPLE
$ twilio alias:setup
Setup complete
See code: src/commands/alias/setup.js
Create a new alias to access Twilio CLI commands
USAGE
$ twilio alias:add [name] [command]
ARGUMENTS
name Name of the alias shorthand
command Command to shorthand
OPTIONS
-f, --force Overwrite already present alias
EXAMPLE
$ twilio alias:add plist profiles:list
Successfully created alias plist for profiles:list
See code: src/commands/alias/add.js
Delete an alias
USAGE
$ twilio alias:delete [name]
ARGUMENTS
name Name of the alias shorthand
EXAMPLE
$ twilio alias:delete plist
Successfully deleted alias plist
USAGE
$ twilio alias:delete [non-existing_alias_name]
ARGUMENTS
name Name of the alias shorthand
EXAMPLE
$ twilio alias:delete pli
Did you mean?
plist
proList
>Continue without deleting
Note: Changes made after v1.1 prompt the user for inquirer when the input (alias_name) does not exist. Uses Jaro-winkler for returning best 3 matches
See code: src/commands/alias/delete.js
Use an alias for a Twilio CLI command
USAGE
$ twilio alias:use [name]
ALIAS
$ twilio use [name]
ARGUMENTS
name Name of the alias shorthand
EXAMPLE
$ twilio alias:use plist
Using the command profiles:list from alias plist
<Output of profiles:list>
USAGE
$ twilio alias:use [non-existing_alias_name]
ARGUMENTS
name Name of the alias shorthand
EXAMPLE
$ twilio alias:use pli
Did you mean?
plist
proList
>Continue without using
Note: Changes made after v1.1 prompt the user for inquirer when the input (alias_name) does not exist. Uses Jaro-winkler for returning best 3 matches
The command alias:use
is inherently statically aliased for further simplicity
EXAMPLE
$ twilio use plist //Works for only CLIs without any topic separators set
<Output>
$ twilio :use plist //Works for all CLIs without any dependency on the topic separators
<Output>
Note: For CLIs built over oclif, the topics can be separated by either ':' or ' '. See More. Support present in oclif v2, will be fixed in future releases
See code: src/commands/alias/use.js
View the aliases
USAGE
$ twilio alias:list
EXAMPLE
$ twilio alias:list
<Lists all the aliases stored>
See code: src/commands/alias/list.js
Import aliases from a file
USAGE
$ twilio alias:import [filepath]
ARGUMENTS
filepath Path of the alias file
EXAMPLE
$ twilio alias:import ./aliasfile.json
Successfully imported aliases from file ./aliasfile.json
See code: src/commands/alias/import.js
Export the aliases
USAGE
$ twilio alias:export
EXAMPLE
$ twilio alias:export
Successfully exported aliases to file ./dataexport.json
See code: src/commands/alias/export.js
Reset the aliases and directory. Used for cleanup. Not visible in --help
USAGE
$ twilio alias:reset
EXAMPLE
$ twilio alias:reset
reset complete
See code: src/commands/alias/reset.js
Run the commands with --help
$ twilio [COMMAND] --help
If facing bugs or issues, checkout Issues and create one