gactions CLI (luồng hội thoại)
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
gactions
là giao diện dòng lệnh mà bạn dùng để kiểm thử và cập nhật
Dự án Actions (Hành động).
Cấu trúc hệ thống
Để chọn tệp tải xuống phù hợp, bạn cần tìm cấu trúc hệ thống của mình.
Trên thiết bị Mac OS X và Linux, bạn có thể tìm thấy kiến trúc CPU của máy tính bằng lệnh trong cửa sổ dòng lệnh
uname -a
.
Trên thiết bị Windows 10, hãy làm theo các bước sau để tìm cấu trúc CPU:
Mở phần Cài đặt
Nhấp vào System (Hệ thống)
Nhấp vào Giới thiệu
Tải xuống
Bạn có thể tải gactions
xuống cho hệ điều hành của mình (ở bên dưới).
Hệ điều hành |
Tải xuống |
Windows |
|
Mac |
|
Linux |
|
Yêu cầu
- Làm cho tệp đã tải xuống có thể thực thi bằng cách đặt các quyền thích hợp.
- Trên máy Mac và Linux, hãy chạy
chmod +x gactions
để tệp nhị phân có thể thực thi.
- Trên Windows, bạn phải có quyền Quản trị viên.
- Vị trí tải xuống
gactions
phải nằm trong biến môi trường PATH
.
Đối số được hỗ trợ
Bảng sau đây mô tả các đối số được hỗ trợ cho gactions
:
Đối số |
Mô tả |
help , h |
Xuất văn bản trợ giúp cho công cụ này. Ví dụ:
gactions help
Để xem văn bản trợ giúp cho một đối số cụ thể, hãy sử dụng cú pháp sau:
gactions help argument
Ví dụ:
gactions help test
|
get |
Lấy nội dung của dự án đã cho (Hành động + siêu dữ liệu). Hãy sử dụng cú pháp sau:
gactions get --project PROJECT_ID
|
init |
Tạo tệp action.json mặc định trong thư mục hiện tại bằng cú pháp sau:
gactions init
Nếu đã có tệp action.json , bạn có thể ghi đè tệp này bằng cách thêm
đối số --force , như trong ví dụ sau:
gactions init --force
|
list |
Liệt kê tối đa 10 phiên bản gần đây của dự án Actions: đang xem xét,
phát hành công khai, được phê duyệt, v.v. với cú pháp sau:
gactions list --project PROJECT_ID
|
test |
Đẩy gói hành động đến Nền tảng Trợ lý để kiểm thử với nội dung sau
cú pháp:
gactions test --action_package PACKAGE_NAME --project PROJECT_ID
Ví dụ:
gactions test --action_package mypackage.json --project my-project-1234567
Bạn có thể tuỳ ý tắt tính năng thử nghiệm trong môi trường hộp cát
bằng cờ
--disable_sandbox .
Cờ --preview_mins không được dùng nữa.
|
update |
Cập nhật Gói Hành động cho dự án đã cho bằng cú pháp sau:
gactions update --action_package PACKAGE_NAME --project PROJECT_ID
Ví dụ:
gactions update --action_package action.json --project my-project-1234567
Để dùng đối số update , bạn phải sử dụng Mã dự án của Hành động. Bạn có thể tải
mã dự án của bạn bằng cách nhấp vào biểu tượng bánh răng cài đặt settings trong
Dự án Actions on Google sau đó là phần Project Settings (Cài đặt dự án).
Nếu dự án Actions của bạn hỗ trợ nhiều ngôn ngữ, hãy xem
Tài liệu về gói hành động.
|
selfupdate |
gaction tự động kiểm tra bản cập nhật trước khi chạy mỗi lệnh, nhưng bạn có thể buộc
kiểm tra với selfupdate
gactions selfupdate
|
Xem kết quả chi tiết
Để xem kết quả chi tiết hơn trong quá trình xử lý, hãy thêm cờ --verbose
. Ví dụ:
gactions --verbose test --action_package action.json --project my-project-1234567
Ví dụ về action.json mặc định
Khi chạy gactions init
trong thư mục dự án, bạn sẽ tạo một giá trị mặc định
action.json
tệp trong thư mục đó:
{
"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>"
}
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003egactions\u003c/code\u003e is a command-line interface used to test and manage Actions projects, providing functionalities like updating, testing, and retrieving project data.\u003c/p\u003e\n"],["\u003cp\u003eDownloads for \u003ccode\u003egactions\u003c/code\u003e are available for Windows, Mac, and Linux operating systems, with options for different system architectures like x86_64, i386, and arm.\u003c/p\u003e\n"],["\u003cp\u003eBefore using \u003ccode\u003egactions\u003c/code\u003e, ensure it is executable and its location is added to your system's \u003ccode\u003ePATH\u003c/code\u003e environment variable.\u003c/p\u003e\n"],["\u003cp\u003eKey functionalities include \u003ccode\u003einit\u003c/code\u003e to create an \u003ccode\u003eaction.json\u003c/code\u003e file, \u003ccode\u003etest\u003c/code\u003e to deploy for testing, \u003ccode\u003eupdate\u003c/code\u003e to push updates, and \u003ccode\u003eget\u003c/code\u003e to retrieve project content.\u003c/p\u003e\n"],["\u003cp\u003eFor detailed information about \u003ccode\u003egactions\u003c/code\u003e usage and available arguments, use the \u003ccode\u003ehelp\u003c/code\u003e command or consult the provided documentation.\u003c/p\u003e\n"]]],[],null,["# gactions CLI (Dialogflow)\n\n`gactions` is the command line interface that you use to test and update your\nActions project.\n\nSystem architecture\n-------------------\n\nTo select the proper download, you'll need to find your system architecture.\n\n- On Mac OS X and Linux devices, you can find your computer's CPU architecture using the terminal command\n `uname -a`.\n\n- On Windows 10 devices, take the following steps to find the CPU architecture:\n\n 1. Open **Settings**\n\n 2. Click **System**\n\n 3. Click **About**\n\nDownloads\n---------\n\nYou can download `gactions` for your operating system (below).\n\n| OS | Downloads |\n|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Windows | - [x86_64](https://dl.google.com/gactions/updates/bin/windows/amd64/gactions.exe/gactions.exe) - [i386](https://dl.google.com/gactions/updates/bin/windows/386/gactions.exe/gactions.exe) |\n| Mac | - [x86_64](https://dl.google.com/gactions/updates/bin/darwin/amd64/gactions/gactions) - [i386](https://dl.google.com/gactions/updates/bin/darwin/386/gactions/gactions) |\n| Linux | - [x86_64](https://dl.google.com/gactions/updates/bin/linux/amd64/gactions/gactions) - [i386](https://dl.google.com/gactions/updates/bin/linux/386/gactions/gactions) - [arm](https://dl.google.com/gactions/updates/bin/linux/arm/gactions) |\n\nRequirements\n------------\n\n- Make the downloaded file executable by setting the appropriate permissions.\n - On Mac and Linux, run `chmod +x gactions` to make the binary executable.\n - On Windows, you must have Administrator rights.\n- The `gactions` download location must be in your `PATH` environment variable.\n\nSupported arguments\n-------------------\n\nThe following table describes the supported arguments for `gactions`:\n\n| Argument | Description |\n|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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 ``` |\n| `get` | Get the content of the given project (Actions + metadata). Use the following syntax: ``` gactions get --project PROJECT_ID ``` |\n| `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 ``` |\n| `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 ``` |\n| `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. |\n| `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 *settings* in your Actions on Google project followed by **Project Settings**. If your Actions project supports multiple languages, see the [Action package documentation.](/assistant/df-asdk/localization/action-packages) |\n| `selfupdate` | gactions automatically checks for updates before each command runs, but you can force that check with `selfupdate` ``` gactions selfupdate ``` |\n\nView verbose output\n-------------------\n\nTo view more detailed output during processing, add the `--verbose` flag. For example: \n\n```\ngactions --verbose test --action_package action.json --project my-project-1234567\n```\n\nDefault action.json example\n---------------------------\n\nWhen you run `gactions init` in your project directory, you generate a default\n`action.json` file in that directory: \n\n```text\n{\n \"actions\": [\n {\n \"description\": \"Default Welcome Intent\",\n \"name\": \"MAIN\",\n \"fulfillment\": {\n \"conversationName\": \"\u003cINSERT YOUR CONVERSATION NAME HERE\u003e\"\n },\n \"intent\": {\n \"name\": \"actions.intent.MAIN\",\n \"trigger\": {\n \"queryPatterns\": [\n \"talk to \u003cINSERT YOUR NAME HERE\u003e\"\n ]\n }\n }\n }\n ],\n \"conversations\": {\n \"\u003cINSERT YOUR CONVERSATION NAME HERE\u003e\": {\n \"name\": \"\u003cINSERT YOUR CONVERSATION NAME HERE\u003e\",\n \"url\": \"\u003cINSERT YOUR FULLFILLMENT URL HERE\u003e\"\n }\n },\n \"locale\": \"\u003cINSERT YOUR LANGUAGE HERE\u003e\"\n}\n```"]]