Managing applications with the Vonage CLI

The Vonage CLI allows you to create and manage your Vonage applications. To obtain help type vonage apps --help once the CLI has been installed. Like most of the vonage commands, you are able to use the --json and --yaml flags to have the output be in those formats.

Listing your applications

By default, when you run vonage apps it will run the same sub-command as vonage apps list. There are a number of flags you can pass to refine your search:

  • app-name - Allows filtering by application name
  • capability - Filter application by capability. Use a comma , to mean the app has either or and a plus + to mean the application must have both

Show application details

The show sub command, allows you to get the details of a specific application. The format of the command is vonage apps show <id> where <id> is the UUID of the application.

Note: This will not display the public key. If you need to view the public key, you can use the --json or --yaml flags which will not redact any information

Creating an application

The create subcommand allows you to create an application. Previous versions of the CLI allowed you to also set the application capabilities, however, that has been removed with version 3 of the CLI - the reasons why are explained below. You are now required to pass in an application name as the CLI will no longer generate one for you. vonage apps create <name> now has the following parameters/flags:

  • public-key-file - A link to the public key file you wish to use with the application.
  • private-key-file - The full path on where you want to save the generated private key (cannot be used with public-key-file).
  • improve-ai - Allow vonage to use this application data to train AI models.

Note: If you do not supply your own key, Vonage will create one for you. However, if you do not save the key when the application is created, you will not be able to access it again. You will have to regenerate the key if you lose it.

Updating an application

After you create an application, you can update the name, Improve AI, or set a new public key. vonage apps update <id> have the same flags as vonage apps create except for private-key-file.

Deleting an application

You can delete an application with the command vonage apps delete <id>, where id is the UUID of the application:

Managing capabilities for an application

In previous versions of the CLI, it required you to pass in all values when you wanted to modify a capability for an application. This meant that you had to remember what the current values were, and if you did not include a flag or entered an incorrect value, the capability would not function as expected. Version 3 of the CLI solves this by having a new sub command to manage application capabilities. The command format is as follows: vonage apps capabilities <action> <id> <which> [flags].

Managing numbers for an application

Version 3 of the CLI allows you to easily manage numbers for an application. There are two main commands: vonage apps numbers list <id>, and, vonage apps numbers <link|unlink> <id> <msisdn>. Using these commands will ensure that numbers are linked properly.

Listing the numbers linked to an application

To list all the numbers linked to an application, simply run vonage apps numbers list <id> where id is the UUID for the application. If you pass in the --fail flag, this command will exit with code 1 if the application does not have either messages or voice capabilities.

Note: This will page through all the numbers you have linked. This might take some time depending on how many numbers are linked

vonage apps numbers list 00000000-0000-0000-0000-000000000000

✅ Fetching Application
Fetching numbers linked to application Your application [==============] 1/1 100%

There is 1 number linked:

Number       Country             Type       Features       
-----------  ------------------  ---------  ---------------
16127779311  🇺🇸 United States    Mobile     MMS, SMS, VOICE

Linking/Unlinking a number to an application

Numbers can be linked using vonage apps <link|unlink> <id> <msisdn>.

Reference