Once you have configured your server and created your GitHub App, you need to configure your GitHub App for use with your Copilot extension.
Prerequisites
- You have configured your server to deploy your Copilot 扩展, and you have your hostname (aka forwarding endpoint). For more information, see Configuring your server to host your Copilot extension.
- You have created a GitHub App for your Copilot extension. For more information, see Creating a GitHub App for your Copilot Extension.
Configuring your GitHub App
-
在 GitHub 上任意页的右上角,单击你的个人资料照片。
-
导航到你的帐户设置。
- 对于由个人帐户拥有的应用,请单击“设置”****。
- 对于组织拥有的应用:
- 单击“你的组织”。
- 在组织的右侧,单击设置。
- 对于由企业拥有的应用:
- 如果使用的是 Enterprise Managed Users,请单击你的企业,以直接转到企业帐户设置。
- 如果使用的是个人帐户,请单击你的企业,然后单击企业右侧的设置。
-
导航到 GitHub App 设置。
- 对于由个人帐户或组织拥有的应用:
- 在左侧边栏中,单击 开发人员设置,然后单击 GitHub Apps。
- 对于由企业拥有的应用:
- 在左侧边栏中,在“设置”下,单击 GitHub Apps。
- 对于由个人帐户或组织拥有的应用:
-
To the right of the GitHub App you want to configure for your Copilot 扩展, click Edit.
-
In the "Identifying and authorizing users" section, under "Callback URL", enter your callback endpoint URL, then click Save changes.
注意
Your server's hostname is the forwarding endpoint that you copied from your terminal when you configured your server. See Configuring your server to host your Copilot extension.
If you are using an ephemeral domain in ngrok, you will need to update this URL every time you restart your ngrok server.
-
In the left sidebar, click Permissions & events.
-
To expand the "Account permissions" section, click anywhere in the section.
-
在“GitHub Copilot Chat”行中,选择“Access:”下拉菜单,然后单击“Read-only”********。
-
若要启用上下文传递,请在“Copilot Editor Context”行中,选择“Access:”下拉菜单,然后单击“Read-only”********。 有关上下文传递的详细信息,请参阅“Context passing for your agent”。
-
单击“保存更改”。
-
In the left sidebar, click Copilot.
-
Read the GitHub Marketplace Developer Agreement and the GitHub Pre-release License Terms, then accept the terms for creating a Copilot 扩展.
-
In the "App type" section, select the dropdown menu, then click Agent.
-
Under "URL," enter your server's hostname (aka forwarding endpoint) that you copied from your terminal.
注意
If you are using an ephemeral domain in ngrok, you will need to update this URL every time you restart your ngrok server.
-
Under "Inference description", type a brief description of your agent, then click Save. This will be the description users see when they hover over your extension's slug in the chat window.
-
Your pre-authorization URL is a link on your website that starts the authorization process for your extension. Users will be redirected to this URL when they decide to authorize your extension. If you are using a pre-authorization URL, under "Pre-authorization URL," enter the URL, then click Save.
-
In your GitHub App settings, in the left sidebar, click Install App, then, next to the account you want to install your app on, click Install.
-
在 GitHub 上任何页面的右上角,单击搜索栏旁边的 GitHub Copilot 图标****。
此时将显示 GitHub Copilot Chat 面板。 要调整面板的大小,请单击并拖动顶部或左侧边缘。
-
如果面板包含与 Copilot 的前一次对话,请单击面板右上角的“新建对话”图标(加号)。
-
Invoke your extension by typing
@EXTENSION-NAME
, replacing any spaces in the extension name with-
, then pressEnter
. -
If this is your first time using the extension, you will be prompted to authenticate. Follow the steps on screen to authenticate your extension.
-
Ask your extension a question in the chat window. For example,
What is the software development lifecycle?
.
-
在 GitHub 上任意页的右上角,单击你的个人资料照片。
-
导航到你的帐户设置。
- 对于由个人帐户拥有的应用,请单击“设置”****。
- 对于组织拥有的应用:
- 单击“你的组织”。
- 在组织的右侧,单击设置。
- 对于由企业拥有的应用:
- 如果使用的是 Enterprise Managed Users,请单击你的企业,以直接转到企业帐户设置。
- 如果使用的是个人帐户,请单击你的企业,然后单击企业右侧的设置。
-
导航到 GitHub App 设置。
- 对于由个人帐户或组织拥有的应用:
- 在左侧边栏中,单击 开发人员设置,然后单击 GitHub Apps。
- 对于由企业拥有的应用:
- 在左侧边栏中,在“设置”下,单击 GitHub Apps。
- 对于由个人帐户或组织拥有的应用:
-
To the right of the GitHub App you want to configure for your Copilot 扩展, click Edit.
-
In the "Identifying and authorizing users" section, under "Callback URL", enter your callback endpoint URL, then click Save changes.
注意
Your server's hostname is the forwarding endpoint that you copied from your terminal when you configured your server. See Configuring your server to host your Copilot extension.
If you are using an ephemeral domain in ngrok, you will need to update this URL every time you restart your ngrok server.
-
In the left sidebar, click Permissions & events.
-
To expand the "Account permissions" section, click anywhere in the section.
-
在“GitHub Copilot Chat”行中,选择“Access:”下拉菜单,然后单击“Read-only”********。
-
若要启用上下文传递,请在“Copilot Editor Context”行中,选择“Access:”下拉菜单,然后单击“Read-only”********。 有关上下文传递的详细信息,请参阅“Context passing for your agent”。
-
单击“保存更改”。
-
In the left sidebar, click Copilot.
-
Read the GitHub Marketplace Developer Agreement and the GitHub Pre-release License Terms, then accept the terms for creating a Copilot 扩展.
-
In the "App type" section, select the dropdown menu, then click Skillset.
-
Your pre-authorization URL is a link on your website that starts the authorization process for your extension. Users will be redirected to this URL when they decide to authorize your extension. If you are using a pre-authorization URL, under "Pre-authorization URL," enter the URL, then click Save.
-
对于你想要添加的每项技能(最多 5 项):
- 单击“Add new skill”****。
- 为技能输入一个清晰的名称(例如“Generate Lorem Ipsum Data”)。****
- 编写一个详细的推理描述,以帮助 Copilot 理解何时使用该技能****。
- 添加将接收 POST 请求的 API 终结点 URL****。
- 在“Parameter”字段中,添加定义预期请求格式的 JSON 架构****。
- 单击“Add Definition”以保存技能****。
-
单击“Save”以保存技能集****。
-
In your GitHub App settings, in the left sidebar, click Install App, then, next to the account you want to install your app on, click Install.
-
在 GitHub 上任何页面的右上角,单击搜索栏旁边的 GitHub Copilot 图标****。
此时将显示 GitHub Copilot Chat 面板。 要调整面板的大小,请单击并拖动顶部或左侧边缘。
-
如果面板包含与 Copilot 的前一次对话,请单击面板右上角的“新建对话”图标(加号)。
-
Invoke your extension by typing
@EXTENSION-NAME
, replacing any spaces in the extension name with-
, then pressEnter
. -
If this is your first time using the extension, you will be prompted to authenticate. Follow the steps on screen to authenticate your extension.
-
Ask your extension a question in the chat window. For example,
What is the software development lifecycle?
.