Managing applications with the Vonage CLI
The Vonage CLI allows you to create and manage your Vonage applications. To obtain help type vonage once the CLI has been installed.
Installation
The CLI can be installed with the following command:
The core CLI includes everything to support Application API V2 on the command line. You can check your installed version with the command:
For additional help on any feature in the CLI, you can use the help flag:
Setting your configuration
Before you can start working with your apps, you will need to set your configuration (API Key and API Secret). This can be done using the config:set command:
Your API Key and API Secret can be obtained via the Dashboard. Once set, you can check your config by running vonage config.
Listing your applications
To list your current applications use:
This displays a list showing the application ID, name and capabilities.
Show application details
To show the details of a specific application (where the APP_ID is the application ID of an application that already exists):
Returns something like:
Creating an application
Interactive mode
First create a new directory for your application and change into it. You can then create an application in interactive mode using the command:
This will present a series of prompts, requesting the necessary information to create your application. Sensible defaults are provided at each prompt.
Script mode
In any environment where the Vonage CLI is installed, you can also use it in a script. The only required argument is the application name.
This creates the vonage_app.json file in your project directory containing the Application ID, Application name and private key. This also creates a second file with the private key named app_name.key.
Note that the webhook URLs you are required to set depends on the capabilities you want to use in your application. This is explained in more detail in the application webhooks topic.
Creating an application with your own public/private key pair
You can create an application with your own public key if you have a suitable public/private key pair already.
First you need a suitable public/private key pair. To create one, first enter:
Press enter (twice) to not use a passphrase. This generates your private key, private.key.
Then enter the following:
This generates public.key.pub. This is the public key you use in creating or updating your Vonage application:
Updating an application
You can patch/update a previously created application with a command similar to:
You can change the application name, modify any of the webhooks, or add new capabilities. If you don't provide the APP_ID argument, it will use interactive mode.
Deleting an application
You can delete an application with the following command:
When providing the APP_ID argument, it is assumed that you understand you are deleting and there is no confirmation.
Interactive Mode
The CLI also provides an interactive method of deletion, which allows for singular or multiple app deletion:
You will need to confirm this action.
NOTE: Deletion cannot be reversed.