Open howlowck opened 8 months ago
Going through the open issues.. I think the proposed solution in this issue can be a middle ground between forcing user interaction and issue #2 (have copilot execute the suggested code). It would effectively put the onus on the user to use the resulting command however they see fit; they can pipe the result to execute it or to save it to a file. It's up to the user.
Thanks for opening up this issue, @howlowck!
I would like a way for the copilot cli
suggest
command to send only the suggested command to stdout, and then terminate the process, instead of being asked to copy the command to the clipboard.Eliminating the user interaction and sending the suggestion to stdout would also make it more programmable.
What are some use cases you are considering for making gh copilot
more programmable? What are your thoughts about situations where Copilot might not be able to give you an answer?
Another idea is that is similar is too. Add --copy
flag so all you have to do is paste after it has run, reducing input required and --copy I would just put into my ghcs
and ghce
aliases so I can have it always behave that way.
Another idea is that is similar is too. Add
--copy
flag so all you have to do is paste after it has run, reducing input required and --copy I would just put into myghcs
andghce
aliases so I can have it always behave that way.
Thanks for beating me to the punch, @rlove, and already upgrading to v1.0.0
! ✨ So a few things I was thinking about regarding this issue up to GA:
ghcs
works like the technical preview of executing commands in the context of the shell that invoked the experience using the gh copilot suggest --shell-out
flag. Everything about gh copilot
outputs to stdout, it's how most CLIs work, so you could use this flag.
All of that said, GitHub Copilot in the CLI is not currently designed for or intended to be used in an automated fashion as being discussed. Ideally there would be a Copilot SDK or library for people who want to build an automated experience. The challenge is that most conversational chat involves human interaction and multiple rounds of revision.
Please add this, since I can't execute commands in Fish, this would at least let me pipe the command into my shell.
I'm interested in just the first part, getting the suggestion, but not necessarily the programmable part. I hope that programmability aspect isn't a reason that this suggestion is ignored.
Being able to only get the suggested command has useful productivity aspects, it's a quick lookup helper that gets out of your way.
More often than not I'd like to use Copilot CLI to just get the suggestion and use that as a jumping-off point. I don't really need a perfectly precise result, it is after all just a suggestion.
$ gh copilot suggest --non-interactive -t shell "How do I get all the ECS Fargate tasks running in a cluster?"
<blah blah blah>
aws ecs list-tasks --cluster <cluster-name> --launch-type FARGATE
I am currently having to get the suggestion, and then ⬇️⬇️⬇️⬇️⬇️ interactively exiting, each time I use the tool.
Is no one regularly using this tool or why does this option not exist, we need this! :)
..but dont worry guys, I got you!
https://gist.github.com/Pl8tinium/3702c356a83b7363f3ab769d6ec47e2a
Describe the need
I would like a way for the copilot cli
suggest
command to send only the suggested command to stdout, and then terminate the process, instead of being asked to copy the command to the clipboard.Eliminating the user interaction and sending the suggestion to stdout would also make it more programmable.
Version
Do these docs apply to a specific version? currently using
version 0.5.4-beta (2024-01-04)
, but should apply to all versionsRelevant terminal output
Instead of...
It would just be...