Skip to main content

GitHub Copilot 快速入门

快速了解如何使用 GitHub Copilot。

Introduction

GitHub Copilot provides coding suggestions as you type in your editor. You can also ask Copilot coding-related questions, such as how best to code something, how to fix a bug, or how someone else's code works. For full details of what Copilot can do, see What is GitHub Copilot?.

Instructions for using Copilot differ depending on where you are using it. This version of the quickstart is for Windows Terminal. Click the tabs above for instructions on using Copilot in other environments.

Prerequisites

  • Subscription to Copilot. To use GitHub Copilot in Windows Terminal, you must have an active GitHub Copilot subscription. For information about how to get access to Copilot, see What is GitHub Copilot?.

  • Windows Terminal Canary. Terminal Chat is only available in Windows Terminal Canary.

Use Copilot in Terminal Chat

After you've installed Windows Terminal Canary, you can use Copilot in Terminal Chat to ask command line-related questions.

  1. Open Settings from the dropdown menu.

    Screenshot of the dropdown menu in the Windows Terminal with the Settings item highlighted.

  2. Go to the Terminal Chat (Experimental) setting.

    Screenshot of the Settings menu in the Windows Terminal with the Terminal Chat (Experimental) item highlighted.

  3. Under Service Providers, select GitHub Copilot and Authenticate via GitHub to sign in.

Chat with GitHub Copilot

Note

If you have access to GitHub Copilot via your organization or enterprise, you won't be able to use GitHub Copilot in Windows Terminal if your organization owner or enterprise administrator has disabled GitHub Copilot in the CLI. See Managing policies for Copilot in your organization.

  1. Open Terminal Chat (Experimental) in the dropdown menu.

  2. In the Terminal Chat chat window, type how do i list all markdown files in my directory then press Enter.

    Copilot's answer is displayed below your question.

  3. Click on an answer to insert it to the command line.

Next steps