Prerequisites
- Access to GitHub Copilot. See What is GitHub Copilot?.
- GitHub CLI installed. Pour obtenir des instructions d’installation pour GitHub CLI, consultez le dépôt GitHub CLI.
- Copilot dans l’interface de ligne de commande CLI extension installed. See Installing GitHub Copilot in the CLI.
If you have access to GitHub Copilot via your organization or enterprise, you cannot use Copilot dans l’interface de ligne de commande CLI if your organization owner or enterprise administrator has disabled Copilot dans l’interface de ligne de commande CLI. See Managing policies for Copilot in your organization.
Getting command explanations
To ask Copilot dans l’interface de ligne de commande CLI to explain a command, run gh copilot explain
followed by the command that you want explained. For example:
gh copilot explain "sudo apt-get"
gh copilot explain "sudo apt-get"
Getting command suggestions
To ask Copilot dans l’interface de ligne de commande CLI to suggest a command, run gh copilot suggest
followed by the command that you want. For example:
gh copilot suggest "Undo the last commit"
gh copilot suggest "Undo the last commit"
Copilot dans l’interface de ligne de commande CLI will start an interactive session to get more information about what you want.
If you choose the Execute command option after Copilot dans l’interface de ligne de commande CLI suggests a command, Copilot dans l’interface de ligne de commande CLI will copy the command to your clipboard and exit the interactive session. Then you can manually paste the command into your CLI.
If you want Copilot dans l’interface de ligne de commande CLI to be able to execute commands on your behalf, you must set up the ghcs
alias. See Configuring GitHub Copilot in the CLI.
Sharing feedback
To send feedback to GitHub about the quality of a suggestion, select the Rate response option in Copilot dans l’interface de ligne de commande CLI.
You can also open an issue in the Copilot dans l’interface de ligne de commande CLI extension repository.