gactions

module
v3.2.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2021 License: Apache-2.0

README

gactions CLI

This repository contains source code for the CLI used to communicate with Actions SDK.

Install

The latest version of this tool can be installed directly from developers.google.com or via NPM:

npm install -g @assistant/gactions

Usage

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.
  release-channels    This is the main command for viewing and managing release channels. See below for a complete list of sub-commands.
  third-party-notices Prints license files of third-party software used.
  version             Prints current version of the CLI.
  versions            This is the main command for viewing and managing versions. See below for a complete list of sub-commands.

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

Use "gactions [command] --help" for more information about a command.
Quick Start
# Start an authentication flow.
# This requires a web browser.
# When the flow is complete, the CLI automatically authenticates.
gactions login

# Initialize a sample project
gactions init hello-world --dest hello-world-sample
cd hello-world-sample

# Open the `sdk/settings/settings.yaml` file and change the value of
# `projectId` to your project's ID.
$EDITOR sdk/settings/settings.

# From the hello-world-sample/sdk/ directory, run the following
# command to push the local version of your Actions project to the
# console as a draft version.
cd sdk
gactions push

# From the hello-world-sample/sdk/ directory, run the following
# command to test your Actions project in the simulator.
gactions deploy preview

Read the quick start documentation to learn more.

Google Cloud Project Setup

  1. Create a Google Cloud project.
  2. Enable the Actions API for your project:
    1. Visit the Google API console and select your project from the Select a project dropdown.
    2. If the Actions API is not enabled, search for "Actions API" and click Enable.
  3. Create a OAuth Client Id:
    1. Visit the Google Cloud console credentials page and select your project from the Select a project dropdown.
    2. Click the "Create credentials" button and then select "OAuth Client Id".
    3. Select Application Type "Desktop app"
    4. Enter an OAuth client name and click Create.
    5. Configure the OAuth consent screen and add your email as a test account.
    6. Return to the Google Cloud console credentials page
    7. Click the download icon next to the newly-created OAuth client name to download the JSON file.
    8. Move the file to a file named data/client_not_so_secret.json in this directory.

Note: If you are running this alongside the official gactions binary , you will need to regenerate authentication credentials. To reset these credentials:

  1. Run bazel run gactions logout.
  2. Run bazel run gactions login.

Build Instructions

To build this project, you will require Bazel.

Build the CLI using :gactions Bazel rule.:

  • Linux: bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 gactions.

  • Windows: bazel build --platforms=@io_bazel_rules_go//go/toolchain:windows_amd64 gactions

  • Mac bazel build --platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64 gactions

You will find the binary in bazel-bin/gactions_/gactions.

Note: bazel build gactions will build for your local platform.

Run Instructions

To simultaneously build and run the project:

  1. bazel run gactions

Pass parameters:

  1. bazel run gactions -- <args>

Example:

bazel run gactions -- version

This should print out the current version from versions/version_names.bzl.

References & Issues

Make Contributions

Please read and follow the steps in the CONTRIBUTING.md.

License

See LICENSE.

Directories

Path Synopsis
cmd
gactions
Binary gactions is a command-line interface to the Actions SDK.
Binary gactions is a command-line interface to the Actions SDK.
gactions/cli
Package cli contains shared CLI initialization steps.
Package cli contains shared CLI initialization steps.
gactions/cli/decrypt
Package decrypt provides an implementation of "gactions decrypt" command.
Package decrypt provides an implementation of "gactions decrypt" command.
gactions/cli/deploy
Package deploy provides an implementation of "gactions deploy" command.
Package deploy provides an implementation of "gactions deploy" command.
gactions/cli/encrypt
Package encrypt provides an implementation of "gactions encrypt" command.
Package encrypt provides an implementation of "gactions encrypt" command.
gactions/cli/ginit
Package ginit provides an implementation of "gactions init" command.
Package ginit provides an implementation of "gactions init" command.
gactions/cli/login
Package login provides an implementation of "gactions login" command.
Package login provides an implementation of "gactions login" command.
gactions/cli/logout
Package logout provides an implementation of "gactions login" command.
Package logout provides an implementation of "gactions login" command.
gactions/cli/notices
Package notices provides an implementation of "gactions third-party-notices" command.
Package notices provides an implementation of "gactions third-party-notices" command.
gactions/cli/pull
Package pull provides an implementation of "gactions pull" command.
Package pull provides an implementation of "gactions pull" command.
gactions/cli/push
Package push provides an implementation of "gactions push" command.
Package push provides an implementation of "gactions push" command.
gactions/cli/version
Package version implements "gactions version" command.
Package version implements "gactions version" command.
gactions/cli/versions
Copyright 2021 Google LLC
Copyright 2021 Google LLC
Package log provides common log functions to the cli infrastructure.
Package log provides common log functions to the cli infrastructure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL