Skip to content

Commit

Permalink
Merge pull request github#34734 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Sep 25, 2024
2 parents 707df89 + 5b40a11 commit 9dcf861
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 201 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Generally, we name our supported ecosystems after the software programming langu
* Go (registry: https://pkg.go.dev/)
* GitHub Actions (https://github.com/marketplace?type=actions/)
* Maven (registry: https://repo.maven.apache.org/maven2)
* npm (registry: https://www.npmjs.com/)
* Npm (registry: https://www.npmjs.com/)
* NuGet (registry: https://www.nuget.org/)
* pip (registry: https://pypi.org/)
* pub (registry: https://pub.dev/packages/registry)
* Pip (registry: https://pypi.org/)
* Pub (registry: https://pub.dev/packages/registry)
* RubyGems (registry: https://rubygems.org/)
* Rust (registry: https://crates.io/)
* Swift (registry: N/A)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: Debugging your GitHub Copilot Extension
intro: 'Learn how to debug your {% data variables.product.prodname_copilot_extension %} from the command line before you publish it.'
versions:
feature: copilot-extensions
topics:
- Copilot
shortTitle: Debug Copilot Extension
---

{% data reusables.copilot.copilot-extensions.beta-note %}

With the debug tool for {% data variables.product.prodname_copilot_extensions_short %}, you can chat with your {% data variables.product.prodname_copilot_agent_short %} from the command line, then view detailed logs as your agent generates a response. You can pass several flags to the tool, with the most important flags being:
* The `url` flag, which contains the URL to access your {% data variables.product.prodname_copilot_agent_short %}. This is the only required flag to start the tool.
* The `log-level` flag, which determines the level of visibility you have into your {% data variables.product.prodname_copilot_agent_short %}'s process for generating a response. The available log levels are `DEBUG`, `NONE`, and `TRACE`, and the tool uses `DEBUG` by default.
* The `token` flag, which must contain a {% data variables.product.pat_v2 %} with read access to {% data variables.product.prodname_copilot_chat_short %} if your {% data variables.product.prodname_copilot_agent_short %} calls the {% data variables.product.prodname_copilot_short %} LLM. If your agent calls a different LLM, you don't need to use this flag.

## Prerequisites

To use the debug tool, you need to have the {% data variables.product.prodname_cli %} installed on your machine. You can install the {% data variables.product.prodname_cli %} in one of two ways:
* From the command line using a package manager. For example, to install the {% data variables.product.prodname_cli %} with Homebrew, paste the following command to the command line, then follow the prompts:

```bash copy
brew install gh
```

* From the [{% data variables.product.prodname_cli %} releases page](https://github.com/cli/cli/releases/tag/v2.56.0)

## Debugging your {% data variables.product.prodname_copilot_extension_short %} with the CLI

1. Optionally, to prepare to debug a specific server-sent event (SSE), add some code to your {% data variables.product.prodname_copilot_agent_short %} that sends an SSE when a prompt contains a certain keyword.

> [!NOTE] The debug tool does not handle the payload verification process. To validate your SSEs, you need to temporarily disable payload verification for local testing, then re-enable it after you have successfully tested your extension.

1. On the command line, start your {% data variables.product.prodname_copilot_agent_short %}.
1. To authenticate with the {% data variables.product.prodname_cli %} {% data variables.product.prodname_oauth_app %}, in a new window of your command line application, paste the following command and follow the prompts:

```bash copy
gh auth login --web -h github.com
```

1. In the same window, to install the debug tool, paste the following command:

```bash copy
gh extension install github.com/copilot-extensions/gh-debug-cli
```

1. Optionally, for a list of available flags and their descriptions, paste the following command to the command line:

```bash copy
gh debug-cli -h
```

1. Optionally, set environment variables for each flag you want to use. Environment variables allow you to set a constant value for a flag rather than passing a value in each time you run the debug tool. For example, if you are using the Blackbeard extension to test the debug tool, you can create an environment variable for the agent URL as follows:

```bash copy
export URL="http://localhost:3000"
```

> [!NOTE] To set an environment variable for a flag, you must use the name of the flag in all caps.

1. To start the debug tool, paste the following command to the command line, adding any flags you want to use:

```bash copy
gh debug-cli
```

The only required flag is the `url` flag, but you will likely want to use additional flags like `log-level` and `token`.

Once the debug tool is running, you should see a message that reads "Start typing to chat with your assistant...".

1. To interact with your agent, enter a prompt on the command line. The output will vary based on the log level you chose in the previous step, with the `DEBUG` and `TRACE` log levels providing more detailed information.

> [!TIP] If you are debugging an SSE, send a prompt containing the keyword you specified in your {% data variables.product.prodname_copilot_agent_short %} to trigger the SSE, then analyze the output in your command line application.
1 change: 1 addition & 0 deletions content/copilot/building-copilot-extensions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ children:
- /setting-up-copilot-extensions
- /building-a-copilot-agent-for-your-copilot-extension
- /creating-a-copilot-extension
- /debugging-your-github-copilot-extension
- /managing-the-availability-of-your-copilot-extension
- /copilot-extensions-glossary
---
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ Available {% data variables.product.prodname_dotcom %}-hosted runner labels are:
<tbody>
<tr>
<td>
<code>ubuntu-latest</code>,<code>ubuntu-24.04</code> [Beta], <code>ubuntu-22.04</code>, <code>ubuntu-20.04</code>
<code>ubuntu-latest</code>,<code>ubuntu-24.04</code>, <code>ubuntu-22.04</code>, <code>ubuntu-20.04</code>
</td>
<td>
The <code>ubuntu-latest</code> label currently uses the Ubuntu 22.04 runner image.
The <code>ubuntu-latest</code> label currently uses the Ubuntu 24.04 runner image.
</td>
</tr>
<tr>
Expand All @@ -82,7 +82,7 @@ The <code>windows-latest</code> label currently uses the Windows 2022 runner ima
</tr>
<tr>
<td>
<code>macos-latest</code>, <code>macos-14</code>, <code>macos-13</code>, <code>macos-12</code>
<code>macos-latest</code>, <code>macos-15</code> [Beta], <code>macos-14</code>, <code>macos-13</code>, <code>macos-12</code>
</td>
<td>
The <code>macos-latest</code> workflow label currently uses the macOS 14 runner image.
Expand Down
8 changes: 4 additions & 4 deletions data/reusables/actions/larger-runners-table.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| Runner Size | Architecture| Processor (CPU)| Memory (RAM) | Storage (SSD) | Workflow label |
| ------------| ------------| -------------- | ------------- | ------------- | -------------- |
| Large | Intel | 12 | 30 GB | 14 GB | <code>macos-latest-large</code>, <code>macos-12-large</code>, <code>macos-13-large</code> , <code>macos-14-large</code> [latest] |
| XLarge | arm64 (M1) | 6 (+ 8 GPU hardware acceleration) | 14 GB | 14 GB | <code>macos-latest-xlarge</code>, <code>macos-13-xlarge</code>, <code>macos-14-xlarge</code> [latest] |
| Runner Size | Architecture| Processor (CPU)| Memory (RAM) | Storage (SSD) | Workflow label |
| ------------| ------------| -------------- | ------------- | ------------- |--------------------------------------------------------------------------------------------------------------------------------------------------|
| Large | Intel | 12 | 30 GB | 14 GB | <code>macos-latest-large</code>, <code>macos-12-large</code>, <code>macos-13-large</code>, <code>macos-14-large</code> [latest], <code>macos-15-large</code> [Beta] |
| XLarge | arm64 (M1) | 6 (+ 8 GPU hardware acceleration) | 14 GB | 14 GB | <code>macos-latest-xlarge</code>, <code>macos-13-xlarge</code> , <code>macos-14-xlarge</code> [latest], <code>macos-15-xlarge</code> [Beta] |
Loading

0 comments on commit 9dcf861

Please sign in to comment.