In this blog post, I would like to discuss all of the latest features with GitHub Copilot. The feature list is constantly changing:
Some features are in Public Preview. Further, some preview features are locked behind waitlists
Some features are Generally Available (GA)
Some features are only available to specific Copilot subscription levels
Some features are only available in your IDE with the proper extensions or plugins installed. Further, some features are only available in specific IDEs.
Some features are only available on the GitHub.com website
Confused yet?
The purpose of this post is to go one-by-one through the GitHub Copilot features. For each, I'll give a quick summary and touch on some of the bullet points above. For most items, I'll also include some video links, from events like GitHub Universe 24 and Microsoft Ignite 24, as well as some great content created by Xebia.
One last piece of information that I would like to discuss before we get started are the types of Copilot subscriptions. Currently, there are 4 licenses: Copilot Free, Pro, Business, and Enterprise. Note that the Free license is fairly limited in what it can do. For a full breakdown of the licenses, please see the docs.
Table of Contents
Copilot Code Completion
Summary: This is the original feature set of Copilot. It's purpose is to give you AI-generated code completions and code suggestions. It will do things like:
Suggest a completion to your current line of code
Suggest an entirely new block of code based on context
Suggest new code based on a prompt that you enter in a comment
Support: It works inside your IDE once you have the necessary extension/plugin installed. Many IDEs are supported, including VS Code, Visual Studio, multiple JetBrains IDEs, Vim/Neovim, Azure Data Studio, and Xcode. However, Xcode support is in Public Preview.
Details: The context that is used by Copilot is based on:
The code found in the currently open file (so, make sure you use meaningful function names, good comments, etc.)
The code found in related files that are also open in your editor
Videos:
Links:
Fine-tuned Custom Models for Code Completions
This is an add-on, supplementary feature of Copilot Code Completions.
Summary: By default, Copilot Code Completions uses a LLM that is trained on a large number of public repos. But, what if your company uses proprietary programming languages, or languages that are not widely represented in public repos? What if your company uses custom-built internal libraries or frameworks? That's where using a fine-tuned custom model could be beneficial.
Support: Fine-tuned Custom Models are in Public Preview and locked behind a waitlist. Also, a Copilot Enterprise subscription is required. During the preview, only 1 Organization in your Enterprise is allowed to create a custom model.
Details: You can pick and choose the repos in your Org that will be used for training the custom model. Only the default branch of each repo will be used. You can refine the custom model even further, by optionally choosing which specific programming languages will be used for training the custom model.
Once the model has been fully trained, all users of that Organization will instantly start to use the new fine-tuned model for Copilot Code Completions.
The Custom Model is fully private. "The custom model’s training process, hosting and inferencing are secure and private to your organization. Your data always remains yours, is never used to train another customer’s model, and your custom model is never shared."
Videos:
Links:
Copilot Chat
Summary: Copilot Chat is an interface that lets you ask and receive answers to coding-related questions. Copilot Chat takes your provided inputs (both the context and the natural language prompt) and sends it to a LLM for processing. The LLM generates a response in the form of generated code, code suggestions, or explanations of existing code. Then, Copilot Chat will format the LLM's response (syntax highlighting, indentation, etc.) and present it to you, the user.
Support: Copilot Chat is available in multiple different applications:
It works inside your IDE once you have the necessary extension/plugin installed. The IDEs that are currently supported are VS Code, Visual Studio, and multiple JetBrains IDEs
It also works in GitHub.com and the GitHub Mobile app
Details: There are often multiple ways to access Copilot Chat, depending on your application. For example, when using VS Code in Windows here are 4 possible ways:
Chat View (ctrl+alt+i) which opens in a separate panel
Inline Chat (ctrl+i) which opens inline with your code
Quick Chat (ctrl+shift+alt+L) which opens in VS Code's command palette
Quick Actions, which you can access by right-clicking on a selection of code and choosing Copilot from the menu
There are multiple ways to supplement your context when using Copilot Chat. Using these along with your natural language prompt helps Copilot Chat to provide more accurate and useful responses. Support for these options varies across IDEs, GitHub.com, and GitHub Mobile.
Chat Participants / Extensions. These are represented by the @ symbol. I discuss Extensions in further detail below. Some examples:
The chat participant @workspace has information related to the code in your current IDE workspace
The extension @docker has all kinds of information about Docker products
Slash Commands help you define your intent. These are represented by the / symbol. These are used to represent common actions or scenarios. Each chat participant or extension may come with its own slash commands. Some examples:
/tests can be used when you want to generate unit tests
/explain can be used when you want an explanation for the given code
Chat Variables help you define your scope. These are represented by the # symbol. Some examples:
#file:someFile.yaml would attach the specified file to the Chat context
#selection would attach the currently selected code lines to the Chat context
You can also drag-and-drop whole files or folders onto the Chat to add them to your context
Videos:
Links:
Custom Instructions for Chat
This is an add-on, supplementary feature of Copilot Chat.
Summary: Do you find yourself adding the same custom context to every Copilot Chat prompt? Maybe its context about the way your team works, the tools you use, or some specifics about your project? Well, instead of repeatedly adding the same context to the chat, you can save yourself some time and include it in a Custom Instructions file.
Support: Custom Instructions are in Public Preview and only supported by Copilot Chat in specific IDEs (VS Code, Visual Studio). Note: make sure that Custom Instructions are enabled in the options menu of your IDE.
Details: Custom Instructions can be configured at the repo level. You must create a file called "copilot-instructions.md" in your repository's ".github" folder. In this file, you can add one or more custom instructions written in natural language. Copilot Chat will automatically read from this file and silently add the instructions to your chat's context.
Custom Instructions can also be configured globally, inside the settings of your IDE's Copilot Extension. See the videos below for more info.
Here are some example instructions:
We use Bazel for managing our Java dependencies, not Maven, so when talking about Java packages, always give me instructions and code samples that use Bazel.
We always write JavaScript with double quotes and tabs for indentation, so when your responses include JavaScript code, please follow those conventions.
Our team uses Jira for tracking items of work.
Videos:
Links:
Copilot Extensions for Chat
This is an add-on, supplementary feature of Copilot Chat.
Summary: Extensions let you use Copilot Chat to interact directly with external tools by using natural language prompts. Extensions can be installed from the GitHub Marketplace. You can create your own custom Extensions, as well as make them private so they are only usable by your team, if desired.
Support: Copilot Extensions are in Public Preview. Currently, Copilot Extensions are only supported in specific IDEs (VS Code, Visual Studio, and JetBrains IDEs), GitHub.com, and the GitHub Mobile App.
Details: As discussed above in the Copilot Chat section, extensions can be referenced in chat using the @ symbol. Extensions may come with one or more commands, which can be referenced in chat using the / symbol. For more details, see the documentation for your Extension.
Videos:
Links:
Copilot Knowledge Bases for Chat
This is an add-on, supplementary feature of Copilot Chat.
Summary: Knowledge Bases are a collection of documentation files, in Markdown format, from one or more of your repos. When you ask a question in Copilot Chat with a knowledge base selected as context, Copilot Chat will search the knowledge base for relevant information and generate a response.
Support: Copilot Knowledge Bases requires a Copilot Enterprise license. Currently, you can only reference knowledge bases when using Copilot Chat in specific IDEs (VS Code, Visual Studio), and in GitHub.com.
Details: You can pick and choose the repos that make up your knowledge base. They can be public, private, or internal repos. They can even be public repos outside of your Organization. Users will only be able to reference the knowledge base if they have at least read access to the repos where the Markdown files are stored. You can further restrict the knowledge base by specifying optional file paths, and only Markdown files from those paths will be used.
To use a knowledge base in Copilot Chat you must specify the @github chat participant as well as the #kb chat variable. You will then be prompted to select a knowledge base.
Note: Microsoft has created a Python library called MarkItDown that can be used to convert various types of files (pdf, pptx, docx, xlsx, and more) to Markdown. You can find a link to the MarkItDown repo below.
Links:
Copilot Content Exclusions
Summary: Content Exclusions can be used to tell Copilot to completely ignore specific files in both Copilot Code Completions and Copilot Chat. This has 3 different effects:
You will not be able to use Code Completions in these specified files
When using Code Completion in other files, Copilot won't be able to reference code from these specified files
Copilot Chat won't be able to reference the code from these specified files
Support: Copilot Content Exclusions requires a Copilot Business or Enterprise license. Support for Content Exclusions is quite varied, please see the docs for the full breakdown.
Details: Content Exclusions are configured per repo. You can configure it on a repo-by-repo basis by going into the Settings for each repo. Or, Content Exclusions can also be configured at the Organization level. In the Org-level configuration, you must specify every repo that you want to target, as well as the files to exclude for each repo.
Videos:
Links:
Copilot Edits
Summary: Copilot Edits is a new way to interact with Copilot Chat which lets you easily edit multiple files at once.
Support: Copilot Edits is a feature that's built into your IDE or your IDE's Copilot Extension. Right now, it is only supported in VS Code, and it is in Preview. Support for Visual Studio is coming soon.
Details: In Copilot Edits you specify a set of files to be edited (currently, up to 10 files), and then use natural language to ask Copilot what you need. Copilot Edits will make inline changes in your workspace across multiple files. The UI for Copilot Edits is designed for fast iteration. While reviewing the suggested changes, you can accept the changes that you are happy with, and iterate on the changes you are not by asking follow up questions.
Comparing the different ways to use Copilot Chat in VS Code:
Videos:
Links:
Copilot Code Reviews
Summary: Copilot Code Reviews allows Copilot to review and make comments on both your existing code and your pull requests.
Support & Details: Code Reviews is in Public Preview. Code Reviews is comprised of 3 different features, spread across specific IDEs and GitHub.com. Right now, IDE support is limited to just VS Code, but Visual Studio is coming soon. GitHub groups the features into 2 categories:
Review selection:
Available to all, and is not locked behind a waitlist.
Feature 1: in VS Code, you can highlight a selection of code and ask for Copilot to review the selection and make comments on it.
Supports all programming languages.
Does not support Coding Guidelines.
Review changes:
Currently locked behind a waitlist.
Feature 2: in VS Code, in the Source Control panel, you can ask for Copilot to review and make comments on all items under the "Changes" or "Staged Changes" headers.
Feature 3: on GitHub.com, you can add Copilot as a new reviewer to a pull request. It will then automatically make one or more comments on the PR with suggested changes.
Supports only specific programming languages. Please see the docs for details.
Supports Coding Guidelines.
Videos:
Links:
Coding Guidelines for Code Review
This is an add-on, supplementary feature of Copilot Code Reviews.
Summary: You can create custom coding guidelines written in natural language. When Copilot Code Reviews makes new code suggestions it will make sure to adhere to the guidelines that you specify.
Support: Coding Guidelines are in Public Preview and locked behind the same waitlist as Code Reviews. Also, a Copilot Enterprise subscription is required. Coding Guidelines are only supported by the features in the "Review changes" category of Code Reviews.
Details: Coding Guidelines can describe your organization's specific coding style and best practices. It is best to create Coding Guidelines with rules that are not already covered by your linter or static analysis tool.
Coding Guidelines are configured per repo. You can enable up to 6 Coding Guidelines per repo. Here are some example guidelines:
Don't use magic numbers in code. Numbers should be defined as constants or variables with meaningful names.
Don't use `SELECT` in SQL queries. Always specify the columns you want to select. `COUNT()` is allowed.
Use `fetch` for HTTP requests, not `axios` or `superagent` or other libraries.
Videos:
Links:
Copilot Workspace
Summary: Copilot Workspace is a task-oriented, in-browser development environment. Copilot Workspace helps you plan and author a coordinated set of changes to one or more files in your repo. This even includes changes that add or remove files to your repo.
Support: Copilot Workspace is in Technical Preview. Copilot Workspace has a web dashboard hosted on its own unique URL. There is also a VS Code extension for interacting with Workspace tasks from your IDE.
Details: Copilot Workspace is a "task-centric" dev environment. You define tasks for a repo (using natural language), work on them, and iterate on them with AI. Copilot Workspace currently makes use of 5 different AI agents: Brainstorm, Spec, Plan, Implement, and Build & Repair. You can define or begin a task using one of the following entry points:
On a GitHub Issue, you can click on "Open in Workspace". This will open the issue within Copilot Workspace, and begin analyzing how to solve it.
On a GitHub Pull Request, you can click on "Open in Workspace". This will open the PR within Copilot Workspace, displaying an overview of the PR, as well as opening all of the files modified by the PR. From there, you can update and change multiple files before committing your changes.
This requires access to the Copilot Code Reviews waitlist.
Create an ad-hoc Copilot Workspace task. This can done from either the Copilot Workspace Dashboard, or directly from a repo.
Videos:
Links:
Copilot Summaries on GitHub.com
Summary: Copilot can be used in various ways on GitHub.com to provide you with auto-generated summaries. You can summarize things like GitHub Issues, GitHub Discussions, and GitHub Pull Requests.
Support: These features are only usable only on GitHub.com.
Details: For Issue Summaries, simply go to the Issue in question and click the Summarize button. Discussion Summaries work in the exact same way.
For PR Summaries, Copilot will scan through the PR and provide an overview of the changes made, as well as a bulleted list of changes with the files that they impact. You can generate a summary in the following places:
In the description of a new PR you're creating
In the description of an existing PR, by editing the original comment
In a new comment on the main timeline of a PR
Note: you can accomplish a similar thing in VS Code with the GitHub PR extension. Just create a PR inside VS Code, then use the "sparkle" icon on the PR panel to generate a summary with Copilot. However, this method won't always match the same format and style as using the GitHub.com method outlined above.
Videos:
Links:
Copilot Secret Scanning
Summary: Copilot Secret Scanning can help you in 2 specific ways. One, it identifies unstructured secrets (passwords) in your source code and generates alerts. Two, it can help you generate regular expressions which can be used as custom patterns in Secret Scanning.
Support: Your repo must be in an Organization using GitHub Enterprise Cloud, and it must have GitHub Advanced Security enabled.
Details: Unstructured secrets are not easily discoverable. Copilot Secret Scanning uses LLMs to identify this type of secret. If secrets are detected they are surfaced as alerts on the secret scanning alerts page. But, they are displayed in an additional list that is separate from regular secret scanning alerts. Secret Scanning has a few limitations, please see the docs.
For help generating regular expressions, you can go to the existing Custom Pattern page. From there, you can launch a generative AI experience where you input a text description of the pattern you would like to detect. Optionally, you can also include any example strings that should be detected. Then you will get some matching regular expressions in return for you to choose from.
Videos:
Links:
Copilot Autofix
Summary: First, let's discuss CodeQL. CodeQL is the code analysis engine developed by GitHub to automate security checks. You can analyze your code using CodeQL and the results will be displayed as code scanning alerts. Copilot Autofix will help you fix these code scanning alerts automatically. It does this by using an LLM to generate suggested code fixes for each alert.
Support: Your repo must be in an Organization using GitHub Enterprise Cloud, and it must have GitHub Advanced Security enabled. Alternatively, Copilot Autofix is free for all public repositories on GitHub.com. Copilot Autofix supports a specific list of programming languages: C#, C/C++, Go, Java/Kotlin, Swift, JavaScript/TypeScript, Python, and Ruby.
Details: No user interaction is needed beyond enabling code scanning on the codebase and creating a PR. The fixes generated by Copilot Autofix are displayed as comments on your PR showing both code suggestions and a natural language description of the fix. From there, you can choose to commit the fix directly to your PR, or you can edit the suggested fix if you need to make changes.
Videos:
Links:
Copilot Autofix for Partners
This is an add-on, supplementary feature of Copilot Autofix.
Summary: Originally, Copilot Autofix only supported GitHub's own CodeQL scanning tool. Wouldn't it be nice if Copilot Autofix also supported other 3rd-party scanning tools and provided automatic fixes for the alerts generated by those tools?
Support: Same requirements as Copilot Autofix. Copilot Autofix for Partners is in Public Preview. Right now, the only supported tool is ESLint. But, there are more coming soon, such as JFrog SAST, and Black Duck's Polaris platform.
Videos:
Copilot Autofix for Dependabot
This is an add-on, supplementary feature of Copilot Autofix.
Summary: First, let's discuss Dependabot. Dependabot will alert you when it finds a dependency that contains known security vulnerabilities, and it will also open a PR to update that dependency to a secure version. But, what if Dependabot recommends a new "major" version of that dependency? Major versions will often contain breaking changes which require you to update your code in order to use it. That's where Copilot Autofix for Dependabot comes in to help. It will suggest the necessary code changes that are required in your project to support the new major version of the dependency.
Support: Same requirements as Copilot Autofix. Copilot Autofix for Dependabot is in Public Preview and locked behind a waitlist. Right now, TypeScript is the only supported language.
Details: Copilot Autofix for Dependabot will make comments directly on the Dependabot-created PR. The fixes are displayed as comments on your PR showing both code suggestions and a natural language description of the fix. From there, you can choose to commit the fix directly to your PR, or you can edit the suggested fix if you need to make changes.
Videos:
Copilot Extension for GitHub CLI
Summary: Have you ever wondered how to run a complicated Git command, or a PowerShell command, or even a GitHub CLI command? Have you ever looked at a script and found a complex command and wondered what in the heck is this doing? Well, in these scenarios Copilot for GitHub CLI can help out. It will offer explanations and suggestions for commands from common shells (such as bash, powershell, command prompt), from the GitHub CLI itself (gh), and from the Git CLI.
Support: You must install the GitHub CLI as well as the extension for Copilot.
Details: There are 2 main commands you can run:
gh copilot explain
Use this if you'd like Copilot to explain a CLI command to you
An example: gh copilot explain "sudo apt-get"
It will return an explanation of the given command using natural language
gh copilot suggest
Use this if you don't know the exact CLI command that you need to run and you want Copilot to tell you one. Just describe the command you'd like to run, using natural language, and Copilot will respond with a suggested command
An example: gh copilot suggest "Undo the last commit"
After submitting your prompt, you might be asked to select if you want to return a shell command, a GitHub CLI command, or a Git command. This helps to provide more context to Copilot.
You'll get a response showing you a command that matches your prompt
From there, you can execute the command, copy it to the clipboard, ask for an explanation of the command, or even revise the command further
Videos:
Links:
Windows Terminal Chat
Summary: Windows Terminal can connect with your preferred AI service. Once connected, you can use Windows Terminal Chat to ask questions about shell commands (PowerShell, CMD, WSL Ubuntu, Azure Cloud Shell, etc) all while staying in the context of your terminal.
This is quite similar to the Copilot Extension for GitHub CLI in that there are 2 main ways of using it: to explain a command and to suggest a command.
Support: This is an experimental feature, and only available in the Canary builds of Windows Terminal. Currently, there are 3 supported AI services that you can connect to: GitHub Copilot, Azure OpenAI, or OpenAI.
Details: Terminal Chat will automatically add the name of your current shell to the context. So, you'll get different responses based on the type of shell you're using.
Some useful things that Terminal Chat can do:
Send code suggestions to your shell so that you can run them
Send code suggestions to any command-line text editors that are currently open
Links:
Comments