Skip to content

Commit

Permalink
docs: Update README.md
Browse files Browse the repository at this point in the history
Update readme.md with suggestions, use cases of alias:use and help section.
  • Loading branch information
Kavya-24 committed Jul 5, 2022
1 parent 9551d13 commit 60dca4a
Showing 1 changed file with 91 additions and 5 deletions.
96 changes: 91 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @Kavya-24/plugin-alias
# plugin-alias

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Kavya-24_plugin-alias&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Kavya-24_plugin-alias)

Expand All @@ -9,12 +9,13 @@ Access, store and use your favorite twilio aliases with this plugin
- [Getting Started](#getting-started)
- [Usage](#usage)
- [Commands](#commands)
- [Help](#help)

<!-- tocstop -->

## Getting Started

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

Via `npm` or `yarn`:

Expand All @@ -33,20 +34,22 @@ See the [Twilio CLI documentation](https://www.twilio.com/docs/twilio-cli/quicks

### Install the plugin for general use

The following step will install the plugin from [NPM](https://www.npmjs.com/package/@Kavya-24/plugin-alias) and is recommended if you are interested in trying out the [commands](#commands) in the latest release.
The following step will install the plugin from [NPM](https://www.npmjs.com/package/plugin-alias) and is recommended if you are interested in trying out the [commands](#commands) in the latest release.

```sh-session
$ twilio plugins:install @Kavya-24/plugin-alias
$ 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.
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.

```sh-session
$ 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.

Expand All @@ -72,6 +75,7 @@ USAGE
* [`twilio alias:list`](#twilio-aliaslist)
* [`twilio alias:import`](#twilio-aliasimport)
* [`twilio alias:export`](#twilio-aliasexport)
* [`twilio alias:reset`](#twilio-aliasreset)

<!-- Setup Command -->

Expand Down Expand Up @@ -132,8 +136,27 @@ EXAMPLE
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](https://gitshub.com/Kavya-24/plugin-alias/tree/main/src/commands/alias/delete.js)_


<!-- Use Command -->

## `twilio alias:use`
Expand All @@ -155,6 +178,38 @@ EXAMPLE
<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](https://oclif.io/docs/topic_separator). Support present in oclif v2, will be fixed in future releases

_See code: [src/commands/alias/use.js](https://github.com/Kavya-24/plugin-alias/tree/main/src/commands/alias/use.js)_

<!-- List Command -->
Expand Down Expand Up @@ -210,4 +265,35 @@ EXAMPLE
```
_See code: [src/commands/alias/export.js](https://github.com/Kavya-24/plugin-alias/tree/main/src/commands/alias/export.js)_


<!-- Reset Command -->

## `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](https://github.com/Kavya-24/plugin-alias/tree/main/src/commands/alias/reset.js)_


<!-- commandsstop -->



# Help
<!-- help -->

Run the commands with --help
```
$ twilio [COMMAND] --help
```

If facing bugs or issues, checkout [Issues](https://github.com/Kavya-24/plugin-alias/issues) and create one

0 comments on commit 60dca4a

Please sign in to comment.