This is a simple GitHub Copilot Chat extension that simply echo's what you say. This sample is developed using Node.js and is to be deployed in Azure Functions. Also see:
Tip
This extension is inspired by the basic tutorial video from @ambilykk. Do check it out!
Pre-requisites:
- Azure Function Pre-requisites: check out the official documentation
- GitHub Debug CLI: see gh debug-cli
Run the app locally:
npm install
npm start #or `func start`
In a new terminal, use the gh debug-cli
:
export URL="http://localhost:7071/api/ghcp-message" #if using Windows Command Prompt, use `set` instead of `export`
gh debug-cli
- Open the project in VS Code
- Sign in to Azure:
CTRL/Cmd + Shift + P
>Azure: Sign In
CTRL/Cmd + Shift + P
>Azure Functions: Deploy to Function App
- Go to your GitHub Profile → Settings → Developer settings → New GitHub App
- Fill in the some initial values:
- the GitHub App name is going to be the
@agentname
that you'll use in the GH Copilot Chat - for test purposes, you may disable/uncheck "Request user authorization (OAuth) during installation"
- Click Copilot from the navigation bar on the left
- Change App Type to Agent
- Change URL to the Function URL of your Azure Function
- Change Inference description to the message you want your users to see on the chat box
- In GitHub.com, open the GitHub Copilot Chat window
- Type your
@app-name Hi!
and hit ENTER (Note: The agent won't show up until you do this for the first time) - Start chatting!