Skip to content

Kavya-24/plugin-alias

Repository files navigation

plugin-alias

Quality Gate Status

Access, store and use your favorite twilio aliases with this plugin

Getting Started

Install the Twilio Command Line Interface ( Or any other CLI Tool built over oclif)

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.

Install the plugin for general use

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

Install the plugin for local development

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

Setup the local alias directory

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

Usage

$ twilio --help alias
USAGE
  $ twilio alias
...

Commands

twilio alias:setup

Setup local directory for storing aliases

USAGE
  $ twilio alias:setup

EXAMPLE
  $ twilio alias:setup
  Setup complete

See code: src/commands/alias/setup.js

twilio alias:add

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

twilio alias:delete

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

twilio alias:use

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

twilio alias:list

View the aliases

USAGE
  $ twilio alias:list

EXAMPLE
  $ twilio alias:list
  <Lists all the aliases stored>

See code: src/commands/alias/list.js

twilio alias:import

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

twilio alias:export

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

twilio alias:reset

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

Help

Run the commands with --help

  $ twilio [COMMAND] --help

If facing bugs or issues, checkout Issues and create one