Skip to main content

About building Copilot Extensions

Learn about the development process for Extensões do Copilot.

Quem pode usar esse recurso?

Qualquer pessoa com um plano do Copilot Pro, do Copilot Pro+ ou do Copilot Free pode usar o Extensões do Copilot.

Para organizações ou empresas com um plano do Copilot Business ou do Copilot Enterprise, proprietários de organização e administradores de empresa podem conceder acesso a Extensões do Copilot.

O Extensões do Copilot não está disponível para o GitHub Enterprise Server.

About Extensões do Copilot

Extensões do Copilot are integrations that expand the functionality of Copilot Chat, allowing developers to bring external tools, services, and custom behaviors into the Chat experience. You can use Extensões do Copilot to extend the capabilities of Copilot Chat in a variety of ways, including:

  • Querying documentation: A Extensão do Copilot can allow Copilot Chat to query a third-party documentation service to find information about a specific topic.
  • AI-assisted coding: A Extensão do Copilot can use a third-party AI model to provide code suggestions.
  • Data retrieval: A Extensão do Copilot can allow Copilot Chat to query a third-party data service to retrieve information about a specific topic.
  • Action execution: A Extensão do Copilot can allow Copilot Chat to execute a specific action, such as posting to a message board or updating a tracking item in an external system.

About building Extensões do GitHub Copilot

Extensões do GitHub Copilot are a type of Extensão do Copilot built with GitHub Apps. Extensões do GitHub Copilot are best suited for developers who want cross-platform compatibility and app management and support from GitHub.

Supported clients and IDEs

Clientes e IDEsSuporte para Extensões do GitHub Copilot
Visual Studio Code
Visual Studio.
GitHub.com
GitHub Mobile
IDEs JetBrains
GitHub Codespaces
Vim/Neovim
Copilot na CLI
Xcode

About visibility of Extensões do GitHub Copilot

Extensões do GitHub Copilot can be private, public and shareable, or public and listed on the GitHub Marketplace. Which visibility option you choose will depend on your use case and the audience you are targeting.

  • Private extensions are often preferred by large enterprises or companies that:
    • Want more customization and controls over data access
    • Need to integrate with a large volume of internal documents and databases
    • Have strict security policies making it difficult to authorize permissions for third-parties
  • Public extensions are suitable for:
    • Open-source projects
    • Collaborative development and use across organizations within an enterprise
    • Sharing your tool and getting feedback before publishing to the GitHub Marketplace
  • GitHub Marketplace extensions are ideal for third-parties that want to:
    • Offer their service to a broader audience
    • Integrate their tool into the developer workflow on GitHub and the IDE
    • Leverage the GitHub ecosystem to raise awareness for their product

About Extensões do GitHub Copilot permissions

As permissões variam de acordo com a extensão, dependendo do nível de autorização exigido pela extensão para responder à consulta. Você pode exibir as permissões necessárias na página de instalação da extensão, localizada após a etapa de informações de cobrança e antes da etapa de instalação e autorização.

Para desenvolvedores: no mínimo, as permissões do Copilot Chat devem ser definidas como "Somente leitura". Permissões adicionais podem incluir a execução de ações de gravação em outras superfícies, e a autorização de acesso de leitura a dados no nível da organização e do repositório no GitHub.

Para criadores: além do indicado acima, você também pode solicitar o contexto local de um editor do usuário para ajustar ainda mais as respostas. Para fazer isso, as permissões do Copilot Editor Context devem ser definidas como "Somente leitura". Os usuários serão notificados para fornecer a autorização necessária.

Para obter mais informações sobre as permissões do GitHub App, confira Escolhendo permissões para um Aplicativo GitHub

Granting permissions to access organization resources

Only organization admins can grant permissions for Extensões do Copilot to access organization resources. To grant organization members access:

  • The organization admin must install the extension.
  • The organization admin must grant the extension permission to access specific repositories.
  • The organization admin must authorize access for all, or specific repositories.

About skillsets and agents

Conjuntos de habilidades e agentes são as duas maneiras de estender as funcionalidades e o contexto do Copilotpor meio do Plataforma de Extensibilidade do Copilot. Eles permitem que você integre serviços externos e APIs ao Copilot Chat, mas cada um deles atende a diferentes casos de uso e oferece diferentes níveis de controle e complexidade:

  • Conjuntos de habilidades são leves e simplificados, projetados para desenvolvedores que precisam do Copilot para executar tarefas específicas (por exemplo, recuperação de dados ou operações simples) com configuração mínima. Eles lidam com roteamento, criação de prompts, avaliação de função e geração de resposta automaticamente, tornando-os ideais para integrações rápidas e simples. For more information about skillsets, see About skillsets for Copilot Extensions.
  • Agentes são para integrações complexas que precisam de controle total sobre como as solicitações são processadas e as respostas são geradas. Eles permitem que você implemente a lógica personalizada, integre-se a outras LLMs e/ou à API do Copilot, gerencie o contexto da conversa e lide com todos os aspectos da interação do usuário. Embora os Agentes exijam mais engenharia e manutenção, eles oferecem flexibilidade máxima para fluxos de trabalho sofisticados. Para saber mais sobre agentes, confira About agents for Copilot Extensions.

About context passing

You can allow your Extensão do Copilot to receive context from the editor, such as the currently opened file, by enabling the Read-only access level for the "Copilot Editor Context" permission in your GitHub App settings. See step 10 of Configuring your GitHub App.

The Plataforma de extensibilidade do GitHub Copilot automatically handles messaging when implicit and explicit context is unavailable or unauthorized. To enable context passing, you are required to request permissions from users. To enable context passing, you are required to:

  • Update your APIs to handle new reference types.
  • Request permissions from users. When requesting permissions, follow these best practices:
    • Clearly communicate what context you need and what you need it for.
    • Implement appropriate error handling for unavailable context that your own application logic and API calls.
    • If context is unavailable, provide value where possible without this data.
    • Request only the minimum required permissions for your extension.

Context passing respects content exclusions, which refers to any files listed in your context exclusion settings, including files that begin with ..

For more information about context passing, see Context passing for your agent.

Using APIs in Extensões do GitHub Copilot

Building Extensões do GitHub Copilot requires using the GitHub API. Optionally, the Copilot API can be used for additional capabilities. For details on request and response formatting, see the OpenAI API documentation.

Observação

The Copilot API is available for Extensão do Copilot builders, but only GitHub Apps and VS Code Chat extensions can be used to access these endpoints.

Resources for building Extensões do GitHub Copilot

GitHub provides a comprehensive toolkit for extension builders, with code samples, a CLI debugging tool, quickstart SDKs, and a user feedback repository. For more information, see the copilot-extensions organization on GitHub.

Before creating your own Extensão do GitHub Copilot from scratch, you may want to explore an existing Agente do Copilot, then integrate it with a GitHub App to see how it works. GitHub provides a few example Agentes do Copilot that you can clone and use as the basis for your own Extensão do GitHub Copilot:

  • Blackbeard: A simple Agente do Copilot that responds to requests like a pirate, using Copilot's LLM API and special system prompts. It is a good starting point for learning how to build a Extensão do GitHub Copilot. For more information, see the Blackbeard Extensão do Copilot.

  • GitHub Models: A more complex Agente do Copilot that lets you ask about and interact with various LLMs listed on the GitHub Marketplace from within Copilot Chat. For more information, see the GitHub Models Extensão do Copilot.

    Observação

    GitHub Models are in versão prévia pública and subject to change. To request access, join the waitlist.

  • Function calling: an example agent written in Go that demonstrates function calling and confirmation dialogues. For more information, see the Function calling extension.

  • RAG extension: an example agent written in Go that demonstrates a simple implementation of retrieval augmented generation. For more information, see the RAG extension.

  • Preview SDK: An SDK that simplifies the process of building Extensões do GitHub Copilot by handling request verification, response formatting, and API interactions. It allows builders to focus on their extension's core functionality rather than boilerplate, by streamlining the integration of tools, APIs, and data sources into Copilot Chat. For more information, see the Preview SDK.

About building Extensões do Visual Studio Code habilitadas pelo Copilot

Observação

The GitHub documentation focuses on building Extensões do GitHub Copilot, not Extensões do Visual Studio Code habilitadas pelo Copilot.

You can build a Extensão do Copilot that is exclusive and native to Visual Studio Code, called a Extensões do Visual Studio Code habilitadas pelo Copilot. This option is best suited for developers who want to build extensions that use VS Code-specific APIs and functionality, or extend existing VS Code extensions.

Also known as VS Code Chat extensions, Extensões do Visual Studio Code habilitadas pelo Copilot function similarly to Extensões do GitHub Copilot by extending the capabilities of Copilot Chat, with a few notable differences:

  • VS Code Chat extensions are only usable in VS Code.
  • VS Code Chat extensions have more access to VS Code's features and APIs, allowing more editor-specific interactions like accessing local workspace data, manipulating Visual Studio Code's interface, and read/write access to local files.
  • VS Code Chat extensions are published to the VS Code Marketplace, not the GitHub Marketplace.
  • VS Code Chat extensions are local to the user's machine, and cannot be controlled by an organization or enterprise's policies.

For more information on Extensões do Visual Studio Code habilitadas pelo Copilot, see Chat extensions in the Visual Studio Code documentation.

Further reading