Skip to content

Instantly share code, notes, and snippets.

@jitran
Created October 18, 2024 06:45
Show Gist options
  • Save jitran/cc85dae6d0877870a4d2c806f35eb2a1 to your computer and use it in GitHub Desktop.
Save jitran/cc85dae6d0877870a4d2c806f35eb2a1 to your computer and use it in GitHub Desktop.
Copilot Extension Demo: Blackbeard

Blackbeard Extension Demo

The following is a quick summary of About Copilot agents.

1. Using a demo agent

Reference

git clone https://github.com/copilot-extensions/blackbeard-extension.git

cd blackbeard-extension

npm install

npm start

2. Configuring your server to deploy your Copilot agent

Reference

Setup ngrok https://dashboard.ngrok.com/get-started/setup/macos

brew install ngrok/ngrok/ngrok

ngrok config add-authtoken <TOKEN>

ngrok http http://localhost:3000

Output:

# Web interface: http://127.0.0.1:4040
#   This provides indepth details of all the requests to your agent
# Forwarding:	https://<hostname>.ngrok-free.app -> http://localhost:3000
#   Public endpoint detail
#   See https://dashboard.ngrok.com/endpoints
# HTTP Requests
#   All requests made to this agent

Using Codespaces to host your endpoint publicly

Access https://github.com/copilot-extensions/blackbeard-extension/codespaces and create a new codespace.

From the VSCode Terminal, run:

npm install
npm start

Codespaces will ask if you'd like to make your endpoint public. Select Make Public.

Click on the Ports tab and copy the Forwarded Address value.

This will be your Copilot agent URL.

3. Creating a GitHub App for your Copilot Extension

Reference

Go to https://github.com/settings/apps/new

4. Configuring your GitHub App for your Copilot agent

Reference

Go to https://github.com/settings/apps/<app-name>

  • Callback URL: https://<hostname>.ngrok-free.app
  • Save changes

Go to https://github.com/settings/apps/<app-name>/permissions > Account permissions

  • Copilot Chat: Read-only
  • Save changes

Go to https://github.com/settings/apps/<app-name>/agent

  • App Type: Agent
  • URL: https://<hostname>.ngrok-free.app
  • Inference description: Blackbeard agent

Go to https://github.com/settings/apps/<app-name>/installations

  • Install it into your account

5. Try the extension!

Open Copilot chat

Type @<app-name>

Authorise the app

Now type @<app-name> <question | statement>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment