Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation improvements #92

Merged
merged 1 commit into from
Aug 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,9 @@
[![npm version](https://badge.fury.io/js/twilio-cli.svg)](https://badge.fury.io/js/twilio-cli)
[![Travis Build Status](https://travis-ci.com/twilio/twilio-cli.svg?token=8pBrDtYneMQqFq8wVpYP&branch=master)](https://travis-ci.com/twilio/twilio-cli)[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/48hf89rslhjhn7ca?svg=true)](https://ci.appveyor.com/project/TwilioAPI/twilio-cli)[![codecov](https://codecov.io/gh/twilio/twilio-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/twilio/twilio-cli)

## Prerequisites

1. [Node.js](https://nodejs.org/) >= 8.0
1. Running on Linux? Depending on your distribution, you will need to run the following command: <br>
**Debian/Ubuntu**: `sudo apt-get install libsecret-1-dev` <br>
**Red Hat-based**: `sudo yum install libsecret-devel` <br>
**Arch Linux**: `sudo pacman -S libsecret`

Eventually, the plan is to have self-contained packages for \*nix systems and an installer for Windows with no need for manually installing prerequisites.

## Setup

Head over to the [twilio-cli documentation](https://www.twilio.com/docs/twilio-cli/quickstart).
Head over to the [Twilio CLI documentation](https://www.twilio.com/docs/twilio-cli/quickstart).

## Versioning

Expand All @@ -29,6 +19,10 @@ See the [General usage guide](https://www.twilio.com/docs/twilio-cli/general-usa

Review the [Examples](https://www.twilio.com/docs/twilio-cli/examples).

## Plugins

You can review the docs on [available plugins and how to install them](https://www.twilio.com/docs/twilio-cli/plugins). If you are interested in writing your own plugin, refer to the [plugin authoring docs](docs/plugins.md).

## Contributing

1. Clone [this repo](https://github.com/twilio/twilio-cli).
Expand Down
40 changes: 4 additions & 36 deletions docs/general_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ twilio phone-numbers:update [PN sid or E.164] --sms-url http://url

That sets the primary SMS url. There are also options for setting the voice url, fallback urls, and methods for each. Run `twilio phone-numbers:update --help` for a full list of options.

### Ngrok integration
### Proxying your localhost

When you set a webhook, if you specify a URL that uses the host name of `localhost` or `127.0.0.1`, the twilio-cli will automatically create an ngrok tunnel for you and set your webhook to the new ngrok URL. For example:
When you set a webhook, if you specify a URL that uses the host name of `localhost` or `127.0.0.1`, the twilio-cli will automatically create a public proxy for you and set your webhook to the new proxy URL. For example:

```
twilio phone-numbers:update [PN sid or E.164] --sms-url http://localhost:5000/handle_sms
```

Please be aware that this will temporarily expose your computer to the internet. You should exit this command when you have completed testing.

### Output formats

All command output is sent to `stdout` (whereas [logging messages](#logging-messages) are sent to `stderr`).
Expand Down Expand Up @@ -110,37 +112,3 @@ ps -aux | twilio email:send \
--subject="Current processes" \
--text="See attachment"
```

## Plugins

twilio-cli can be extended via plugins.

At this time, the following plugins exist:

* [twilio serverless plugin](https://github.com/twilio-labs/plugin-serverless): To streamline your Twilio Functions development workflow, [Twilio Labs](https://github.com/twilio-labs/) created `twilio-run`. You can use twilio-run from within twilio-cli via [plugin-serverless](https://github.com/twilio-labs/plugin-serverless).

* [twilio watch plugin](https://github.com/twilio-labs/plugin-watch): Allows you to watch your live debugger alerts, voice calls, and messages as they come in, in real-time.

* [twilio token plug](https://github.com/twilio-labs/plugin-token): Install and use this plugin to generate a token for use in a client-side SDK, e.g., a chat application.

### Install a plugin

Plugins for the CLI can be installed using the `twilio plugins` command.

1. Install the plugin by it's package name:

```
twilio plugins:install @twilio/plugin-debugger
```

1. Now, you can run your plugin command from the cli:

```
twilio debugger:logs:list --help
```

1. Note: if you're using [autocomplete](#autocomplete), you'll need to run `twilio autocomplete` after installing a plugin and open a new terminal window. The cli needs to re-build it's cache.

### Create a plugin

Want to write your own plugin? [See this document](https://github.com/twilio/twilio-cli/blob/master/docs/plugins.md).
6 changes: 6 additions & 0 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,9 @@ twilio my-new-topic:my-new-command --help
```
npm install keytar --save-dev
```

## 5. Publish your plugin to NPM

Once you have your plugin working, publish it to npmjs.org as a JavaScript package using `npm publish`. The `twilio plugins:install <npm package name>` command will download your package from NPM.

If you want to keep your package private, then you can run `npm pack` to create a tarball and distribute that file. Running `twilio plugins:install <package.tar.gz>` will install the plugin from the file instead of looking on NPM.