Skip to content

gh copilot should shim the copilot CLI #12427

@williammartin

Description

@williammartin

Describe the feature or problem you’d like to solve

With the deprecated gh copilot extension and LLMs being trained so heavily on gh, the Copilot CLI agent (copilot) often seems to think that it would call gh copilot to invoke itself. See this conversation snippet for example:

 > If you wanted to execute yourself in a bash shell, what command would you call? No looking it up, just what your current context suggest

 ● Based on my version information and the fact that I'm the "GitHub Copilot CLI", the command would likely be:

     gh copilot

   This follows the pattern of gh being the GitHub CLI tool, with copilot as a subcommand/extension for the Copilot CLI functionality.
0.0.375-0
Commit: 52f36a4

Additionally, there are a lot of users out there for whom calling gh copilot now invokes the non-working extension. It would be nice if gh copilot could shim over the copilot CLI.

Proposed solution

A bit of handwaving here but since invoking copilot CLI would involve downloading a binary, we may want a confirmation step.

It doesn't need to be an extension, and it would be a subpar experience if it were an extension as extensions currently are today. However, in the past we've talked about having better support for "blessed" extensions where running the necessary command installs them without needing gh ext install, and this might dovetail nicely with that work.

Additional context

One pitfall in my memory is that cobra does an unstable sort on command names and when selecting the appropriate command, it linearly searches that sorted list. As such, we can't rely on ordering of command addition alone to prioritise a native command, if we went down that route.

Metadata

Metadata

Labels

enhancementa request to improve CLI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions