Join us live on October 8th for the virtual Google Assistant Developer Day. Register now.

gactions overview

The gactions command line interface (CLI) tool helps you create the required project structure and files and deploy them as an Actions project in the Actions console. For information on using the command-line tool in common scenarios after it's installed and set up, see the user guide instead.

Once installed, you can get a summary of the tool's functionality in your terminal:

gactions --help

The following output appears:

Command Line Interface for Google Actions SDK

Usage:
  gactions [command]

Available Commands:
  decrypt             Decrypt client secret.
  deploy              Deploy an Action to the specified channel.
  encrypt             Encrypt client secret.
  help                Help about any command
  init                Initialize a directory for a new project.
  login               Authenticate gactions CLI to your Google account via web browser.
  logout              Log gactions CLI out of your Google Account.
  pull                This command pulls files from Actions Console into the local file system.
  push                This command pushes changes in the local files to Actions Console.
  third-party-notices Prints license files of third-party software used.
  version             Prints current version of the CLI.

Flags:
  -h, --help      help for gactions
  -v, --verbose   Display additional error information

Use "gactions [command] --help" for more information about a command.

Install the gactions command-line tool

Install the gactions command line interface (CLI) tool by downloading an installation package, unpacking it, and configuring your execution path.

To install and configure gactions, follow these steps:

  1. Download the appropriate package for your operating system:

    Platform Package Checksum
    Windows Download SHA256
    Linux Download SHA256
    Mac OS Download SHA256
  2. Extract the package to a location of your choice and add the binary to your environment's PATH variable. Alternatively, extract the package to a location that's already in your PATH variable (for example, /usr/local/bin).

  3. On Linux and Mac, enable execute permissions if necessary:

    chmod +x PATH_TO/gactions
  4. Run the following command to authenticate the CLI. This command starts an authentication flow and requires a web browser:

    gactions login

    When the flow is complete, the CLI automatically authenticates.

Create and set up a project

Before you can use the gactions command-line tool, you must create a project in the Actions console and give gactions access to the project. To create and set up a project, do the following:

  1. Go to the Actions console.
  2. Click New project, enter a project name, and click Create project.
  3. Select a category and click Next.
  4. Select Blank project and click Start building.
  5. Enable the Actions API in the Google Cloud console by following the instructions in Enable and disable APIs. This allows gactions to interact with your project.

Initialize a sample

Create an empty directory, then run gactions init SAMPLE_NAME from that directory to import a sample Actions project. You can use the sample project as a model to create your own project and to understand an Actions project's structure.

For instance, the following command results in the contents of the hello-world sample being added to your directory:

gactions init hello-world