gactions CLI (Dialogflow)

gactions is the command line interface that you use to test and update your Actions project.

System architecture

To select the proper download, you'll need to find your system architecture.

  • On Mac OS X and Linux devices, you can find your computer's CPU architecture using the terminal command uname -a.

  • On Windows 10 devices, take the following steps to find the CPU architecture:

    1. Open Settings

    2. Click System

    3. Click About

Downloads

You can download gactions for your operating system (below).

OS Downloads
Windows
Mac
Linux

Requirements

  • Make the downloaded file executable by setting the appropriate permissions.
    • On Mac and Linux, run chmod +x gactions to make the binary executable.
    • On Windows, you must have Administrator rights.
  • The gactions download location must be in your PATH environment variable.

Supported arguments

The following table describes the supported arguments for gactions:

Argument Description
help, h Outputs the help text for this tool. For example:
gactions help

To view the help text for a specific argument, use the following syntax:

gactions help argument

For example:

gactions help test
get Get the content of the given project (Actions + metadata). Use the following syntax:
gactions get --project PROJECT_ID
init Creates a default action.json file in the current directory with the following syntax:
gactions init

If there is already an existing action.json file, you can overwrite it by adding the --force argument, as the following example shows:

gactions init --force
list Lists up to 10 recent versions of your Actions project: in review, production, approved, etc, with the following syntax:
gactions list --project PROJECT_ID
test Pushes an action package to the Assistant Platform for testing with the following syntax:
gactions test --action_package PACKAGE_NAME --project PROJECT_ID

For example:

gactions test --action_package mypackage.json --project my-project-1234567

You can optionally disable testing in the sandbox environment with the
--disable_sandbox flag.

--preview_mins flag is deprecated.

update Updates the Action package for the given project with the following syntax:
gactions update --action_package PACKAGE_NAME --project PROJECT_ID

For example:

gactions update --action_package action.json --project my-project-1234567

To use the update argument, you must use your Action's Project ID. You can get your project ID by clicking the settings gear in your Actions on Google project followed by Project Settings.

If your Actions project supports multiple languages, see the Action package documentation.

selfupdate gactions automatically checks for updates before each command runs, but you can force that check with selfupdate
gactions selfupdate

View verbose output

To view more detailed output during processing, add the --verbose flag. For example:

gactions --verbose test --action_package action.json --project my-project-1234567

Default action.json example

When you run gactions init in your project directory, you generate a default action.json file in that directory:

{
  "actions": [
    {
      "description": "Default Welcome Intent",
      "name": "MAIN",
      "fulfillment": {
        "conversationName": "<INSERT YOUR CONVERSATION NAME HERE>"
      },
      "intent": {
        "name": "actions.intent.MAIN",
        "trigger": {
          "queryPatterns": [
            "talk to <INSERT YOUR NAME HERE>"
          ]
        }
      }
    }
  ],
  "conversations": {
    "<INSERT YOUR CONVERSATION NAME HERE>": {
      "name": "<INSERT YOUR CONVERSATION NAME HERE>",
      "url": "<INSERT YOUR FULLFILLMENT URL HERE>"
    }
  },
  "locale": "<INSERT YOUR LANGUAGE HERE>"
}