# Upload assets using the Assets Plugin

The Assets Plugin is a Twilio CLI plugin that is part of the [Serverless Toolkit](/docs/labs/serverless-toolkit). It allows you to create an Assets service that you can use as a bucket for static assets, like images or audio files, that you want to upload. You can then use these assets in your Twilio applications. For example, you can upload audio files that you then [use in a `<Play>` verb during a Twilio Voice call](/docs/voice/twiml/play), or upload [images that you can send to your users via MMS](/docs/messaging/tutorials/how-to-send-sms-messages) or [WhatsApp media messages](/docs/whatsapp/tutorial/send-and-receive-media-messages-twilio-api-whatsapp).

## How to use the Assets Plugin

### Install the Assets Plugin

Before we can get started using the Assets Plugin we need to install it. As the Assets Plugin is a [Twilio CLI](/docs/twilio-cli/quickstart) plugin, you will need to install the Twilio CLI first. If you have already installed the Twilio CLI, carry on, otherwise follow [the instructions for installing the Twilio CLI](/docs/twilio-cli/quickstart).

Once the Twilio CLI is installed you can install the Assets Plugin with the following command:

```bash
twilio plugins:install @twilio-labs/plugin-assets
```

### Initialize the plugin

The Assets Plugin has three commands: `init`, `upload` and `list`. The first thing you should do is run the `init` command. Running `init` will call the Twilio Functions and Assets API to create a new service and store the details about that service so that we can use it with the other commands.

```bash
twilio assets:init
```

The service will be given a random name which will feature in the domain name for the service. If you want to provide your own name, you can pass the `--service-name` flag to the command.

```bash
twilio assets:init --service-name my-cool-assets-service
```

### Upload an asset

With the plugin initialized you can now use it to upload static assets with the `upload` command. Pass the path of the file you want to upload to the command and it will be deployed to your service.

```bash
twilio assets:upload path/to/file
```

If you only want an asset to be accessible by a Twilio request, you can upload it as a [protected asset](/docs/serverless/functions-assets/visibility) when you pass the `--protected` flag.

```bash
twilio assets:upload path/to/file --protected
```

### List your assets

The last command allows you to list the assets you have uploaded to the service. Run it with:

```bash
twilio assets:list
```

Your assets, their SIDs, paths, URLs and visibility will be listed. If you want more, or fewer, properties you can select them by passing the `--properties` flag to the command:

```bash
twilio assets:list --properties sid,url,date_created
```

Or you can output all the properties as JSON:

```bash
twilio assets:list -o json
```

## Let's work together

[The Assets Plugin is open source as part of the Serverless Toolkit](https://github.com/twilio-labs/serverless-toolkit/). If you find any problems with this, please [file an issue](https://github.com/twilio-labs/serverless-toolkit/issues) or even [create a pull request](https://github.com/twilio-labs/serverless-toolkit#-contributing) to work together with us on the toolkit. We would love to hear your ideas and feedback!
