1
0
mirror of synced 2025-12-20 10:28:40 -05:00
Files
docs/content/copilot/using-github-copilot/using-github-copilot-in-the-command-line.md
Joe Clark 75f3cce197 October 28-30: GitHub Universe 2024 docs-internal megabranch (#52491)
Co-authored-by: isaacmbrown <isaacmbrown@github.com>
Co-authored-by: Hector Alfaro <hectorsector@github.com>
Co-authored-by: Isaac Brown <101839405+isaacmbrown@users.noreply.github.com>
Co-authored-by: hubwriter <hubwriter@github.com>
Co-authored-by: Vanessa <vgrl@github.com>
Co-authored-by: Christopher Nguyen <91625426+nguyen-dows@users.noreply.github.com>
Co-authored-by: Sophie <29382425+sophietheking@users.noreply.github.com>
Co-authored-by: Felicity Chapman <felicitymay@github.com>
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
Co-authored-by: Sam Browning <106113886+sabrowning1@users.noreply.github.com>
Co-authored-by: David Staheli <1767415+davidstaheli@users.noreply.github.com>
Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com>
Co-authored-by: sunbrye <sunbrye@github.com>
Co-authored-by: Tim Rogers <timrogers@github.com>
Co-authored-by: Felix Guntrip <stevecat@github.com>
Co-authored-by: Sunbrye Ly <56200261+sunbrye@users.noreply.github.com>
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
Co-authored-by: Rachael Rose Renk <91027132+rachaelrenk@users.noreply.github.com>
Co-authored-by: Jules <19994093+jules-p@users.noreply.github.com>
Co-authored-by: Laura Coursen <lecoursen@github.com>
Co-authored-by: Jules Porter <jules-p@users.noreply.github.com>
Co-authored-by: Devraj Mehta <devm33@github.com>
Co-authored-by: Kate Studwell <katestud@github.com>
Co-authored-by: Katherine Oelsner <49968061+octokatherine@users.noreply.github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
Co-authored-by: Tim Rogers <me@timrogers.co.uk>
Co-authored-by: Arfon Smith <arfon@users.noreply.github.com>
2024-10-29 08:40:06 -07:00

3.2 KiB

title, intro, versions, topics, shortTitle, redirect_from
title intro versions topics shortTitle redirect_from
Using GitHub Copilot in the command line You can use {% data variables.product.prodname_copilot_short %} with the {% data variables.product.prodname_cli %} to get suggestions and explanations for the command line.
feature
copilot-in-the-cli
Copilot
CLI
Use Copilot in the CLI
/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli
/copilot/using-github-copilot/using-github-copilot-in-the-cli

Prerequisites

  • Access to {% data variables.product.prodname_copilot %}. See "AUTOTITLE."
  • {% data variables.product.prodname_cli %} installed. {% data reusables.cli.cli-installation %}
  • {% data variables.product.prodname_copilot_cli_short %} extension installed. See "AUTOTITLE."

If you have access to {% data variables.product.prodname_copilot %} via your organization or enterprise, you cannot use {% data variables.product.prodname_copilot_cli_short %} if your organization owner or enterprise administrator has disabled {% data variables.product.prodname_copilot_cli_short %}. See "AUTOTITLE."

Getting command explanations

To ask {% data variables.product.prodname_copilot_cli_short %} to explain a command, run gh copilot explain followed by the command that you want explained. For example:

gh copilot explain "sudo apt-get"

Getting command suggestions

To ask {% data variables.product.prodname_copilot_cli_short %} to suggest a command, run gh copilot suggest followed by the command that you want. For example:

gh copilot suggest "Undo the last commit"

{% data variables.product.prodname_copilot_cli_short %} will start an interactive session to get more information about what you want.

If you choose the Execute command option after {% data variables.product.prodname_copilot_cli_short %} suggests a command, {% data variables.product.prodname_copilot_cli_short %} 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 {% data variables.product.prodname_copilot_cli_short %} to be able to execute commands on your behalf, you must set up the ghcs alias. See "AUTOTITLE."

Sharing feedback

To send feedback to {% data variables.product.company_short %} about the quality of a suggestion, select the Rate response option in {% data variables.product.prodname_copilot_cli_short %}.

You can also open an issue in the {% data variables.product.prodname_copilot_cli_short %} extension repository.

Further reading