|
| 1 | +<h1 align="center">@twilio-labs/plugin-assets</h1> |
| 2 | +<p align="center">Plugin for the <a href="https://github.com/twilio/twilio-cli">Twilio CLI</a> to easily upload assets to a <a href="https://www.twilio.com/docs/runtime/assets">Twilio Assets</a> service. Part of the <a href="https://github.com/twilio-labs/serverless-toolkit">Serverless Toolkit</a></p> |
| 3 | +<p align="center"> |
| 4 | +<img alt="npm (scoped)" src="https://img.shields.io/npm/v/@twilio-labs/plugin-assets.svg?style=flat-square"> <img alt="npm" src="https://img.shields.io/npm/dt/@twilio-labs/plugin-assets.svg?style=flat-square"> <img alt="GitHub" src="https://img.shields.io/github/license/twilio-labs/plugin-serverless.svg?style=flat-square"> <a href="https://github.com/twilio-labs/.github/blob/main/CODE_OF_CONDUCT.md"><img alt="Code of Conduct" src="https://img.shields.io/badge/%F0%9F%92%96-Code%20of%20Conduct-blueviolet.svg?style=flat-square"></a> <a href="http://makeapullrequest.com"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" alt="PRs Welcome" /></a> |
| 5 | +<hr> |
| 6 | + |
| 7 | +This plugin adds functionality to the [Twilio CLI](https://github.com/twilio/twilio-cli) to upload and manage assets to a Twilio Assets service. It's a part of the [Serverless Toolkit](https://github.com/twilio-labs/serverless-toolkit) and uses the [Serverless API](https://github.com/twilio-labs/serverless-toolkit/tree/main/packages/serverless-api). |
| 8 | + |
| 9 | +The plugin creates a new Runtime Service which it then uses as a bucket to which it upload assets. You can upload new files or list your available assets. |
| 10 | + |
| 11 | +<!-- toc --> |
| 12 | + |
| 13 | +<!-- tocstop --> |
| 14 | + |
| 15 | +## Requirements |
| 16 | + |
| 17 | +### Install the Twilio CLI |
| 18 | + |
| 19 | +Via `npm` or `yarn`: |
| 20 | + |
| 21 | +```sh-session |
| 22 | +$ npm install -g twilio-cli |
| 23 | +$ yarn global add twilio-cli |
| 24 | +``` |
| 25 | + |
| 26 | +Via `homebrew`: |
| 27 | + |
| 28 | +```sh-session |
| 29 | +$ brew tap twilio/brew && brew install twilio |
| 30 | +``` |
| 31 | + |
| 32 | +## Usage |
| 33 | + |
| 34 | +```sh-session |
| 35 | +$ twilio plugins:install @twilio-labs/plugin-assets |
| 36 | +$ twilio --help assets |
| 37 | +USAGE |
| 38 | + $ twilio assets |
| 39 | +... |
| 40 | +``` |
| 41 | + |
| 42 | +## Commands |
| 43 | + |
| 44 | +<!-- commands --> |
| 45 | +* [`twilio assets:init`](#twilio-assetsinit) |
| 46 | +* [`twilio assets:list`](#twilio-assetslist) |
| 47 | +* [`twilio assets:upload FILE`](#twilio-assetsupload-file) |
| 48 | + |
| 49 | +## `twilio assets:init` |
| 50 | + |
| 51 | +Create a new assets service to use as a bucket |
| 52 | + |
| 53 | +``` |
| 54 | +Create a new assets service to use as a bucket |
| 55 | +
|
| 56 | +USAGE |
| 57 | + $ twilio assets:init |
| 58 | +
|
| 59 | +OPTIONS |
| 60 | + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. |
| 61 | + -o=(columns|json|tsv) [default: columns] Format of command output. |
| 62 | + -p, --profile=profile Shorthand identifier for your profile. |
| 63 | +
|
| 64 | + --properties=properties [default: service_sid, sid, domain_name] The asset service environment properties you |
| 65 | + would like to display (JSON output always shows all properties). |
| 66 | +``` |
| 67 | + |
| 68 | +_See code: [src/commands/assets/init.js](https://github.com/twilio-labs/serverless-toolkit/blob/v0.0.1/src/commands/assets/init.js)_ |
| 69 | + |
| 70 | +## `twilio assets:list` |
| 71 | + |
| 72 | +List all the assets in the service |
| 73 | + |
| 74 | +``` |
| 75 | +List all the assets in the service |
| 76 | +
|
| 77 | +USAGE |
| 78 | + $ twilio assets:list |
| 79 | +
|
| 80 | +OPTIONS |
| 81 | + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. |
| 82 | + -o=(columns|json|tsv) [default: columns] Format of command output. |
| 83 | + -p, --profile=profile Shorthand identifier for your profile. |
| 84 | +
|
| 85 | + --properties=properties [default: sid, path, url, visibility] The asset properties you would like to display |
| 86 | + (JSON output always shows all properties). |
| 87 | +``` |
| 88 | + |
| 89 | +_See code: [src/commands/assets/list.js](https://github.com/twilio-labs/serverless-toolkit/blob/v0.0.1/src/commands/assets/list.js)_ |
| 90 | + |
| 91 | +## `twilio assets:upload FILE` |
| 92 | + |
| 93 | +Upload a new asset to the Assets service |
| 94 | + |
| 95 | +``` |
| 96 | +Upload a new asset to the Assets service |
| 97 | +
|
| 98 | +USAGE |
| 99 | + $ twilio assets:upload FILE |
| 100 | +
|
| 101 | +ARGUMENTS |
| 102 | + FILE The path to the file you want to upload |
| 103 | +
|
| 104 | +OPTIONS |
| 105 | + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. |
| 106 | + -o=(columns|json|tsv) [default: columns] Format of command output. |
| 107 | + -p, --profile=profile Shorthand identifier for your profile. |
| 108 | +
|
| 109 | + --properties=properties [default: sid, path, url, visibility] The asset properties you would like to display |
| 110 | + (JSON output always shows all properties). |
| 111 | +``` |
| 112 | + |
| 113 | +_See code: [src/commands/assets/upload.js](https://github.com/twilio-labs/serverless-toolkit/blob/v0.0.1/src/commands/assets/upload.js)_ |
| 114 | +<!-- commandsstop --> |
| 115 | + |
| 116 | +## Contributing |
| 117 | + |
| 118 | +This project welcomes contributions from the community. Please see the [`CONTRIBUTING.md`](CONTRIBUTING.md) file for more details. |
| 119 | + |
| 120 | +### Code of Conduct |
| 121 | + |
| 122 | +Please be aware that this project has a [Code of Conduct](https://github.com/twilio-labs/.github/blob/main/CODE_OF_CONDUCT.md). The tldr; is to just be excellent to each other ❤️ |
| 123 | + |
| 124 | +## License |
| 125 | + |
| 126 | +MIT |
0 commit comments