github / gh-copilot

Ask for assistance right in your terminal.
https://docs.github.com/en/copilot/github-copilot-in-the-cli
612 stars 18 forks source link

[FEAT]: Disable welcome header #32

Open umutbasal opened 4 months ago

umutbasal commented 4 months ago

Describe the need

Header message with welcome version transparency info takes long space and its very bad dx. There should be option to disable. or it should be prompted on just help command, not suggest and explain.

Version

version 0.5.4-beta

Relevant terminal output

Welcome to GitHub Copilot in the CLI!
version 0.5.4-beta (2024-01-04)

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. For more information, see https://gh.io/gh-copilot-transparency
andyfeller commented 3 months ago

Header message with welcome version transparency info takes long space and its very bad dx. There should be option to disable. or it should be prompted on just help command, not suggest and explain.

@umutbasal : While we understand this sentiment, however the disclaimer needs to be there.

Do you have suggestions how it might be redesigned to be more aesthetically pleasing?

Any mockups you'd like to suggest would be welcome ❤

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.

For more information, see https://gh.io/gh-copilot-transparency
mempler commented 3 months ago

IMO, any way would be just straight up annoying. It doesn't matter how it looks. Its just text that bloats the experienced. I do agree that this should be shown only once per version release though. or at the very least, once per shell session. So that it does not overflow the terminal with meaningless text

Especially since it takes up effectively half the terminal. image

droner-D commented 3 months ago

Its annoying to see the same message again and again.

andyfeller commented 3 months ago

@mempler @droner-D @umutbasal : I sympathize with your feelings, that the need to remind users to exercise caution and thoughtfulness before acting upon suggestions seems unnecessary in your particular use cases.

In order to potentially affect anything, it sounds like the best suggestions are:

  1. Show once per shell session
  2. Show once per release version

While I'm always happy to advocate based on users, I don't want to give you any false sense this would go away as GitHub does have security obligations it takes seriously.

mempler commented 3 months ago

I don't want to give you any false sense this would go away as GitHub does have security obligations it takes seriously.

By that logic, why does github copilot generated code never remind you that the code is AI generated? It effectively has even more dangerous potential than the one liner commands you run. (unless you run rm -rf / obviously)

As students who use copilot for coding love to implement security vulnerabilities through copilot since they dont know what they're doing.

I dont want to attack you or anything, Just want to say that your company has odd security measures where you enforce a security thing to one and not the other while being effectively the same.

den-is commented 3 months ago

still exists in version 1.0.1 (2024-03-22) 🤦 annoying af

AremJames commented 3 months ago

If you want a hacky way to remove the welcome header, (really not great but at least something) you can search for the gh-copilot binary (mine was located at ~/.local/share/gh/extensions/gh-copilot) and replace the welcome string in there with non-printable characters. Be sure to replace the characters instead of removing them, otherwise the binary would break. To remove the annoying long line "I'm powered by AI..." for example, you can use this bash command (executed in the folder where you found the binary):

replace_this="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. For more information, see https://gh.io/gh-copilot-transparency"; replace_with=$(echo $replace_this | sed 's/./\x05/g'); sed -i "s|$replace_this|$replace_with|g" gh-copilot

This will replace every character of the welcome header line with the non-printable char \x05 (i.e. "Enquiry") which is (to my knowledge) not used anymore and (at least in my shell) doesn't get printed. This obviously has to be redone every time the binary gets updated and I do not generally recommend messing with binaries, but for those of you who just want a hacky way to get rid of it for now, here you go.

However, there are still a few empty lines printed that are still taking up space.

umutbasal commented 3 months ago

@andyfeller I appreciate GitHub's commitment to security obligations, and I agree with @mempler that Copilot doesn’t prompt a message every time when completing code or answering questions. I don’t think there are different security concerns between VS Code Copilot and Copilot CLI.

If it’s about executing harmful commands, then I think it should be prompted when choosing execute command in the suggest option. These types of messages are commonly shown in the root command of CLI applications, and I would prefer it that way too.

@AremJames tried that but didn't worked for me I published my workaround here https://github.com/umutbasal/tty-override