Skip to content

Instantly share code, notes, and snippets.

@iliakan
Forked from 0xdevalias/_gh-cli-copilot-api.md
Created January 7, 2024 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iliakan/43eb52d9aa77ec4f8fa941a44c55542d to your computer and use it in GitHub Desktop.
Save iliakan/43eb52d9aa77ec4f8fa941a44c55542d to your computer and use it in GitHub Desktop.
Some notes and references while exploring the GitHub CLI extension for the GitHub Copilot CLI

GitHub Copilot CLI API

Some notes and references while exploring the GitHub CLI extension for the GitHub Copilot CLI.

Table of Contents

Deep Dive

The GitHub CLI allows extensions to be installed into it:

The GitHub Copilot CLI is one of these extensions, which is a compiled Golang binary, and at the time of writing, not open-source:

  • https://github.com/github/gh-copilot
    • GitHub Copilot in the CLI GitHub Copilot in the CLI is an extension for GitHub CLI which provides a chat-like interface in the terminal that allows you to ask questions about the command line. You can ask Copilot in the CLI to suggest a command for your use case with gh copilot suggest, or to explain a command you're curious about with gh copilot explain.

The GitHub CLI can be configured with various environment variables, one of which is GH_DEBUG, which when set to api, will log details of HTTP traffic:

We can use that to see the API calls being made by the gh-copilot extension.

The gh-copilot CLI extension has 2 main features: suggest, and explain

⇒ gh copilot -h
Your AI command line copilot.

Usage:
  copilot [command]

Examples:

$ gh copilot suggest "Install git"
$ gh copilot explain "traceroute github.com"


Available Commands:
  config      Configure options
  explain     Explain a command
  suggest     Suggest a command

Flags:
  -h, --help      help for copilot
  -v, --version   version for copilot

Use "copilot [command] --help" for more information about a command.

The help docs for suggest are as follows:

⇒ gh copilot suggest -h
Suggest a command based on a natural language description of the desired output effect.

There is no task too small or too large to need help when working in the terminal, the only limit is your imagination:

- installing and upgrading software
- troubleshooting and debugging problems with your system
- processing and manipulating files
- working with git and GitHub in the terminal

Usage:
  copilot suggest [flags]

Examples:

- Guided experience
  $ gh copilot suggest

- Git use cases
  $ gh copilot suggest -t git "Undo the most recent local commits"
  $ gh copilot suggest -t git "Clean up local branches"
  $ gh copilot suggest -t git "Setup LFS for images"

- Working with the GitHub CLI in the terminal
  $ gh copilot suggest -t gh "Create pull request"
  $ gh copilot suggest -t gh "List pull requests waiting for my review"
  $ gh copilot suggest -t gh "Summarize work I have done in issues and pull requests for promotion"

- General use cases
  $ gh copilot suggest -t shell "Kill processes holding onto deleted files"
  $ gh copilot suggest -t shell "Test whether there are SSL/TLS issues with github.com"
  $ gh copilot suggest -t shell "Convert SVG to PNG and resize"
  $ gh copilot suggest -t shell "Convert MOV to animated PNG"


Flags:
  -h, --help            help for suggest
  -t, --target target   Target for suggestion; must be shell, gh, git

The help docs for explain are as follows:

⇒ gh copilot explain -h
Explain a given input command in natural language.

Did you ever wonder what a command does? Or why it was suggested to you? Now you can find out!

Usage:
  copilot explain [flags]

Examples:

# View disk usage, sorted by size
$ gh copilot explain 'du -sh | sort -h'

# View git repository history as text graphical representation
$ gh copilot explain 'git log --oneline --graph --decorate --all'

# Remove binary objects larger than 50 megabytes from git history
$ gh copilot explain 'bfg --strip-blobs-bigger-than 50M'


Flags:
  -h, --help   help for explain

Since explain is simpler, let's start with that.

GH_DEBUG=api gh copilot explain

Running with GH_DEBUG=api, we can see the API calls being made when we run gh copilot explain.

First we will try an example where we don't find an explanation:

⇒ GH_DEBUG=api gh copilot explain 'this will not be found'

We see that a new chat thread is created by making a POST request to https://api.githubcopilot.com/github/chat/threads:

* Request at 2023-11-27 18:13:37.116072 +1100 AEDT m=+0.116938413
* Request to https://api.githubcopilot.com/github/chat/threads
> POST /github/chat/threads HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 2
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{}

< HTTP/2.0 201 Created
< Content-Length: 235
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:13:38 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: F740:1CD3:3F518B:D165F8:656441A1

{
  "thread_id": "e3b04df8-5d32-4d72-baa8-a40cc459cbd7",
  "thread": {
    "id": "e3b04df8-5d32-4d72-baa8-a40cc459cbd7",
    "name": "",
    "repoID": 0,
    "repoOwnerID": 0,
    "createdAt": "2023-11-27T07:13:38.194799803Z",
    "updatedAt": "2023-11-27T07:13:38.194799803Z"
  }
}

* Request took 1.082443704s

And then a message is added to that chat by making a POST request to https://api.githubcopilot.com/github/chat/threads/:threadUuid/messages, which gets the response as the reply:

* Request at 2023-11-27 18:13:38.201104 +1100 AEDT m=+1.201943992
* Request to https://api.githubcopilot.com/github/chat/threads/e3b04df8-5d32-4d72-baa8-a40cc459cbd7/messages
> POST /github/chat/threads/e3b04df8-5d32-4d72-baa8-a40cc459cbd7/messages HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 110
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{
  "content": "this will not be found",
  "intent": "cli-explain",
  "references": [
    {
      "type": "cli-command",
      "program": ""
    }
  ]
}

< HTTP/2.0 200 OK
< Content-Length: 358
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:13:39 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: F740:1CD3:3F51AB:D16647:656441A2

{
  "message": {
    "id": "a9991548-30cc-4506-ba1e-fb26f9f08c24",
    "threadID": "e3b04df8-5d32-4d72-baa8-a40cc459cbd7",
    "turnID": "0680e661-466b-4e58-9611-4e8d5b533743",
    "role": "assistant",
    "content": "* The command you provided, \"this will not be found:\", is not a valid shell command.",
    "createdAt": "2023-11-27T07:13:39.635853891Z",
    "intent": "cli-explain",
    "references": []
  }
}

* Request took 1.544495822s

Ignoring the HTTP debug logs, the rest of the output basically looks like this:

Welcome to GitHub Copilot in the CLI!
version 0.5.3-beta (2023-11-09)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve.

⡿ Hold on, asking GitHub Copilot...

Explanation:

  • The command you provided, "this will not be found:", is not a valid shell command.

Next, we try an example where we do find an explanation:

⇒ GH_DEBUG=api gh copilot explain 'sort'

Which similarly creates a chat thread:

* Request at 2023-11-27 18:18:40.735178 +1100 AEDT m=+0.121896140
* Request to https://api.githubcopilot.com/github/chat/threads
> POST /github/chat/threads HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 2
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{}

< HTTP/2.0 201 Created
< Content-Length: 235
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:18:41 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: F7F3:0D49:422A48:D4C6A3:656442D1

{
  "thread_id": "5f4926ed-5c0c-4a39-8a68-554b7f08f033",
  "thread": {
    "id": "5f4926ed-5c0c-4a39-8a68-554b7f08f033",
    "name": "",
    "repoID": 0,
    "repoOwnerID": 0,
    "createdAt": "2023-11-27T07:18:41.778028851Z",
    "updatedAt": "2023-11-27T07:18:41.778028851Z"
  }
}

* Request took 1.063955767s

And then adds a message to that thread, which it gets a response to:

* Request at 2023-11-27 18:18:41.801388 +1100 AEDT m=+1.188080668
* Request to https://api.githubcopilot.com/github/chat/threads/5f4926ed-5c0c-4a39-8a68-554b7f08f033/messages
> POST /github/chat/threads/5f4926ed-5c0c-4a39-8a68-554b7f08f033/messages HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 92
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{
  "content": "sort",
  "intent": "cli-explain",
  "references": [
    {
      "type": "cli-command",
      "program": ""
    }
  ]
}

< HTTP/2.0 200 OK
< Content-Length: 501
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:18:43 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: F7F3:0D49:422A6C:D4C6EE:656442D1

{
  "message": {
    "id": "d7210faf-194e-49f0-8f4d-fce34d461286",
    "threadID": "5f4926ed-5c0c-4a39-8a68-554b7f08f033",
    "turnID": "55d9ade6-25c2-4642-8bb8-af0adf06ce8b",
    "role": "assistant",
    "content": "* 'sort' is used to sort lines of text.\n  * It reads input from either standard input or a file specified as an argument.\n  * By default, it sorts the text in ascending order.\n  * It outputs the sorted text to standard output.",
    "createdAt": "2023-11-27T07:18:43.135860298Z",
    "intent": "cli-explain",
    "references": []
  }
}

* Request took 1.421621445s

Ignoring the HTTP debug logs, the rest of the output basically looks like this:

Welcome to GitHub Copilot in the CLI!
version 0.5.3-beta (2023-11-09)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve.

⢿ Hold on, asking GitHub Copilot...

Explanation:

  • sort is used to sort lines of text.
    • It reads input from either standard input or a file specified as an argument.
    • By default, it sorts the text in ascending order.
    • It outputs the sorted text to standard output.

GH_DEBUG=api gh copilot suggest

Since suggest can have 3 different 'types' of suggestion (git, gh, shell), let's handle them separately.

GH_DEBUG=api gh copilot suggest -t git

Running with GH_DEBUG=api, we can see the API calls being made when we run gh copilot suggest -t git.

GH_DEBUG=api gh copilot suggest -t git 'create a new branch with a name'

First, the new chat thread is created:

* Request at 2023-11-27 18:30:39.728445 +1100 AEDT m=+0.124495906
* Request to https://api.githubcopilot.com/github/chat/threads
> POST /github/chat/threads HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 2
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{}

< HTTP/2.0 201 Created
< Content-Length: 235
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:30:40 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: F9D7:8EE8:146BB7A:3631008:656445A0

{
  "thread_id": "e1855984-0fc6-46d6-ae22-a1a89f028bdf",
  "thread": {
    "id": "e1855984-0fc6-46d6-ae22-a1a89f028bdf",
    "name": "",
    "repoID": 0,
    "repoOwnerID": 0,
    "createdAt": "2023-11-27T07:30:40.820942415Z",
    "updatedAt": "2023-11-27T07:30:40.820942415Z"
  }
}

* Request took 1.058698782s

Then the main chat message for our request is added:

* Request at 2023-11-27 18:30:40.789028 +1100 AEDT m=+1.185054198
* Request to https://api.githubcopilot.com/github/chat/threads/e1855984-0fc6-46d6-ae22-a1a89f028bdf/messages
> POST /github/chat/threads/e1855984-0fc6-46d6-ae22-a1a89f028bdf/messages HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 122
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{
  "content": "create a new branch with a name",
  "intent": "cli-suggest",
  "references": [
    {
      "type": "cli-command",
      "program": "git"
    }
  ]
}

< HTTP/2.0 200 OK
< Content-Length: 305
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:30:41 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: F9D7:8EE8:146BBB3:3631079:656445A0

{
  "message": {
    "id": "021052d7-d30f-4925-bd4d-c88815be5613",
    "threadID": "e1855984-0fc6-46d6-ae22-a1a89f028bdf",
    "turnID": "d700692a-0ab3-4c3c-95a6-c8483c4a89fb",
    "role": "assistant",
    "content": "git branch <branchname>",
    "createdAt": "2023-11-27T07:30:41.701965827Z",
    "intent": "cli-suggest",
    "references": []
  }
}

* Request took 1.00446051s

Which gives us output (with HTTP debug logs removed) that looks something like this:

Welcome to GitHub Copilot in the CLI!
version 0.5.3-beta (2023-11-09)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve.

⣾ Hold on, asking GitHub Copilot...

Suggestion:

  git branch <branchname>

? Select an option  [Use arrows to move, type to filter]
> Copy command to clipboard
  Explain command
  Revise command
  Rate response
  Exit

We can see now that we have 3 more options that are likely to create additional API calls:

  • Explain command
  • Revise command
  • Rate response

First we try explain command:

? Select an option
> Explain command
⣾ Hold on, asking GitHub Copilot...

Explanation:

  • git branch is used to manage branches in Git.
    • <branchname> is the name of the branch to be created.

Which generated the following HTTP debug logs:

* Request at 2023-11-27 18:34:36.633862 +1100 AEDT m=+237.024248987
* Request to https://api.githubcopilot.com/github/chat/threads/e1855984-0fc6-46d6-ae22-a1a89f028bdf/messages
> POST /github/chat/threads/e1855984-0fc6-46d6-ae22-a1a89f028bdf/messages HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 121
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{
  "content": "git branch <branchname>",
  "intent": "cli-explain",
  "references": [
    {
      "type": "cli-command",
      "program": ""
    }
  ]
}

< HTTP/2.0 200 OK
< Content-Length: 392
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:34:38 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: FA67:0643:42FB07:D6BE00:6564468D

{
  "message": {
    "id": "d034feca-a119-4645-ac50-2bf5f8edd31f",
    "threadID": "e1855984-0fc6-46d6-ae22-a1a89f028bdf",
    "turnID": "a2a6e957-f852-4028-9c18-0e21d0aecd4c",
    "role": "assistant",
    "content": "* 'git branch' is used to manage branches in Git.\n  * '<branchname>' is the name of the branch to be created.",
    "createdAt": "2023-11-27T07:34:38.411428909Z",
    "intent": "cli-explain",
    "references": []
  }
}

* Request took 1.888562667s

Then we try revise command:

? Select an option
> Revise command

? How should this be revised?
> Specify a different branch name

⣾ Hold on, asking GitHub Copilot...

Suggestion:

  git branch <newbranchname>

? Select an option  [Use arrows to move, type to filter]
> Copy command to clipboard
  Explain command
  Revise command
  Rate response
  Exit

Which generated the following HTTP debug logs:

* Request at 2023-11-27 18:38:08.553872 +1100 AEDT m=+448.939191773
* Request to https://api.githubcopilot.com/github/chat/threads/e1855984-0fc6-46d6-ae22-a1a89f028bdf/messages
> POST /github/chat/threads/e1855984-0fc6-46d6-ae22-a1a89f028bdf/messages HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 122
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{
  "content": "Specify a different branch name",
  "intent": "cli-suggest",
  "references": [
    {
      "type": "cli-command",
      "program": "git"
    }
  ]
}

< HTTP/2.0 200 OK
< Content-Length: 308
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:38:10 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: FB00:01C2:13BE6D7:3582067:65644761

{
  "message": {
    "id": "7c622f71-fc3d-414f-b3d8-3d40f304d81f",
    "threadID": "e1855984-0fc6-46d6-ae22-a1a89f028bdf",
    "turnID": "f5d958fd-078f-4601-bc13-d131284fdaaf",
    "role": "assistant",
    "content": "git branch <newbranchname>",
    "createdAt": "2023-11-27T07:38:10.116998875Z",
    "intent": "cli-suggest",
    "references": []
  }
}

* Request took 1.71950429s

Next, we try rate response and choose a positive response:

? Select an option
> Rate response

? Was this helpful?
> Yes

Thanks for your feedback!

Which generated the following HTTP debug logs:

* Request at 2023-11-27 18:39:59.502995 +1100 AEDT m=+559.885661450
* Request to https://api.githubcopilot.com/github/chat/threads/e1855984-0fc6-46d6-ae22-a1a89f028bdf/messages/7c622f71-fc3d-414f-b3d8-3d40f304d81f/feedback
> POST /github/chat/threads/e1855984-0fc6-46d6-ae22-a1a89f028bdf/messages/7c622f71-fc3d-414f-b3d8-3d40f304d81f/feedback HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 94
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{
  "feedback": "POSITIVE",
  "text_response": "",
  "feedback_choice": null,
  "is_contacted_checked": false
}

< HTTP/2.0 204 No Content
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:40:00 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: FB3A:1019:12C9887:349C2EE:656447D0

* Request took 952.349999ms

And finally, we try rate response and choose a negative response (note that this was done on a new run of the command, so the thread ID's/etc will be different from the above because of this):

? Was this helpful?
> No

? This response is:
> Unhelpful, Incorrect, Not true, Poorly formatted, Offensive or discriminatory, Other

? How could we improve this response?
> SOME IMPROVEMENT TEXT HERE

? Do you wish to be contacted via your GitHub email address?
> No

Thanks for your feedback!

Which generated the following HTTP debug logs:

* Request at 2023-11-27 18:41:18.244372 +1100 AEDT m=+38.052650891
* Request to https://api.githubcopilot.com/github/chat/threads/619d2353-d38b-40fb-8f97-c825fed1bbe2/messages/ed906fac-76ea-4387-983c-8c92e17e6c9b/feedback
> POST /github/chat/threads/619d2353-d38b-40fb-8f97-c825fed1bbe2/messages/ed906fac-76ea-4387-983c-8c92e17e6c9b/feedback HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 209
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{
  "feedback": "NEGATIVE",
  "text_response": "SOME IMPROVEMENT TEXT HERE",
  "feedback_choice": [
    "unhelpful",
    "incorrect",
    "not_true",
    "poorly_formatted",
    "offensive_or_discriminatory",
    "other"
  ],
  "is_contacted_checked": false
}

< HTTP/2.0 204 No Content
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:41:18 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: FB57:496C:1338C98:350C5A0:656447FA

* Request took 550.753104ms

GH_DEBUG=api gh copilot suggest -t gh

Running with GH_DEBUG=api, we can see the API calls being made when we run gh copilot suggest -t gh.

⇒ GH_DEBUG=api gh copilot suggest -t gh 'list extensions'

Since the API calls will likely be the same for all of the suggest flows, we'll only include the basic initial requests here (not the extra followup commands).

First, the new chat thread is created:

* Request at 2023-11-27 18:45:14.133759 +1100 AEDT m=+0.116387627
* Request to https://api.githubcopilot.com/github/chat/threads
> POST /github/chat/threads HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 2
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{}

< HTTP/2.0 201 Created
< Content-Length: 235
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:45:15 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: FC1C:16AF:191640:3EA7AA:6564490A

{
  "thread_id": "d04f1192-51ae-450e-910e-ca13b55e22e0",
  "thread": {
    "id": "d04f1192-51ae-450e-910e-ca13b55e22e0",
    "name": "",
    "repoID": 0,
    "repoOwnerID": 0,
    "createdAt": "2023-11-27T07:45:15.342462675Z",
    "updatedAt": "2023-11-27T07:45:15.342462675Z"
  }
}

* Request took 1.237816207s

Then the main message request is made:

* Request to https://api.githubcopilot.com/github/chat/threads/d04f1192-51ae-450e-910e-ca13b55e22e0/messages
> POST /github/chat/threads/d04f1192-51ae-450e-910e-ca13b55e22e0/messages HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 105
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{
  "content": "list extensions",
  "intent": "cli-suggest",
  "references": [
    {
      "type": "cli-command",
      "program": "gh"
    }
  ]
}

< HTTP/2.0 200 OK
< Content-Length: 289
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:45:16 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: FC1C:16AF:191677:3EA81B:6564490B

{
  "message": {
    "id": "e40d0f43-9e17-4aa9-803c-d26dc794a41a",
    "threadID": "d04f1192-51ae-450e-910e-ca13b55e22e0",
    "turnID": "ed6ef162-a35d-4b24-9b37-025a15a7fc42",
    "role": "assistant",
    "content": "gh extension list",
    "createdAt": "2023-11-27T07:45:16.259152292Z",
    "intent": "cli-suggest",
    "references": []
  }
}

* Request took 1.028340758s

Which gives us output (with HTTP debug logs removed) that looks something like this:

Welcome to GitHub Copilot in the CLI!
version 0.5.3-beta (2023-11-09)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve.
* Request at 2023-11-27 18:45:15.373407 +1100 AEDT m=+1.355997912

⣾ Hold on, asking GitHub Copilot...

Suggestion:

  gh extension list

? Select an option  [Use arrows to move, type to filter]
> Copy command to clipboard
  Explain command
  Revise command
  Rate response
  Exit

GH_DEBUG=api gh copilot suggest -t shell

Running with GH_DEBUG=api, we can see the API calls being made when we run gh copilot suggest -t shell.

GH_DEBUG=api gh copilot suggest -t shell 'echo to a file'

Since the API calls will likely be the same for all of the suggest flows, we'll only include the basic initial requests here (not the extra followup commands).

First, the new chat thread is created:

⇒ GH_DEBUG=api gh copilot suggest -t shell 'echo to a file'
* Request at 2023-11-27 18:48:50.840719 +1100 AEDT m=+0.118348846
* Request to https://api.githubcopilot.com/github/chat/threads
> POST /github/chat/threads HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 2
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{}

< HTTP/2.0 201 Created
< Content-Length: 235
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:48:52 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: FC9B:0F72:13487D7:3518A02:656449E3

{
  "thread_id": "8baa9f15-c7b4-4f98-ab75-d2cc755dd835",
  "thread": {
    "id": "8baa9f15-c7b4-4f98-ab75-d2cc755dd835",
    "name": "",
    "repoID": 0,
    "repoOwnerID": 0,
    "createdAt": "2023-11-27T07:48:51.865699594Z",
    "updatedAt": "2023-11-27T07:48:51.865699594Z"
  }
}

* Request took 1.139865034s

Then the main message request is made:

* Request at 2023-11-27 18:48:51.982605 +1100 AEDT m=+1.260200795
* Request to https://api.githubcopilot.com/github/chat/threads/8baa9f15-c7b4-4f98-ab75-d2cc755dd835/messages
> POST /github/chat/threads/8baa9f15-c7b4-4f98-ab75-d2cc755dd835/messages HTTP/1.1
> Host: api.githubcopilot.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: Bearer ████████████████████
> Content-Length: 107
> Content-Type: application/json
> Time-Zone: Australia/Sydney
> User-Agent: go-gh

{
  "content": "echo to a file",
  "intent": "cli-suggest",
  "references": [
    {
      "type": "cli-command",
      "program": "shell"
    }
  ]
}

< HTTP/2.0 200 OK
< Content-Length: 310
< Content-Type: application/json
< Date: Mon, 27 Nov 2023 07:48:53 GMT
< X-Github-Backend: Kubernetes
< X-Github-Request-Id: FC9B:0F72:13487FE:3518A67:656449E4

{
  "message": {
    "id": "33d0a1c1-e358-40cf-9e06-16f77763e3f2",
    "threadID": "8baa9f15-c7b4-4f98-ab75-d2cc755dd835",
    "turnID": "a2c84dca-f768-4847-a628-57d8a741b181",
    "role": "assistant",
    "content": "echo \"Hello, World!\" > file.txt",
    "createdAt": "2023-11-27T07:48:52.958558477Z",
    "intent": "cli-suggest",
    "references": []
  }
}

* Request took 1.085444884s

Which gives us output (with HTTP debug logs removed) that looks something like this:

Welcome to GitHub Copilot in the CLI!
version 0.5.3-beta (2023-11-09)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve.

⣾ Hold on, asking GitHub Copilot...

Suggestion:

  echo "Hello, World!" > file.txt

? Select an option  [Use arrows to move, type to filter]
> Copy command to clipboard
  Explain command
  Revise command
  Rate response
  Exit

API Endpoints

This reference document categorizes the API calls used in the GitHub Copilot CLI by their endpoints. Each endpoint is detailed with its methods, inputs, and outputs.

Creating Chat Threads

This endpoint initializes a new chat thread for both explain and suggest functionalities.

  • Endpoint: https://api.githubcopilot.com/github/chat/threads
  • Method: POST
  • Input:
    {}
  • Output:
    {
      "thread_id": "string",
      "thread": {
        "id": "string",
        "name": "string",
        "repoID": 0,
        "repoOwnerID": 0,
        "createdAt": "datetime",
        "updatedAt": "datetime"
      }
    }

Sending Messages to a Thread

This endpoint is used to send messages to an existing chat thread, applicable for both explaining and suggesting commands.

  • Endpoint: https://api.githubcopilot.com/github/chat/threads/:threadUuid/messages
  • Method: POST
  • Input:
    {
      "content": "string",
      "intent": "cli-explain" | "cli-suggest",
      "references": [
        {
          "type": "cli-command",
          "program": "string"
        }
      ]
    }
  • Output:
    {
      "message": {
        "id": "string",
        "threadID": "string",
        "turnID": "string",
        "role": "assistant",
        "content": "string",
        "createdAt": "datetime",
        "intent": "cli-explain" | "cli-suggest",
        "references": []
      }
    }

Feedback Submission

This endpoint handles feedback submissions for the responses generated by the Copilot.

  • Endpoint: https://api.githubcopilot.com/github/chat/threads/:threadUuid/messages/:messageId/feedback
  • Method: POST
  • Input:
    {
      "feedback": "POSITIVE" | "NEGATIVE",
      "text_response": "string",
      "feedback_choice": ["string"],
      "is_contacted_checked": boolean
    }
  • Output: Typically a status code (like 204 No Content), indicating the successful submission of feedback.
  • Input:
    • feedback: Indicates the type of feedback (e.g., "POSITIVE", "NEGATIVE").
    • text_response: Optional text elaborating on the feedback.
    • feedback_choice: An array of specific feedback categories (e.g., "unhelpful", "incorrect").
    • is_contacted_checked: Boolean indicating whether the user opts for contact via email.
  • Output: Typically a status code (like 204 No Content), indicating the successful submission of feedback.

See Also

My Other Related Deepdive Gist's and Projects

Decompilation Outputs

Table of Contents

Tools

  • https://go-re.tk/
    • A Reverse Engineering Tool Kit for Go, Written in Go.

    • The Go Reverse Engineering Tool Kit (go-re.tk) is a new open-source toolset for analyzing Go binaries. The tool is designed to extract as much metadata as possible from stripped binaries to assist in both reverse engineering and malware analysis.

    • https://go-re.tk/redress/
      • Redress

      • A tool for analyzing stripped binaries

      • The redress software is a tool for analyzing stripped Go binaries compiled with the Go compiler. It extracts data from the binary and uses it to reconstruct symbols and performs analysis. It essentially tries to “re-dress” a “stripped” binary.

      • https://github.com/goretk/redress
        • Redress - A tool for analyzing stripped Go binaries

  • https://github.com/mandiant/GoReSym
    • GoReSym is a Go symbol parser that extracts program metadata (such as CPU architecture, OS, endianness, compiler version, etc), function metadata (start & end addresses, names, sources), filename and line number metadata, and embedded structures and types. This cross platform program is based directly on the open source Go compiler and runtime code.

  • etc

Output

strings

⇒ strings ~/.local/share/gh/extensions/gh-copilot/gh-copilot
# 37,001 lines of output (though this is less useful since Golang doesn't null terminate it's strings like other data formats)

GoReSym

⇒ ./GoReSym_mac ~/.local/share/gh/extensions/gh-copilot/gh-copilot | subl
# 36,327 lines of pretty printed json

⇒ ./GoReSym_mac ~/.local/share/gh/extensions/gh-copilot/gh-copilot | jq 'keys'
[
  "Arch",
  "BuildId",
  "BuildInfo",
  "Files",
  "Interfaces",
  "ModuleMeta",
  "OS",
  "StdFunctions",
  "TabMeta",
  "Types",
  "UserFunctions",
  "Version"
]

-human: Human view, print information flat rather than json, some information is omitted for clarity

⇒ ./GoReSym_mac -human  ~/.local/share/gh/extensions/gh-copilot/gh-copilot | subl
# 24,155 lines of 'human formatted' text output

redress

redress info

Print summary information.

⇒ ./redress info ~/.local/share/gh/extensions/gh-copilot/gh-copilot | subl

OS            macOS
Arch          amd64
Compiler      1.20.10 ()
Build ID      vadgbrNkSYOcSYp83Sls/8kBpYGCXZFE4lGvS1jKo/YWfa_6VMijChwiVZigs2/M4B3ZrhYPRt-UT0XOknE
Main root     github.com/github/gh-copilot
# main        21
# std         121
# vendor      107
-buildmode    exe
-compiler     gc
-trimpath     true
CGO_ENABLED   0
GOARCH        amd64
GOOS          darwin
GOAMD64       v1
vcs           git
vcs.revision  8837332c031c6cc86bc18a42d0ba58b6f30ac073
vcs.time      2023-11-09T16:25:54Z
vcs.modified  false

redress moduledata

Display sections extracted from the moduledata structure.

⇒ ./redress moduledata ~/.local/share/gh/extensions/gh-copilot/gh-copilot | subl

Section    Address    Size
-------    -------    ----
text       0x1001000  0x8690b5
types      0x186a3a0  0x1163ff0
itablinks  0x29d1ac0  0x247
pclntab    0x2bf3460  0x13b9e8
functab    0x2bf3460  0x35f4
noptrdata  0x2d30240  0xa31e0
data       0x2dd3420  0x24260
bss        0x2df7680  0x37e60
noptrbss   0x2e2f4e0  0x66b0

redress gomod

Display go mod information.

⇒ ./redress gomod ~/.local/share/gh/extensions/gh-copilot/gh-copilot | subl

Type  Name                                 Version                             Replaced by  Hash
----  ----                                 -------                             -----------  ----
main  github.com/github/gh-copilot         (devel)                                          
dep   github.com/AlecAivazis/survey/v2     v2.3.7                                           h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
dep   github.com/MakeNowJust/heredoc       v1.0.0                                           h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
dep   github.com/alecthomas/chroma         v0.10.0                                          h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
dep   github.com/atotto/clipboard          v0.1.4                                           h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
dep   github.com/aymanbagabas/go-osc52/v2  v2.0.1                                           h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
dep   github.com/aymerick/douceur          v0.2.0                                           h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
dep   github.com/briandowns/spinner        v1.23.0                                          h1:alDF2guRWqa/FOZZYWjlMIx2L6H0wyewPxo/CH4Pt2A=
dep   github.com/charmbracelet/glamour     v0.6.0                                           h1:wi8fse3Y7nfcabbbDuwolqTqMQPMnVPeZhDM273bISc=
dep   github.com/cli/go-gh/v2              v2.4.0                                           h1:6j3YxA8uJVOL4lBWjqDmMiAQNnJ2fiZagCuEmQXl+pU=
dep   github.com/cli/safeexec              v1.0.1                                           h1:e/C79PbXF4yYTN/wauC4tviMxEV13BwljGj0N9j+N00=
dep   github.com/cli/shurcooL-graphql      v0.0.4                                           h1:6MogPnQJLjKkaXPyGqPRXOI2qCsQdqNfUY1QSJu2GuY=
dep   github.com/dlclark/regexp2           v1.10.0                                          h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
dep   github.com/fatih/color               v1.15.0                                          h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
dep   github.com/gorilla/css               v1.0.0                                           h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
dep   github.com/hashicorp/go-version      v1.6.0                                           h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
dep   github.com/henvic/httpretty          v0.1.2                                           h1:EQo556sO0xeXAjP10eB+BZARMuvkdGqtfeS4Ntjvkiw=
dep   github.com/kballard/go-shellquote    v0.0.0-20180428030007-95032a82bc51               h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
dep   github.com/lucasb-eyer/go-colorful   v1.2.0                                           h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
dep   github.com/mattn/go-colorable        v0.1.13                                          h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
dep   github.com/mattn/go-isatty           v0.0.20                                          h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
dep   github.com/mattn/go-runewidth        v0.0.15                                          h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
dep   github.com/mgutz/ansi                v0.0.0-20200706080929-d51e80ef957d               h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
dep   github.com/microcosm-cc/bluemonday   v1.0.26                                          h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58=
dep   github.com/muesli/reflow             v0.3.0                                           h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
dep   github.com/muesli/termenv            v0.15.2                                          h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
dep   github.com/olekukonko/tablewriter    v0.0.5                                           h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
dep   github.com/rivo/uniseg               v0.4.4                                           h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
dep   github.com/spf13/cobra               v1.7.0                                           h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
dep   github.com/spf13/pflag               v1.0.5                                           h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
dep   github.com/thlib/go-timezone-local   v0.0.0-20210907160436-ef149e42d28e               h1:BuzhfgfWQbX0dWzYzT1zsORLnHRv3bcRcsaUk0VmXA8=
dep   github.com/yuin/goldmark             v1.5.6                                           h1:COmQAWTCcGetChm3Ig7G/t8AFAN00t+o8Mt4cf7JpwA=
dep   github.com/yuin/goldmark-emoji       v1.0.2                                           h1:c/RgTShNgHTtc6xdz2KKI74jJr6rWi7FPgnP9GAsO5s=
dep   golang.org/x/net                     v0.17.0                                          h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
dep   golang.org/x/sys                     v0.13.0                                          h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
dep   golang.org/x/term                    v0.13.0                                          h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
dep   golang.org/x/text                    v0.13.0                                          h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
dep   gopkg.in/yaml.v3                     v3.0.1                                           h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

redress packages

List Packages. The different Go packages used in the binary is extracted.

⇒ ./redress packages ~/.local/share/gh/extensions/gh-copilot/gh-copilot --filepath --unknown --vendor --std | subl

Packages:
Name                                                        Version  Path
----                                                        -------  ----
github.com/github/gh-copilot/cmd                                     github.com/github/gh-copilot/cmd
github.com/github/gh-copilot/cmd/config                              github.com/github/gh-copilot/cmd/config
github.com/github/gh-copilot/cmd/explain                             github.com/github/gh-copilot/cmd/explain
github.com/github/gh-copilot/cmd/suggest                             github.com/github/gh-copilot/cmd/suggest
github.com/github/gh-copilot/cmd/version                             github.com/github/gh-copilot/cmd/version
github.com/github/gh-copilot/env                                     github.com/github/gh-copilot/env
github.com/github/gh-copilot/internal/build                          github.com/github/gh-copilot/internal/build
github.com/github/gh-copilot/internal/capi                           github.com/github/gh-copilot/internal/capi
github.com/github/gh-copilot/internal/capi/capierrors                github.com/github/gh-copilot/internal/capi/capierrors
github.com/github/gh-copilot/internal/capi/capimock                  github.com/github/gh-copilot/internal/capi/capimock
github.com/github/gh-copilot/internal/central                        github.com/github/gh-copilot/internal/central
github.com/github/gh-copilot/internal/centralmock                    github.com/github/gh-copilot/internal/centralmock
github.com/github/gh-copilot/internal/copilot                        github.com/github/gh-copilot/internal/copilot
github.com/github/gh-copilot/internal/copilot/state                  github.com/github/gh-copilot/internal/copilot/state
github.com/github/gh-copilot/internal/copilot/state/config           github.com/github/gh-copilot/internal/copilot/state/config
github.com/github/gh-copilot/internal/copilot/state/update           github.com/github/gh-copilot/internal/copilot/state/update
github.com/github/gh-copilot/internal/errs                           github.com/github/gh-copilot/internal/errs
github.com/github/gh-copilot/internal/io                             github.com/github/gh-copilot/internal/io
github.com/github/gh-copilot/internal/prompter                       github.com/github/gh-copilot/internal/prompter
github.com/github/gh-copilot/internal/theme                          github.com/github/gh-copilot/internal/theme
main                                                                 github.com/github/gh-copilot

Vendors:
Name                                          Version                             Path
----                                          -------                             ----
github.com/AlecAivazis/survey/v2              v2.3.7                              github.com/AlecAivazis/survey/v2@v2.3.7
github.com/AlecAivazis/survey/v2/core         v2.3.7                              github.com/AlecAivazis/survey/v2@v2.3.7/core
github.com/AlecAivazis/survey/v2/terminal     v2.3.7                              github.com/AlecAivazis/survey/v2@v2.3.7/terminal
github.com/MakeNowJust/heredoc                v1.0.0                              github.com/MakeNowJust/heredoc@v1.0.0
github.com/alecthomas/chroma                  v0.10.0                             github.com/alecthomas/chroma@v0.10.0
github.com/alecthomas/chroma/formatters       v0.10.0                             github.com/alecthomas/chroma@v0.10.0/formatters
github.com/alecthomas/chroma/formatters/html  v0.10.0                             github.com/alecthomas/chroma@v0.10.0/formatters/html
github.com/alecthomas/chroma/formatters/svg   v0.10.0                             github.com/alecthomas/chroma@v0.10.0/formatters/svg
github.com/alecthomas/chroma/lexers           v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers
github.com/alecthomas/chroma/lexers/a         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/a
github.com/alecthomas/chroma/lexers/b         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/b
github.com/alecthomas/chroma/lexers/c         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/c
github.com/alecthomas/chroma/lexers/circular  v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/circular
github.com/alecthomas/chroma/lexers/d         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/d
github.com/alecthomas/chroma/lexers/e         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/e
github.com/alecthomas/chroma/lexers/f         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/f
github.com/alecthomas/chroma/lexers/g         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/g
github.com/alecthomas/chroma/lexers/h         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/h
github.com/alecthomas/chroma/lexers/i         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/i
github.com/alecthomas/chroma/lexers/internal  v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/internal
github.com/alecthomas/chroma/lexers/j         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/j
github.com/alecthomas/chroma/lexers/k         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/k
github.com/alecthomas/chroma/lexers/l         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/l
github.com/alecthomas/chroma/lexers/m         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/m
github.com/alecthomas/chroma/lexers/n         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/n
github.com/alecthomas/chroma/lexers/o         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/o
github.com/alecthomas/chroma/lexers/p         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/p
github.com/alecthomas/chroma/lexers/q         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/q
github.com/alecthomas/chroma/lexers/r         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/r
github.com/alecthomas/chroma/lexers/s         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/s
github.com/alecthomas/chroma/lexers/t         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/t
github.com/alecthomas/chroma/lexers/v         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/v
github.com/alecthomas/chroma/lexers/w         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/w
github.com/alecthomas/chroma/lexers/x         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/x
github.com/alecthomas/chroma/lexers/y         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/y
github.com/alecthomas/chroma/lexers/z         v0.10.0                             github.com/alecthomas/chroma@v0.10.0/lexers/z
github.com/alecthomas/chroma/quick            v0.10.0                             github.com/alecthomas/chroma@v0.10.0/quick
github.com/alecthomas/chroma/styles           v0.10.0                             github.com/alecthomas/chroma@v0.10.0/styles
github.com/atotto/clipboard                   v0.1.4                              github.com/atotto/clipboard@v0.1.4
github.com/aymerick/douceur/parser            v0.2.0                              github.com/aymerick/douceur@v0.2.0/parser
github.com/briandowns/spinner                 v1.23.0                             github.com/briandowns/spinner@v1.23.0
github.com/charmbracelet/glamour              v0.6.0                              github.com/charmbracelet/glamour@v0.6.0
github.com/charmbracelet/glamour/ansi         v0.6.0                              github.com/charmbracelet/glamour@v0.6.0/ansi
github.com/cli/go-gh/v2/internal/yamlmap      v2.4.0                              github.com/cli/go-gh/v2@v2.4.0/internal/yamlmap
github.com/cli/go-gh/v2/pkg/api               v2.4.0                              github.com/cli/go-gh/v2@v2.4.0/pkg/api
github.com/cli/go-gh/v2/pkg/asciisanitizer    v2.4.0                              github.com/cli/go-gh/v2@v2.4.0/pkg/asciisanitizer
github.com/cli/go-gh/v2/pkg/auth              v2.4.0                              github.com/cli/go-gh/v2@v2.4.0/pkg/auth
github.com/cli/go-gh/v2/pkg/config            v2.4.0                              github.com/cli/go-gh/v2@v2.4.0/pkg/config
github.com/cli/go-gh/v2/pkg/jsonpretty        v2.4.0                              github.com/cli/go-gh/v2@v2.4.0/pkg/jsonpretty
github.com/cli/go-gh/v2/pkg/markdown          v2.4.0                              github.com/cli/go-gh/v2@v2.4.0/pkg/markdown
github.com/cli/go-gh/v2/pkg/term              v2.4.0                              github.com/cli/go-gh/v2@v2.4.0/pkg/term
github.com/cli/go-gh/v2/pkg/text              v2.4.0                              github.com/cli/go-gh/v2@v2.4.0/pkg/text
github.com/cli/safeexec                       v1.0.1                              github.com/cli/safeexec@v1.0.1
github.com/cli/shurcooL-graphql               v0.0.4                              github.com/cli/shurcooL-graphql@v0.0.4
github.com/cli/shurcooL-graphql/ident         v0.0.4                              github.com/cli/shurcooL-graphql@v0.0.4/ident
github.com/dlclark/regexp2                    v1.10.0                             github.com/dlclark/regexp2@v1.10.0
github.com/dlclark/regexp2/syntax             v1.10.0                             github.com/dlclark/regexp2@v1.10.0/syntax
github.com/fatih/color                        v1.15.0                             github.com/fatih/color@v1.15.0
github.com/gorilla/css/scanner                v1.0.0                              github.com/gorilla/css@v1.0.0/scanner
github.com/hashicorp/go-version               v1.6.0                              github.com/hashicorp/go-version@v1.6.0
github.com/henvic/httpretty                   v0.1.2                              github.com/henvic/httpretty@v0.1.2
github.com/henvic/httpretty/internal/color    v0.1.2                              github.com/henvic/httpretty@v0.1.2/internal/color
github.com/henvic/httpretty/internal/header   v0.1.2                              github.com/henvic/httpretty@v0.1.2/internal/header
github.com/kballard/go-shellquote             v0.0.0-20180428030007-95032a82bc51  github.com/kballard/go-shellquote@v0.0.0-20180428030007-95032a82bc51
github.com/lucasb-eyer/go-colorful            v1.2.0                              github.com/lucasb-eyer/go-colorful@v1.2.0
github.com/mattn/go-isatty                    v0.0.20                             github.com/mattn/go-isatty@v0.0.20
github.com/mattn/go-runewidth                 v0.0.15                             github.com/mattn/go-runewidth@v0.0.15
github.com/mgutz/ansi                         v0.0.0-20200706080929-d51e80ef957d  github.com/mgutz/ansi@v0.0.0-20200706080929-d51e80ef957d
github.com/microcosm-cc/bluemonday            v1.0.26                             github.com/microcosm-cc/bluemonday@v1.0.26
github.com/microcosm-cc/bluemonday/css        v1.0.26                             github.com/microcosm-cc/bluemonday@v1.0.26/css
github.com/muesli/reflow/ansi                 v0.3.0                              github.com/muesli/reflow@v0.3.0/ansi
github.com/muesli/reflow/indent               v0.3.0                              github.com/muesli/reflow@v0.3.0/indent
github.com/muesli/reflow/padding              v0.3.0                              github.com/muesli/reflow@v0.3.0/padding
github.com/muesli/reflow/wordwrap             v0.3.0                              github.com/muesli/reflow@v0.3.0/wordwrap
github.com/muesli/termenv                     v0.15.2                             github.com/muesli/termenv@v0.15.2
github.com/olekukonko/tablewriter             v0.0.5                              github.com/olekukonko/tablewriter@v0.0.5
github.com/rivo/uniseg                        v0.4.4                              github.com/rivo/uniseg@v0.4.4
github.com/spf13/cobra                        v1.7.0                              github.com/spf13/cobra@v1.7.0
github.com/spf13/pflag                        v1.0.5                              github.com/spf13/pflag@v1.0.5
github.com/thlib/go-timezone-local/tzlocal    v0.0.0-20210907160436-ef149e42d28e  github.com/thlib/go-timezone-local@v0.0.0-20210907160436-ef149e42d28e/tzlocal
github.com/yuin/goldmark                      v1.5.6                              github.com/yuin/goldmark@v1.5.6
github.com/yuin/goldmark-emoji                v1.0.2                              github.com/yuin/goldmark-emoji@v1.0.2
github.com/yuin/goldmark-emoji/ast            v1.0.2                              github.com/yuin/goldmark-emoji@v1.0.2/ast
github.com/yuin/goldmark-emoji/definition     v1.0.2                              github.com/yuin/goldmark-emoji@v1.0.2/definition
github.com/yuin/goldmark/ast                  v1.5.6                              github.com/yuin/goldmark@v1.5.6/ast
github.com/yuin/goldmark/extension            v1.5.6                              github.com/yuin/goldmark@v1.5.6/extension
github.com/yuin/goldmark/extension/ast        v1.5.6                              github.com/yuin/goldmark@v1.5.6/extension/ast
github.com/yuin/goldmark/parser               v1.5.6                              github.com/yuin/goldmark@v1.5.6/parser
github.com/yuin/goldmark/renderer             v1.5.6                              github.com/yuin/goldmark@v1.5.6/renderer
github.com/yuin/goldmark/renderer/html        v1.5.6                              github.com/yuin/goldmark@v1.5.6/renderer/html
github.com/yuin/goldmark/text                 v1.5.6                              github.com/yuin/goldmark@v1.5.6/text
github.com/yuin/goldmark/util                 v1.5.6                              github.com/yuin/goldmark@v1.5.6/util
golang.org/x/net/html                         v0.17.0                             golang.org/x/net@v0.17.0/html
golang.org/x/net/html/atom                    v0.17.0                             golang.org/x/net@v0.17.0/html/atom
golang.org/x/sys/unix                         v0.13.0                             golang.org/x/sys@v0.13.0/unix
golang.org/x/term                             v0.13.0                             golang.org/x/term@v0.13.0
golang.org/x/text/cases                       v0.13.0                             golang.org/x/text@v0.13.0/cases
golang.org/x/text/internal                    v0.13.0                             golang.org/x/text@v0.13.0/internal
golang.org/x/text/internal/language           v0.13.0                             golang.org/x/text@v0.13.0/internal/language
golang.org/x/text/internal/language/compact   v0.13.0                             golang.org/x/text@v0.13.0/internal/language/compact
golang.org/x/text/internal/tag                v0.13.0                             golang.org/x/text@v0.13.0/internal/tag
golang.org/x/text/language                    v0.13.0                             golang.org/x/text@v0.13.0/language
golang.org/x/text/runes                       v0.13.0                             golang.org/x/text@v0.13.0/runes
golang.org/x/text/transform                   v0.13.0                             golang.org/x/text@v0.13.0/transform
golang.org/x/text/unicode/norm                v0.13.0                             golang.org/x/text@v0.13.0/unicode/norm
golang.org/x/text/width                       v0.13.0                             golang.org/x/text@v0.13.0/width
gopkg.in/yaml%2ev3                            v3.0.1                              gopkg.in/yaml.v3@v3.0.1

Standard Library Packages:
Name                                          Version  Path
----                                          -------  ----
bufio                                                  bufio
bytes                                                  bytes
compress/flate                                         compress/flate
compress/gzip                                          compress/gzip
container/list                                         container/list
context                                                context
crypto                                                 crypto
crypto/aes                                             crypto/aes
crypto/cipher                                          crypto/cipher
crypto/des                                             crypto/des
crypto/dsa                                             crypto/dsa
crypto/ecdh                                            crypto/ecdh
crypto/ecdsa                                           crypto/ecdsa
crypto/ed25519                                         crypto/ed25519
crypto/elliptic                                        crypto/elliptic
crypto/hmac                                            crypto/hmac
crypto/internal/bigmod                                 crypto/internal/bigmod
crypto/internal/boring                                 crypto/internal/boring
crypto/internal/boring/sig                             crypto/internal/boring/sig
crypto/internal/edwards25519                           crypto/internal/edwards25519
crypto/internal/edwards25519/field                     crypto/internal/edwards25519/field
crypto/internal/nistec                                 crypto/internal/nistec
crypto/internal/nistec/fiat                            crypto/internal/nistec/fiat
crypto/internal/randutil                               crypto/internal/randutil
crypto/md5                                             crypto/md5
crypto/rand                                            crypto/rand
crypto/rc4                                             crypto/rc4
crypto/rsa                                             crypto/rsa
crypto/sha1                                            crypto/sha1
crypto/sha256                                          crypto/sha256
crypto/sha512                                          crypto/sha512
crypto/subtle                                          crypto/subtle
crypto/tls                                             crypto/tls
crypto/x509                                            crypto/x509
crypto/x509/internal/macos                             runtime
crypto/x509/pkix                                       crypto/x509/pkix
database/sql/driver                                    database/sql/driver
encoding/asn1                                          encoding/asn1
encoding/base64                                        encoding/base64
encoding/binary                                        encoding/binary
encoding/csv                                           encoding/csv
encoding/hex                                           encoding/hex
encoding/json                                          encoding/json
encoding/pem                                           encoding/pem
errors                                                 errors
flag                                                   flag
fmt                                                    fmt
hash/crc32                                             hash/crc32
html                                                   html
image/color                                            image/color
internal/abi                                           internal/abi
internal/bytealg                                       internal/bytealg
internal/cpu                                           internal/cpu
internal/fmtsort                                       internal/fmtsort
internal/godebug                                       runtime
internal/intern                                        internal/intern
internal/itoa                                          internal/itoa
internal/oserror                                       internal/oserror
internal/poll                                          runtime
internal/reflectlite                                   runtime
internal/safefilepath                                  internal/safefilepath
internal/singleflight                                  internal/singleflight
internal/syscall/unix                                  runtime
internal/testlog                                       internal/testlog
io                                                     io
io/fs                                                  io/fs
io/ioutil                                              io/ioutil
log                                                    log
math                                                   math
math/big                                               math/big
math/rand                                              runtime
mime                                                   mime
mime/multipart                                         mime/multipart
mime/quotedprintable                                   mime/quotedprintable
net                                                    runtime
net/http                                               net/http
net/http/internal                                      net/http/internal
net/http/internal/ascii                                net/http/internal/ascii
net/netip                                              net/netip
net/textproto                                          net/textproto
net/url                                                net/url
os                                                     runtime
os/exec                                                os/exec
path                                                   path
path/filepath                                          path/filepath
reflect                                                runtime
regexp                                                 regexp
regexp/syntax                                          regexp/syntax
runtime                                                internal/bytealg
runtime/debug                                          runtime
runtime/internal/atomic                                runtime/internal/atomic
runtime/internal/sys                                   runtime/internal/sys
sort                                                   sort
strconv                                                strconv
strings                                                strings
sync                                                   runtime
sync/atomic                                            runtime
syscall                                                runtime
text/template                                          text/template
text/template/parse                                    text/template/parse
time                                                   runtime
unicode                                                unicode
unicode/utf16                                          unicode/utf16
unicode/utf8                                           unicode/utf8
vendor/golang.org/x/crypto/chacha20                    vendor/golang.org/x/crypto/chacha20
vendor/golang.org/x/crypto/chacha20poly1305            vendor/golang.org/x/crypto/chacha20poly1305
vendor/golang.org/x/crypto/cryptobyte                  vendor/golang.org/x/crypto/cryptobyte
vendor/golang.org/x/crypto/cryptobyte/asn1             vendor/golang.org/x/crypto/cryptobyte/asn1
vendor/golang.org/x/crypto/hkdf                        vendor/golang.org/x/crypto/hkdf
vendor/golang.org/x/crypto/internal/poly1305           vendor/golang.org/x/crypto/internal/poly1305
vendor/golang.org/x/net/dns/dnsmessage                 vendor/golang.org/x/net/dns/dnsmessage
vendor/golang.org/x/net/http/httpguts                  vendor/golang.org/x/net/http/httpguts
vendor/golang.org/x/net/http/httpproxy                 vendor/golang.org/x/net/http/httpproxy
vendor/golang.org/x/net/http2/hpack                    vendor/golang.org/x/net/http2/hpack
vendor/golang.org/x/net/idna                           vendor/golang.org/x/net/idna
vendor/golang.org/x/net/route                          vendor/golang.org/x/net/route
vendor/golang.org/x/sys/cpu                            vendor/golang.org/x/sys/cpu
vendor/golang.org/x/text/secure/bidirule               vendor/golang.org/x/text/secure/bidirule
vendor/golang.org/x/text/transform                     vendor/golang.org/x/text/transform
vendor/golang.org/x/text/unicode/bidi                  vendor/golang.org/x/text/unicode/bidi
vendor/golang.org/x/text/unicode/norm                  vendor/golang.org/x/text/unicode/norm

Unknown Packages:
Name  Version  Path
----  -------  ----

redress source

Source Code Projection

Construct a source code tree layout based on the metadata found in the binary. The output includes the package name and its folder location at compile time. For each file, the functions defined within are printed. The output also includes auto generated functions produced by the compiler. For each function, redress tries to guess the starting and ending line number.

Folder -> File -> Function -> Line

⇒ ./redress source ~/.local/share/gh/extensions/gh-copilot/gh-copilot | subl

Package github.com/github/gh-copilot/cmd/config: github.com/github/gh-copilot/cmd/config
File: configure.go  
  NewConfigCommand Lines: 13 to 28 (15) 
  NewConfigCommandfunc1 Lines: 23 to 24 (1) 

Package github.com/github/gh-copilot/internal/copilot/state: github.com/github/gh-copilot/internal/copilot/state
File: state_directory.go  
  stateDir Lines: 22 to 36 (14) 
  configDir Lines: 36 to 52 (16)  
  EnsureDir Lines: 52 to 57 (5) 
  PathForState Lines: 57 to 62 (5)  
  PathForConfig Lines: 62 to 63 (1) 

Package github.com/github/gh-copilot/internal/central: github.com/github/gh-copilot/internal/central
File: central.go  
  (*Client)Emit Lines: 132 to 165 (33)  
  (*Client).Emitfunc1 Lines: 138 to 164 (26)  
  (*Client).Emit.func11 Lines: 139 to 167 (28)  
  (*Client).Emit.func12 Lines: 163 to 163 (0) 
  calculateExceptionCluster Lines: 167 to 181 (14)  
  parcelExceptionDetail Lines: 181 to 237 (56)  
  parcelExceptionData Lines: 237 to 249 (12)  
  (*Client)EmitException Lines: 249 to 279 (30) 
  (*Client).EmitExceptionfunc1 Lines: 255 to 278 (23) 
  (*Client).EmitException.func11 Lines: 256 to 282 (26) 
  (*Client).EmitException.func12 Lines: 277 to 277 (0)  
  PromptForAnalyticsChoice Lines: 282 to 291 (9)  
  (*Client)SetAnalyticsEnabled Lines: 291 to 311 (20) 
  (*Client)Initialize Lines: 301 to 314 (13)  
  getAnalyticsEnabled Lines: 314 to 341 (27)  
  (*Client)Finalize Lines: 341 to 343 (2) 

Package github.com/github/gh-copilot/internal/centralmock: github.com/github/gh-copilot/internal/centralmock
File: central.go  
  (*Client)Emit Lines: 19 to 24 (5) 
  (*Client)EmitException Lines: 24 to 28 (4)  
  (*Client)SetAnalyticsEnabled Lines: 28 to 33 (5)  
  (*Client)Initialize Lines: 33 to 39 (6) 
  (*Client)Finalize Lines: 39 to 39 (0) 

Package github.com/github/gh-copilot/internal/theme: github.com/github/gh-copilot/internal/theme
File: colors.go 
  init Lines: 36 to 49 (13) 
  ColorFor Lines: 65 to 83 (18) 
  ColorForSpinner Lines: 83 to 87 (4) 

Package github.com/github/gh-copilot/cmd: github.com/github/gh-copilot/cmd
File: root.go 
  NewRootCommand Lines: 24 to 100 (76)  
  NewRootCommandfunc1 Lines: 39 to 64 (25)  
  NewRootCommand.func11 Lines: 48 to 62 (14)  
  NewRootCommandfunc2 Lines: 66 to 78 (12)  

Package github.com/github/gh-copilot/internal/capi: github.com/github/gh-copilot/internal/capi
File: client.go 
  (*Client)setHeaders Lines: 46 to 56 (10)  
  (*Client)CheckAuth Lines: 56 to 70 (14) 
  (*Client)CreateThread Lines: 70 to 100 (30) 
  (*Client).CreateThreadfunc1 Lines: 86 to 126 (40) 
  (*Client)CreateMessage Lines: 126 to 174 (48) 
  (*Client).CreateMessagefunc1 Lines: 157 to 239 (82) 
  (*Client)SendFeedback Lines: 239 to 268 (29)  
  (*Client).SendFeedbackfunc1 Lines: 266 to 271 (5) 
  (*Client)do Lines: 271 to 310 (39)  

Package github.com/github/gh-copilot/internal/io: github.com/github/gh-copilot/internal/io
File: stdio.go  
  (*FileReader)Fd Lines: 21 to 27 (6) 
  (*FileReader)Read Lines: 27 to 46 (19)  
  (*FileWriter)Fd Lines: 46 to 52 (6) 
  (*FileWriter)Write Lines: 52 to 53 (1)  

Package github.com/github/gh-copilot/env: github.com/github/gh-copilot/env
File: env.go  
  HasCustomGlamourConfig Lines: 46 to 53 (7)  
  HasCustomCapiHost Lines: 53 to 67 (14)  

Package github.com/github/gh-copilot/cmd/explain: github.com/github/gh-copilot/cmd/explain
File: explain.go  
  NewExplainCommand Lines: 17 to 48 (31)  
  NewExplainCommandfunc1 Lines: 39 to 41 (2)  

Package github.com/github/gh-copilot/internal/copilot/state/update: github.com/github/gh-copilot/internal/copilot/state/update
File: update.go 
  (*ReleaseChecker)Check Lines: 65 to 84 (19) 
  (*ReleaseChecker)CheckDaily Lines: 84 to 93 (9) 
  (*ReleaseChecker)getLatestReleaseInfo Lines: 93 to 110 (17) 
  (*ReleaseChecker).getLatestReleaseInfofunc1 Lines: 98 to 113 (15) 
  getStateEntry Lines: 113 to 128 (15)  
  setStateEntry Lines: 128 to 144 (16)  
  versionGreaterThan Lines: 144 to 148 (4)  

Package github.com/github/gh-copilot/internal/copilot: github.com/github/gh-copilot/internal/copilot
File: <autogenerated> 
  (*SuggestTarget)Allowed Lines: 1 to 1 (0) 
  (*SuggestTarget)String Lines: 1 to 1 (0)  
  (*SuggestTarget)Type Lines: 1 to 1 (0)  
File: app.go  
  (*App)println Lines: 98 to 381 (283)  
  (*App)printf Lines: 104 to 388 (284)  
  (*App)print Lines: 110 to 395 (285) 
  (*App)printfErr Lines: 116 to 388 (272) 
  (*App)getBaseStyleConfig Lines: 120 to 135 (15) 
  (*App)applyStyleOverrides Lines: 135 to 148 (13)  
  (*App)getRenderingTheme Lines: 148 to 166 (18)  
  (*App)printSuggestion Lines: 170 to 180 (10)  
  (*App)printExplanation Lines: 180 to 190 (10) 
  (*App)formatMarkdown Lines: 190 to 201 (11) 
  (*App)startProgressIndicatorWithLabel Lines: 201 to 227 (26)  
  (*App).startProgressIndicatorWithLabelfunc2 Lines: 207 to 230 (23)  
  (*App)updateProgressIndicatorLabel Lines: 230 to 245 (15) 
  (*App).updateProgressIndicatorLabelfunc1 Lines: 236 to 248 (12) 
  (*App)stopProgressIndicator Lines: 248 to 256 (8) 
  (*App).stopProgressIndicatorfunc1 Lines: 250 to 263 (13)  
  (*App)runWithProgressRetryable Lines: 263 to 290 (27) 
  (*App).runWithProgressRetryablefunc1 Lines: 270 to 299 (29) 
  (*App)PrintBanner Lines: 299 to 308 (9) 
  (*App)PrintUpdateError Lines: 308 to 315 (7)  
  (*App)PrintUpdateMessage Lines: 315 to 328 (13) 
  (*App)SafeEmitToCentral Lines: 328 to 334 (6) 
  (*App).SafeEmitToCentralfunc1 Lines: 329 to 337 (8) 
  (*App)SafeEmitExceptionToCentral Lines: 337 to 343 (6)  
  (*App).SafeEmitExceptionToCentralfunc1 Lines: 338 to 347 (9)  
  (*App)InitializeCentral Lines: 347 to 354 (7) 
  (*App).InitializeCentralfunc1 Lines: 348 to 357 (9) 
  (*App)ConfigureAnalytics Lines: 357 to 370 (13) 
File: configure.go  
  (*App)Config Lines: 8 to 23 (15)  
File: explain.go  
  (*App)Explain Lines: 18 to 52 (34)  
File: glamour.go  
  (*App).getRenderingThemefunc1 Lines: 155 to 157 (2) 
  (*App).getRenderingThemefunc2 Lines: 182 to 184 (2) 
File: rate_response.go  
  (*App)rateResponse Lines: 17 to 88 (71) 
File: spinner.go  
  (*App).startProgressIndicatorWithLabelfunc1 Lines: 235 to 237 (2) 
File: suggest.go  
  SuggestTargetAllowed Lines: 54 to 59 (5)  
  (*SuggestTarget)Set Lines: 59 to 76 (17)  
  SuggestTargetString Lines: 76 to 81 (5) 
  SuggestTargetType Lines: 81 to 137 (56) 
  (*App)Suggest Lines: 137 to 267 (130) 
  (*App)suggest Lines: 267 to 317 (50)  
  (*App).suggestfunc1 Lines: 294 to 320 (26)  
  (*App).suggestfunc2 Lines: 298 to 299 (1) 
  (*App)revise Lines: 320 to 355 (35) 
  (*App).revisefunc1 Lines: 338 to 358 (20) 
  (*App).revisefunc2 Lines: 342 to 343 (1)  
  (*App)explain Lines: 358 to 389 (31)  
  (*App).explainfunc1 Lines: 370 to 392 (22)  
  (*App).explainfunc2 Lines: 374 to 375 (1) 
  (*App)copyClipboard Lines: 392 to 402 (10)  
  retryOnceForRateLimit Lines: 402 to 417 (15)  
File: version.go  
  (*App)Version Lines: 11 to 14 (3) 

Package github.com/github/gh-copilot/internal/prompter: github.com/github/gh-copilot/internal/prompter
File: prompter.go 
  (*Prompter)Select Lines: 44 to 65 (21)  
  (*Prompter)MultiSelect Lines: 65 to 89 (24) 
  (*Prompter)Input Lines: 89 to 98 (9)  
  (*Prompter)ask Lines: 98 to 120 (22)  
  (*Prompter).askfunc1 Lines: 104 to 112 (8)  
  latinMatchingFilter Lines: 127 to 131 (4) 
File: survey.go 
  (*Prompter).askfunc2 Lines: 155 to 159 (4)  

Package main: github.com/github/gh-copilot
File: main.go 
  main Lines: 50 to 56 (6)  
  mainRun Lines: 56 to 102 (46) 
  mainRunfunc1 Lines: 78 to 84 (6)  
  mainRunfunc2 Lines: 86 to 105 (19)  
  newCapiClient Lines: 105 to 132 (27)  
  handleError Lines: 132 to 162 (30)  
  initPrompterIO Lines: 162 to 190 (28) 
  initPrompterIcons Lines: 190 to 220 (30)  
  initPrompterTemplates Lines: 220 to 238 (18)  

Package github.com/github/gh-copilot/internal/errs: github.com/github/gh-copilot/internal/errs
File: <autogenerated> 
  (*SanitizedError)Error Lines: 1 to 1 (0)  
  (*SanitizedError)Unwrap Lines: 1 to 1 (0) 
File: formatted_errors.go 
  Print Lines: 13 to 19 (6) 
File: sanitized_error.go  
  SanitizedErrorError Lines: 19 to 27 (8) 
  SanitizedErrorUnwrap Lines: 27 to 33 (6)  
  Sanitize Lines: 33 to 45 (12) 

Package github.com/github/gh-copilot/internal/build: github.com/github/gh-copilot/internal/build
File: build.go  
  FormatVersion Lines: 29 to 40 (11)  

Package github.com/github/gh-copilot/internal/copilot/state/config: github.com/github/gh-copilot/internal/copilot/state/config
File: config.go 
  init Lines: 17 to 17 (0)  
  GetValueOrDefault Lines: 23 to 28 (5) 
  SetValue Lines: 28 to 32 (4)  
  loadConfig Lines: 32 to 54 (22) 
  saveConfig Lines: 54 to 69 (15) 
  getValueOrDefault Lines: 69 to 83 (14)  
  setValue Lines: 83 to 89 (6)  

Package github.com/github/gh-copilot/cmd/suggest: github.com/github/gh-copilot/cmd/suggest
File: suggest.go  
  NewSuggestCommand Lines: 17 to 69 (52)  
  NewSuggestCommandfunc1 Lines: 58 to 60 (2)  

Package github.com/github/gh-copilot/internal/capi/capimock: github.com/github/gh-copilot/internal/capi/capimock
File: client.go 
  (*Client)CreateThread Lines: 21 to 25 (4) 
  (*Client)CreateMessage Lines: 25 to 111 (86)  
  createSuggestMessage Lines: 111 to 126 (15) 
  (*Client)SendFeedback Lines: 126 to 131 (5) 
  (*Client)CheckAuth Lines: 131 to 131 (0)  

Package github.com/github/gh-copilot/cmd/version: github.com/github/gh-copilot/cmd/version
File: version.go  
  NewVersionCommand Lines: 14 to 25 (11)  
  NewVersionCommandfunc1 Lines: 18 to 20 (2)  

Package github.com/github/gh-copilot/internal/capi/capierrors: github.com/github/gh-copilot/internal/capi/capierrors
File: <autogenerated> 
  (*AuthError)Error Lines: 1 to 1 (0) 
  (*RateLimitError)Error Lines: 1 to 1 (0)  
File: auth.go 
  init Lines: 5 to 17 (12)  
  AuthErrorError Lines: 26 to 26 (0)  
File: rate_limit_error.go 
  RateLimitErrorError Lines: 13 to 14 (1) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment