1.1.0 • Published 2 years ago

@twilio-labs/plugin-alias v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@twilio-labs/plugin-alias

NPM

NPM Version Downloads/week License: MIT Node.js CI build-test

Access, store and use your favorite aliases for CLI commands with this plugin. It supports all the CLIs which are built over OCLIF. Supports OCLIF v1 and v2 both.

Getting Started

Install the Twilio Command Line Interface (Or use with any OCLIF CLI)

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.

For Twilio CLI:

$ twilio plugins:install @twilio-labs/plugin-alias

For Other OCLIF CLI, say oclif-example:

$ oclif-example plugins:install @twilio-labs/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.

For Twilio CLI:

$ twilio plugins:link /path/to/plugin-alias

For Other OCLIF CLI, say oclif-example:

$ oclif-example 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.

For Twilio CLI:

$ twilio alias:setup

For Other OCLIF CLI, say oclif-example:

$ oclif-example alias:setup

Usage

Here we have shown the usage with Twilio CLI. If you are using some other CLI, change "twilio" with your CLI Name, say "oclif-example".

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

Commands

twilio alias:add [NAME] [COMMAND]

Create a new alias to access Twilio CLI commands

USAGE
  $ twilio alias:add [NAME] [COMMAND]

ARGUMENTS
  NAME     alias name to add
  COMMAND  command to be aliased

OPTIONS
  -f, --force  Force overwrite the alias if it already exists

See code: src/commands/alias/add.ts

twilio alias:delete [NAME]

Delete an alias

USAGE
  $ twilio alias:delete [NAME]

ARGUMENTS
  NAME  alias name to delete

See code: src/commands/alias/delete.ts

twilio alias:export [DEST]

Export the aliases

USAGE
  $ twilio alias:export [DEST]

ARGUMENTS
  DEST  path of alias file

See code: src/commands/alias/export.ts

twilio alias:import [DEST]

Import aliases from a file

USAGE
  $ twilio alias:import [DEST]

ARGUMENTS
  DEST  path of alias file

See code: src/commands/alias/import.ts

twilio alias:list

View the aliases

USAGE
  $ twilio alias:list

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

twilio alias:setup

Setup local directory for storing aliases

USAGE
  $ twilio alias:setup

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

twilio alias:use [ALIAS]

Use an alias for a Twilio CLI command

USAGE
  $ twilio alias:use [ALIAS]

ARGUMENTS
  ALIAS  name of the alias to be used

ALIASES
  $ twilio use
  $ twilio :use

See code: src/commands/alias/use.ts

Cleanup

If you want to update or uninstall the plugin, then we recommend that before proceeding towards uninstalling please do the cleanup of local directory by the following command:

$ twilio alias:reset

To update the plugin, you can uninstall the older version and install the new version from npm.

To uninstall the plugin use the command:

For Twilio CLI:

$ twilio plugins:uninstall @twilio-labs/plugin-alias

If you have linked the plugin locally for development, you can unlink it with the command:

For Twilio CLI:

$ twilio plugins:unlink /path/to/plugin-alias

Troubleshooting

If you run into some issue while using the plugin, refer the help section by using the command with the flag --help

  $ twilio [COMMAND] --help

If facing bugs or issues, checkout the Issues to check if this issue already exists. If it does not exists, then create a new one.