Deploying your Dialogflow Agent using the Jovo CLI

by Kaan Kilic on Sep 10, 2018

Still updating your Dialogflow agent manually? In this post you're going to learn how to use the Jovo CLI and Dialogflow v2 API to deploy a Dialogflow agent from your command line.



Making changes to Dialogflow (the natural language understanding platform that is used for Google Assistant projects in Jovo) can be tedious if you want to keep it up to date with the Jovo Model. Usually, you have to do one of the following in the Dialogflow Console:

  • Check the 'Validation' tab of the agent for any problems

Can become quite annoying, right?

Finally, you can use the command line to update your Dialogflow agent automatically! Since Jovo v1.0, we support the Dialogflow v2 API which allows you to set up an authentication for programmatic deployments. There are a few manual steps we need to do first, so let's get started.

Step 1: Setting up Authentication

First of all, go to the Dialogflow console and click on the gear icon right next to your agent's name to get to the General tab. You will find a service account right beneath the project ID:

Dialogflow Service Account

Step 1.1: Creating a new Service Account

Click the service account link, it will lead us to the Google Cloud Platform, where we will create a new service account using the button at the top of the page:

Google Cloud IAM

Google Cloud IAM New Account

We select Dialogflow API Admin as the role:

Google Cloud IAM Role

After creating the service account, we create a new JSON key:

Google Cloud IAM Key

Last but not least move the saved key file to our project's root folder.

Step 1.2: Activating the Account with the Cloud SDK

The Jovo CLI uses the Google Cloud SDK to access Dialogflow through projects on the Google Cloud Platform. You can download it here.

Install the SDK and initialize it using the quickstart guide from Google.

Step 2: Deploying your Agent with the Jovo CLI

After that add both the projectId of your Dialogflow agent and the path to the keyFile to your project's project.js file:

Now run the build and deploy command and your agent will be updated:

The result should look like this:

To be sure you may want to check the 'Validation' tab in Dialogflow.

Any questions? You can reach us on Twitter or Slack.

Kaan Kilic

Technical Content Marketing Associate at Jovo

Comments and Questions

Any specific questions? Just drop them below or join the Jovo Community Forum.

Join Our Newsletter

Be the first to get our free tutorials, courses, and other resources for voice app developers.