CLI gactions (Dialogflow)
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
gactions
est l'interface de ligne de commande que vous utilisez pour tester et mettre à jour votre
Projet Actions.
Architecture du système
Pour sélectionner le téléchargement approprié, vous devez trouver l'architecture de votre système.
Sur les appareils Mac OS X et Linux, vous pouvez déterminer l'architecture du processeur de votre ordinateur à l'aide de la commande Terminal
uname -a
Sur les appareils Windows 10, procédez comme suit pour identifier l'architecture du processeur:
Accédez aux Paramètres.
Cliquez sur Système.
Cliquez sur À propos.
Téléchargements
Vous pouvez télécharger gactions
pour votre système d'exploitation (voir ci-dessous).
OS |
Téléchargements |
Windows |
|
Mac |
|
Linux |
|
Conditions requises
- Définissez les autorisations appropriées pour rendre le fichier téléchargé exécutable.
- Sous Mac et Linux, exécutez
chmod +x gactions
pour rendre le binaire exécutable.
- Sous Windows, vous devez disposer de droits d'administrateur.
- L'emplacement de téléchargement
gactions
doit se trouver dans votre variable d'environnement PATH
.
Arguments acceptés
Le tableau suivant décrit les arguments acceptés pour gactions
:
Argument |
Description |
help , h |
Affiche le texte d'aide de cet outil. Exemple :
gactions help
Pour afficher le texte d'aide d'un argument spécifique, utilisez la syntaxe suivante:
gactions help argument
Exemple :
gactions help test
|
get |
Permet d'obtenir le contenu du projet donné (actions + métadonnées). Utilisez la syntaxe suivante:
gactions get --project PROJECT_ID
|
init |
Crée un fichier action.json par défaut dans le répertoire actuel avec la syntaxe suivante:
gactions init
S'il existe déjà un fichier action.json , vous pouvez l'écraser en ajoutant le
--force , comme le montre l'exemple suivant:
gactions init --force
|
list |
Liste jusqu'à 10 versions récentes de votre projet Actions : "En cours d'examen",
production, approuvé, etc., avec la syntaxe suivante:
gactions list --project PROJECT_ID
|
test |
Transfère un package d'actions à la plate-forme Assistant à des fins de test avec les éléments suivants
syntaxe:
gactions test --action_package PACKAGE_NAME --project PROJECT_ID
Exemple :
gactions test --action_package mypackage.json --project my-project-1234567
Vous pouvez éventuellement désactiver les tests dans l'environnement de bac à sable.
avec l'indicateur
--disable_sandbox .
L'option --preview_mins est obsolète.
|
update |
Met à jour le package Action pour le projet donné avec la syntaxe suivante:
gactions update --action_package PACKAGE_NAME --project PROJECT_ID
Exemple :
gactions update --action_package action.json --project my-project-1234567
Pour utiliser l'argument update , vous devez utiliser l'ID de projet de votre action. Vous pouvez obtenir
l'ID de votre projet en cliquant sur l'icône des paramètres en forme de roue dentée settings dans la section
Projet Actions on Google suivi de Paramètres du projet
Si votre projet Actions est compatible avec plusieurs langages, consultez la
Documentation du package d'actions
|
selfupdate |
gactions recherche automatiquement des mises à jour avant l'exécution de chaque commande, mais vous pouvez forcer
qui font l'objet d'une vérification auprès de selfupdate
gactions selfupdate
|
Afficher le résultat détaillé
Pour afficher des résultats plus détaillés lors du traitement, ajoutez l'option --verbose
. Exemple :
gactions --verbose test --action_package action.json --project my-project-1234567
Exemple de fichier action.json par défaut
Lorsque vous exécutez gactions init
dans le répertoire de votre projet, vous générez une valeur par défaut
action.json
de ce répertoire:
{
"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>"
}
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/26 (UTC).
[null,null,["Dernière mise à jour le 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```"]]