<!-- TRANSLATION_FALLBACK prop=markdown type=ParseError line=20 col=163 msg="tag '数据可重用s' not found" -->
## Introduction

<!-- --------------------- -->

<!-- Web browser -->

<!-- --------------------- -->

<div class="ghd-tool webui">

You can use Copilot to get answers to 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?](/en/copilot/about-github-copilot/what-is-github-copilot).

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

## Sign up for GitHub Copilot

<a href="https://github.com/copilot?ref_product=copilot&ref_type=engagement&ref_style=button&ref_plan=free" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Get started for free</span> <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-link-external" aria-label="link external icon" role="img"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a>

To use Copilot, you’ll need a personal GitHub account with access to a Copilot plan. You can:

* Start with Copilot Free to explore limited features without subscribing to a plan.
* Upgrade to Copilot Pro or Copilot Pro+ to unlock more features, models, and request limits.

For more information about the different plans for GitHub Copilot, see [Plans for GitHub Copilot](/en/copilot/about-github-copilot/subscription-plans-for-github-copilot).

## Asking your first question

1. On GitHub, navigate to a repository and open a file.

2. Click the Copilot icon (<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-copilot" aria-label="copilot" role="img"><path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path></svg>) at the top right of the file view.

   ![Screenshot of the Copilot button, highlighted with a dark orange outline, at the top of the file view.](/assets/images/help/copilot/copilot-button-for-file.png)

3. Type a question in the "Ask Copilot" box at the bottom of the chat panel and press <kbd>Enter</kbd>.

   For example, you could enter:

   * `Explain this file.`
   * `How could I improve this code?`
   * `How can I test this code?`

   Copilot responds to your request in the panel.

4. You can continue the conversation by asking a follow-up question. For example, you could type "tell me more" to get Copilot to expand on its last comment.

## Other questions you can ask

There are many more things you can do with GitHub Copilot Chat in GitHub. For example:

* Ask a general question about software development
* Ask exploratory questions about a repository
* Find out about the changes in a pull request
* Ask a question about a specific issue or commit

For more information, see [Asking GitHub Copilot questions in GitHub](/en/copilot/github-copilot-chat/copilot-chat-in-github/using-github-copilot-chat-in-githubcom).

## Next steps

* **Find out more about GitHub Copilot Chat** - See [Asking GitHub Copilot questions in your IDE](/en/copilot/github-copilot-chat/using-github-copilot-chat-in-your-ide).
* **Get Copilot inline suggestions in an IDE** - See [Getting code suggestions in your IDE with GitHub Copilot](/en/enterprise-cloud@latest/copilot/using-github-copilot/using-github-copilot-code-suggestions-in-your-editor).
* **Learn how to write effective prompts** - See [Prompt engineering for GitHub Copilot Chat](/en/copilot/using-github-copilot/prompt-engineering-for-github-copilot).
* **Use Copilot on your mobile device** - See [Asking GitHub Copilot questions in GitHub Mobile](/en/copilot/github-copilot-chat/copilot-chat-in-github-mobile/using-github-copilot-chat-in-github-mobile).
* **Use Copilot on the command line** - See [Using the GitHub CLI Copilot extension](/en/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli).

</div>

<!-- --------------------- -->

<!-- Windows terminal -->

<!-- --------------------- -->

<div class="ghd-tool windowsterminal">

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?](/en/copilot/about-github-copilot/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.

## Sign up for GitHub Copilot

<a href="https://github.com/copilot?ref_product=copilot&ref_type=engagement&ref_style=button&ref_plan=free" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Get started for free</span> <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-link-external" aria-label="link external icon" role="img"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a>

To use Copilot, you’ll need a personal GitHub account with access to a Copilot plan. You can:

* Start with Copilot Free to explore limited features without subscribing to a plan.
* Upgrade to Copilot Pro or Copilot Pro+ to unlock more features, models, and request limits.

For more information about the different plans for GitHub Copilot, see [Plans for GitHub Copilot](/en/copilot/about-github-copilot/subscription-plans-for-github-copilot).

## Prerequisites

* **Subscription to Copilot**. To use GitHub Copilot in Windows Terminal, you must have an active GitHub Copilot subscription. See [What is GitHub Copilot?](/en/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot).
* **Windows Terminal Canary**. Terminal Chat is only available in [Windows Terminal Canary](https://github.com/microsoft/terminal?tab=readme-ov-file#installing-windows-terminal-canary).

## Use Copilot in Terminal Chat

After you've installed Windows Terminal Canary, you can use Copilot in [Terminal Chat](https://learn.microsoft.com/windows/terminal/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.](/assets/images/help/copilot/windows-terminal-dropdown.png)

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

   ![Screenshot of the Settings menu in the Windows Terminal with the Terminal Chat (Experimental) item highlighted.](/assets/images/help/copilot/windows-terminal-settings.png)

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, you won't be able to use GitHub Copilot in Windows Terminal if your organization owner has disabled GitHub Copilot CLI. See [Managing policies and features for GitHub Copilot in your organization](/en/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-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 <kbd>Enter</kbd>.

   Copilot's answer is displayed below your question.

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

## Next steps

* **Find out more about Copilot inline suggestions** - See [Getting code suggestions in your IDE with GitHub Copilot](/en/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot).
* **Find out more about GitHub Copilot Chat** - See [Asking GitHub Copilot questions in your IDE](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide).
* **Learn how to write effective prompts** - See [Prompt engineering for GitHub Copilot Chat](/en/copilot/using-github-copilot/copilot-chat/prompt-engineering-for-copilot-chat).
* **Use Copilot on your mobile device** - See [Asking GitHub Copilot questions in GitHub Mobile](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-github-mobile).
* **Use Copilot on the command line** - See [About GitHub Copilot CLI](/en/copilot/concepts/agents/about-copilot-cli).
* **Configure Copilot in your editor** - You can enable or disable GitHub Copilot from within your editor, and create your own preferred keyboard shortcuts for Copilot. See [Configuring GitHub Copilot in your environment](/en/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment).

</div>

<!-- --------------------- -->

<!-- VS Code -->

<!-- --------------------- -->

<div class="ghd-tool vscode">

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?](/en/copilot/about-github-copilot/what-is-github-copilot).

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

## Sign up for GitHub Copilot

<a href="https://github.com/copilot?ref_product=copilot&ref_type=engagement&ref_style=button&ref_plan=free" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Get started for free</span> <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-link-external" aria-label="link external icon" role="img"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a>

To use Copilot, you’ll need a personal GitHub account with access to a Copilot plan. You can:

* Start with Copilot Free to explore limited features without subscribing to a plan.
* Upgrade to Copilot Pro or Copilot Pro+ to unlock more features, models, and request limits.

For more information about the different plans for GitHub Copilot, see [Plans for GitHub Copilot](/en/copilot/about-github-copilot/subscription-plans-for-github-copilot).

## Prerequisites

* **Copilot subscription** - To use GitHub Copilot in VS Code, you must have an active GitHub Copilot subscription. See [What is GitHub Copilot?](/en/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot).
* **Latest version of Visual Studio Code**. See the [Visual Studio Code download page](https://code.visualstudio.com/Download?ref_product=copilot\&ref_type=engagement\&ref_style=text).
* **Sign in to GitHub in Visual Studio Code**. If you experience authentication issues, see [Troubleshooting common issues with GitHub Copilot](/en/copilot/troubleshooting-github-copilot/troubleshooting-issues-with-github-copilot-chat#troubleshooting-authentication-issues-in-your-editor).

## Chat with GitHub Copilot

After you've installed the GitHub Copilot extension, you can ask Copilot coding-related questions.

> \[!NOTE] If you have access to GitHub Copilot via your organization, you won't be able to use GitHub Copilot Chat if your organization owner has disabled chat. See [Managing policies and features for GitHub Copilot in your organization](/en/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization).

1. Open an existing code file.

2. Open the Chat view from the Activity Bar.

   ![Screenshot of the Chat icon in the VS Code Activity Bar.](/assets/images/help/copilot/chat-button-vscode.png)

3. At the bottom of the chat view, in the chat input field, type: `explain this file`.

4. Press <kbd>Enter</kbd>.

   Copilot replies in the chat view.

5. In the editor, select one or more lines of code that are not commented.

6. In the chat input field, type: `add comments to these lines`.

7. If you like the comments that Copilot suggests, hover over the suggested code in the chat view and click the "Insert at Cursor" icon to replace the selected lines with the suggested code.

   ![Screenshot of the "Insert at Cursor" icon in the chat view.](/assets/images/help/copilot/insert-at-cursor-vscode.png)

## Get your first inline suggestion

The following example uses JavaScript, however other languages will work similarly. GitHub Copilot provides suggestions for numerous languages and a wide variety of frameworks, but works especially well for Python, JavaScript, TypeScript, Ruby, Go, C# and C++. GitHub Copilot can also assist in query generation for databases, generating suggestions for APIs and frameworks, and can help with infrastructure as code development.

1. Open Visual Studio Code.
2. In Visual Studio Code, create a new JavaScript (*\*.js*) file.
3. In the JavaScript file, type the following function header.

   ```javascript copy
   function calculateDaysBetweenDates(begin, end) {
   ```

   GitHub Copilot will automatically suggest an entire function body in grayed text. The exact suggestion may vary.
4. To accept the suggestion, press <kbd>Tab</kbd>.

## Next steps

* **Find out more about Copilot inline suggestions** - See [Getting code suggestions in your IDE with GitHub Copilot](/en/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot).
* **Find out more about GitHub Copilot Chat** - See [Asking GitHub Copilot questions in your IDE](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide).
* **Learn how to write effective prompts** - See [Prompt engineering for GitHub Copilot Chat](/en/copilot/using-github-copilot/copilot-chat/prompt-engineering-for-copilot-chat).
* **Use Copilot like a pro** - Learn how to write effective prompts for GitHub Copilot. For more information, see [Best practices for using GitHub Copilot in VS Code](https://code.visualstudio.com/docs/copilot/prompt-crafting) in the Visual Studio Code documentation.
* **Get familiar with next edit suggestions** - See [Navigating and accepting next edit suggestions](/en/copilot/how-tos/get-code-suggestions/get-ide-code-suggestions#navigating-and-accepting-next-edit-suggestions-1).
* **Use Copilot on your mobile device** - See [Asking GitHub Copilot questions in GitHub Mobile](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-github-mobile).
* **Use Copilot on the command line** - See [About GitHub Copilot CLI](/en/copilot/concepts/agents/about-copilot-cli).
* **Configure Copilot in your editor** - You can enable or disable GitHub Copilot from within your editor, and create your own preferred keyboard shortcuts for Copilot. See [Configuring GitHub Copilot in your environment](/en/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment).

</div>

<!-- --------------------- -->

<!-- Visual Studio -->

<!-- --------------------- -->

<div class="ghd-tool visualstudio">

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?](/en/copilot/about-github-copilot/what-is-github-copilot).

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

## Sign up for GitHub Copilot

<a href="https://github.com/copilot?ref_product=copilot&ref_type=engagement&ref_style=button&ref_plan=free" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Get started for free</span> <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-link-external" aria-label="link external icon" role="img"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a>

To use Copilot, you’ll need a personal GitHub account with access to a Copilot plan. You can:

* Start with Copilot Free to explore limited features without subscribing to a plan.
* Upgrade to Copilot Pro or Copilot Pro+ to unlock more features, models, and request limits.

For more information about the different plans for GitHub Copilot, see [Plans for GitHub Copilot](/en/copilot/about-github-copilot/subscription-plans-for-github-copilot).

## Prerequisites

* **Subscription to Copilot**. To use GitHub Copilot in Visual Studio, you must have an active GitHub Copilot subscription. See [What is GitHub Copilot?](/en/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot).
* **Compatible version of Visual Studio**. To use GitHub Copilot in Visual Studio, you must have version 2022 17.8 or later of Visual Studio for Windows installed. For more information, see [Install Visual Studio](https://learn.microsoft.com/en-us/visualstudio/install/install-visual-studio?ref_product=copilot\&ref_type=engagement\&ref_style=text) in the Microsoft documentation.
* **GitHub Copilot extension for Visual Studio**. For instructions on how to install the Copilot extension, see [Install GitHub Copilot in Visual Studio](https://learn.microsoft.com/visualstudio/ide/visual-studio-github-copilot-install-and-states?ref_product=copilot\&ref_type=engagement\&ref_style=text) in the Microsoft documentation.
* **Add your GitHub account to Visual Studio**. See [Add your GitHub accounts to your Visual Studio keychain](https://learn.microsoft.com/en-us/visualstudio/ide/work-with-github-accounts?ref_product=copilot\&ref_type=engagement\&ref_style=text) in the Microsoft documentation.

## Chat with GitHub Copilot

After you've installed the GitHub Copilot extension, you can ask Copilot coding-related questions.

> \[!NOTE] If you have access to GitHub Copilot via your organization, you won't be able to use GitHub Copilot Chat if your organization owner has disabled chat. See [Managing policies and features for GitHub Copilot in your organization](/en/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization).

1. Open an existing code file.

2. In the Visual Studio menu bar, click **View**, then click **GitHub Copilot Chat**.

3. In the Copilot Chat window, type `what does this file do` then press <kbd>Enter</kbd>.

   Copilot's answer is displayed below your question.

4. Select a line of code in the editor.

5. In the Copilot Chat window, type `explain this line` then press <kbd>Enter</kbd>.

## Get your first inline suggestion

The following example uses JavaScript, however other languages will work similarly. GitHub Copilot provides suggestions for numerous languages and a wide variety of frameworks, but works especially well for Python, JavaScript, TypeScript, Ruby, Go, C# and C++. GitHub Copilot can also assist in query generation for databases, generating suggestions for APIs and frameworks, and can help with infrastructure as code development.

1. Open Visual Studio.
2. In Visual Studio, create a new JavaScript (*\*.js*) file.
3. In the JavaScript file, type the following function header.

   ```javascript copy
   function calculateDaysBetweenDates(begin, end) {
   ```

   GitHub Copilot will automatically suggest an entire function body in grayed text. The exact suggestion may vary.
4. To accept the suggestion, press <kbd>Tab</kbd>.

## Next steps

* **Find out more about Copilot inline suggestions** - See [Getting code suggestions in your IDE with GitHub Copilot](/en/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot).
* **Find out more about GitHub Copilot Chat** - See [Asking GitHub Copilot questions in your IDE](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide).
* **Learn how to write effective prompts** - See [Prompt engineering for GitHub Copilot Chat](/en/copilot/using-github-copilot/copilot-chat/prompt-engineering-for-copilot-chat).
* **Prompt like a pro** - Watch [Visual Studio Prompt Engineering with GitHub Copilot](https://www.youtube.com/watch?v=9hZsOeIINg8\&list=PLReL099Y5nRckZDdcQ21UigO9pKa14yxC) on YouTube.
* **Use Copilot on your mobile device** - See [Asking GitHub Copilot questions in GitHub Mobile](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-github-mobile).
* **Use Copilot on the command line** - See [About GitHub Copilot CLI](/en/copilot/concepts/agents/about-copilot-cli).
* **Configure Copilot in your editor** - You can enable or disable GitHub Copilot from within your editor, and create your own preferred keyboard shortcuts for Copilot. See [Configuring GitHub Copilot in your environment](/en/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment).

</div>

<!-- --------------------- -->

<!-- JetBrains -->

<!-- --------------------- -->

<div class="ghd-tool jetbrains">

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?](/en/copilot/about-github-copilot/what-is-github-copilot).

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

## Sign up for GitHub Copilot

<a href="https://github.com/copilot?ref_product=copilot&ref_type=engagement&ref_style=button&ref_plan=free" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Get started for free</span> <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-link-external" aria-label="link external icon" role="img"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a>

To use Copilot, you’ll need a personal GitHub account with access to a Copilot plan. You can:

* Start with Copilot Free to explore limited features without subscribing to a plan.
* Upgrade to Copilot Pro or Copilot Pro+ to unlock more features, models, and request limits.

For more information about the different plans for GitHub Copilot, see [Plans for GitHub Copilot](/en/copilot/about-github-copilot/subscription-plans-for-github-copilot).

## Prerequisites

* **Subscription to Copilot**. To use GitHub Copilot in a JetBrains IDE, you must have an active GitHub Copilot subscription. See [What is GitHub Copilot?](/en/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot).
* **A compatible JetBrains IDE**. Copilot is supported in a large number of JetBrains IDEs. For a full list, see [Asking GitHub Copilot questions in your IDE](/en/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide?tool=jetbrains).
* **Latest version of the GitHub Copilot extension**. See the [GitHub Copilot plugin](https://plugins.jetbrains.com/plugin/17718-github-copilot?ref_product=copilot\&ref_type=engagement\&ref_style=text) in the JetBrains Marketplace. For installation instructions, see [Installing the GitHub Copilot extension in your environment](/en/copilot/configuring-github-copilot/installing-the-github-copilot-extension-in-your-environment).
* **Sign in to GitHub in your JetBrains IDE**. For authentication instructions, see [Installing the GitHub Copilot extension in your environment](/en/copilot/configuring-github-copilot/installing-the-github-copilot-extension-in-your-environment?tool=jetbrains#installing-the-github-copilot-plugin-in-your-jetbrains-ide).

## Chat with GitHub Copilot

After you've installed the GitHub Copilot plugin, you can ask Copilot coding-related questions.

> \[!NOTE] If you have access to GitHub Copilot via your organization, you won't be able to use GitHub Copilot Chat if your organization owner has disabled chat. See [Managing policies and features for GitHub Copilot in your organization](/en/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization).

1. Open an existing code file.

2. Open the Copilot Chat window by clicking the **Copilot Chat** icon at the right side of the JetBrains IDE window.

   ![Screenshot of the Copilot Chat icon in the Activity Bar.](/assets/images/help/copilot/jetbrains-copilot-chat-icon.png)

3. In the Copilot Chat window, type `what does this file do` then press <kbd>Enter</kbd>.

   Copilot's answer is displayed below your question.

4. Select a line of code in the editor.

5. In the Copilot Chat window, type `explain this line` then press <kbd>Enter</kbd>.

## Get your first inline suggestion

The following example uses JavaScript, however other languages will work similarly. GitHub Copilot provides suggestions for numerous languages and a wide variety of frameworks, but works especially well for Python, JavaScript, TypeScript, Ruby, Go, C# and C++. GitHub Copilot can also assist in query generation for databases, generating suggestions for APIs and frameworks, and can help with infrastructure as code development.

1. In your JetBrains editor, create a new JavaScript (*\*.js*) file.
2. In the JavaScript file, type the following function header.

   ```javascript copy
   function calculateDaysBetweenDates(begin, end) {
   ```

   GitHub Copilot will automatically suggest an entire function body in grayed text. The exact suggestion may vary.
3. To accept the suggestion, press <kbd>Tab</kbd>.

## Next steps

* **Find out more about Copilot inline suggestions** - See [Getting code suggestions in your IDE with GitHub Copilot](/en/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot).
* **Find out more about GitHub Copilot Chat** - See [Asking GitHub Copilot questions in your IDE](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide).
* **Learn how to write effective prompts** - See [Prompt engineering for GitHub Copilot Chat](/en/copilot/using-github-copilot/copilot-chat/prompt-engineering-for-copilot-chat).
* **Use Copilot on your mobile device** - See [Asking GitHub Copilot questions in GitHub Mobile](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-github-mobile).
* **Use Copilot on the command line** - See [About GitHub Copilot CLI](/en/copilot/concepts/agents/about-copilot-cli).
* **Configure Copilot in your editor** - You can enable or disable GitHub Copilot from within your editor, and create your own preferred keyboard shortcuts for Copilot. See [Configuring GitHub Copilot in your environment](/en/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment).

</div>

<!-- --------------------- -->

<!-- XCode -->

<!-- --------------------- -->

<div class="ghd-tool xcode">

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?](/en/copilot/about-github-copilot/what-is-github-copilot).

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

## Sign up for GitHub Copilot

<a href="https://github.com/copilot?ref_product=copilot&ref_type=engagement&ref_style=button&ref_plan=free" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Get started for free</span> <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-link-external" aria-label="link external icon" role="img"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a>

To use Copilot, you’ll need a personal GitHub account with access to a Copilot plan. You can:

* Start with Copilot Free to explore limited features without subscribing to a plan.
* Upgrade to Copilot Pro or Copilot Pro+ to unlock more features, models, and request limits.

For more information about the different plans for GitHub Copilot, see [Plans for GitHub Copilot](/en/copilot/about-github-copilot/subscription-plans-for-github-copilot).

## Prerequisites

* **Subscription to Copilot**. To use GitHub Copilot in Xcode, you must have an active GitHub Copilot subscription. See [What is GitHub Copilot?](/en/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot).
* **Latest version of the GitHub Copilot extension**. For installation instructions, see [Installing the GitHub Copilot extension in your environment](/en/copilot/how-tos/set-up/install-copilot-extension?tool=xcode).
* **Sign in to GitHub in Xcode**. If you experience authentication issues, see [Troubleshooting common issues with GitHub Copilot](/en/copilot/troubleshooting-github-copilot/troubleshooting-issues-with-github-copilot-chat#troubleshooting-authentication-issues-in-your-editor).

## Chat with GitHub Copilot

After you've installed the GitHub Copilot plugin, you can ask Copilot coding-related questions.

> \[!NOTE] If you have access to GitHub Copilot via your organization, you won't be able to use GitHub Copilot Chat if your organization owner has disabled chat. See [Managing policies and features for GitHub Copilot in your organization](/en/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization).

1. Open an existing code file.

2. Click **Editor** in the menu bar, then click **GitHub Copilot** then **Open Chat**.

   Copilot Chat opens in a new window.

3. In the Copilot Chat window, select the file to indicate that you want to chat about this file.

   ![Screenshot of a file selected in the Chat window. The file is highlighted with a dark orange outline.](/assets/images/help/copilot/xcode-chat-about-file.png)

4. Type `what does this file do` then press <kbd>Enter</kbd>.

   Copilot's answer is displayed below your question.

5. Select a line of code in the editor.

6. In the Copilot Chat window, type `explain this line` then press <kbd>Enter</kbd>.

## Get your first inline suggestion

The following example uses Swift, however other languages will work similarly.

1. Create a new file called `CalculateDays.swift`.
2. Type the following code in the new file:

   ```swift copy
   import Foundation

   func calculateDaysBetweenDates(_ start: Date, _ end: Date)
   ```

   GitHub Copilot adds a suggestion of code that continues this function. Suggestions are displayed in grayed text.
3. To accept the suggestion, press <kbd>Tab</kbd>.
4. Copilot will continue to make suggestions, each of which you can accept by pressing <kbd>Tab</kbd>.

## Next steps

* **Find out more about Copilot inline suggestions** - See [Getting code suggestions in your IDE with GitHub Copilot](/en/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot).
* **Find out more about GitHub Copilot Chat** - See [Asking GitHub Copilot questions in your IDE](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide).
* **Learn how to write effective prompts** - See [Prompt engineering for GitHub Copilot Chat](/en/copilot/using-github-copilot/copilot-chat/prompt-engineering-for-copilot-chat).
* **Get familiar with next edit suggestions** - See [Navigating and accepting next edit suggestions](/en/copilot/how-tos/get-code-suggestions/get-ide-code-suggestions?tool=xcode#navigating-and-accepting-next-edit-suggestions-2).
* **Use Copilot on your mobile device** - See [Asking GitHub Copilot questions in GitHub Mobile](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-github-mobile).
* **Use Copilot on the command line** - See [About GitHub Copilot CLI](/en/copilot/concepts/agents/about-copilot-cli).
* **Configure Copilot in your editor** - You can enable or disable GitHub Copilot from within your editor, and create your own preferred keyboard shortcuts for Copilot. See [Configuring GitHub Copilot in your environment](/en/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment).

</div>

<!-- --------------------- -->

<!-- Eclipse -->

<!-- --------------------- -->

<div class="ghd-tool eclipse">

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?](/en/copilot/about-github-copilot/what-is-github-copilot).

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

## Sign up for GitHub Copilot

<a href="https://github.com/copilot?ref_product=copilot&ref_type=engagement&ref_style=button&ref_plan=free" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Get started for free</span> <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-link-external" aria-label="link external icon" role="img"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg></a>

To use Copilot, you’ll need a personal GitHub account with access to a Copilot plan. You can:

* Start with Copilot Free to explore limited features without subscribing to a plan.
* Upgrade to Copilot Pro or Copilot Pro+ to unlock more features, models, and request limits.

For more information about the different plans for GitHub Copilot, see [Plans for GitHub Copilot](/en/copilot/about-github-copilot/subscription-plans-for-github-copilot).

## Prerequisites

* **Subscription to Copilot**. To use GitHub Copilot in Eclipse, you must have an active GitHub Copilot subscription. See [What is GitHub Copilot?](/en/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot).
* **Latest version of the GitHub Copilot extension**. For installation instructions, see [Installing the GitHub Copilot extension in your environment](/en/copilot/how-tos/set-up/install-copilot-extension?tool=eclipse).
* **Sign in to GitHub in Eclipse**. If you experience authentication issues, see [Troubleshooting common issues with GitHub Copilot](/en/copilot/troubleshooting-github-copilot/troubleshooting-issues-with-github-copilot-chat#troubleshooting-authentication-issues-in-your-editor).

## Chat with GitHub Copilot

After you've installed the GitHub Copilot plugin, you can ask Copilot coding-related questions.

> \[!NOTE] If you have access to GitHub Copilot via your organization, you won't be able to use GitHub Copilot Chat if your organization owner has disabled chat. See [Managing policies and features for GitHub Copilot in your organization](/en/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization).

1. Open an existing code file.

2. In the menu bar of Eclipse, click **Copilot**, then click **<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-copilot" aria-label="copilot" role="img"><path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path></svg> Open Chat**.

3. In the Copilot Chat window, type `what does this file do` then press <kbd>Enter</kbd>.

   Copilot's answer is displayed below your question.

4. Select a line of code in the editor.

5. In the Copilot Chat window, type `explain this line` then press <kbd>Enter</kbd>.

## Get your first inline suggestion

The following example uses Java, however other languages will work similarly.

1. Create a new Java class called `CalculateDaysBetween`.
2. Within the class add the following comment:

   ```java copy
   // Take 2 dates and return the number of days between them
   ```

   GitHub Copilot adds a suggestion of code to use for this class. Suggestions are displayed in grayed text.
3. To accept the suggestion, press <kbd>Tab</kbd>.

## Next steps

* **Find out more about Copilot inline suggestions** - See [Getting code suggestions in your IDE with GitHub Copilot](/en/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot).
* **Find out more about GitHub Copilot Chat** - See [Asking GitHub Copilot questions in your IDE](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide).
* **Learn how to write effective prompts** - See [Prompt engineering for GitHub Copilot Chat](/en/copilot/using-github-copilot/copilot-chat/prompt-engineering-for-copilot-chat).
* **Get familiar with next edit suggestions** - See [Navigating and accepting next edit suggestions](/en/copilot/how-tos/get-code-suggestions/get-ide-code-suggestions?tool=eclipse#navigating-and-accepting-next-edit-suggestions-3).
* **Use Copilot on your mobile device** - See [Asking GitHub Copilot questions in GitHub Mobile](/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-github-mobile).
* **Use Copilot on the command line** - See [About GitHub Copilot CLI](/en/copilot/concepts/agents/about-copilot-cli).
* **Configure Copilot in your editor** - You can enable or disable GitHub Copilot from within your editor, and create your own preferred keyboard shortcuts for Copilot. See [Configuring GitHub Copilot in your environment](/en/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment).

</div>