Google 上的操作 - Mac 操作不会 运行

Actions on Google - Mac gactions won't run

我正在尝试按照此处所述设置 Actions sdk:

https://developers.google.com/actions/sdk

我为 Mac 64 位机器下载了 gactions。如果我尝试打开文件,它会以文本形式打开。当我在包含 gactions 的文件夹中时,我尝试 运行 gactions init 并得到响应:

-bash: gactions: command not found

有什么想法吗?

如果您已经正确设置了 google-cloud-sdk,那么您可以将 gactions 文件放入 google-cloud-sdk/bin 文件夹中。或者,您可以将 bash 的路径直接添加到您有 gactions 的文件夹。

试试这个:

  • gaction CLI
  • 下载 Google gactions cli
  • 在 Mac 和 Linux 上,从终端生成二进制可执行文件 运行: $ cd folder_with_gactions $ chmod +x gactions
  • 执行动作 $ cd folder_with_gactions $ ./gactions init

此外,如果您尝试在 Google 主页:How to create a custom private Google Home Action with API.AI and Google App Engine 中创建一个动作,您可能会发现本教程很有趣。在 STEP 8 中,您可以找到一个动作示例。

下载gactions

复制下载的gactions并放入本地项目文件夹

然后进入你的项目目录 cd "项目目录"

运行 以下命令:

$ chmod +x gactions

$ ./gactions init

它将创建 action.json 到您的文件夹

  • 确保你 运行 chmod +x gactions 使二进制文件可执行
  • 将二进制可执行文件复制到项目目录中
  • 运行 ./gactions init 来自 terminal/command 行

要将 gactions 命令 CLI 位置添加到系统路径:

  1. 使用 Finder 的“转到文件夹”选项,搜索“~/.bash_profile”
  2. 在编辑模式下打开文件“~/.bash_profile”并在文件顶部添加以下命令,保存并关闭。

    export PATH="$PATH:$HOME/gactionsCLI"

    Note: Above path refers to the folder which contains the executable file “Unix Executable”

  3. 重新启动终端并尝试命令