github / github/copilot-cli

Provide a brief explanation of the tool and command line that copilot-cli is requesting permission to run

未关闭
#291 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:permissions
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the feature or problem you'd like to solve

For a novice programmer who might be using Copilot CLI command approvals might be confusing as to exactly what they are doing and the risk involved. There is a fair bit of "pressure" to just approve a tool to keep the process moving. It would helpful to have more optional information here.

### Proposed solution

As an option, make an LLM call to explain:
1. The tool being run
2. The specific command line
3. The risk of the command line

Then that information could be surfaced in this warning here, perhaps as a additional "explain more" option in the list":

Image

This would allow users to make a better informed choice about what they are approving.

### Example prompts or workflows

_No response_

### Additional context

I'm not a prompt expert, but playing around I was doing something like this:

```
You are an agent tasked with helping explain a tool and a basic command line involving that tool to a beginner programmer. Your goal is to have a concise, easy to understand explaination of the following. Each line should only be one sentence at maximum:
1. What the named tool is, and what it does
2. What the specific command line given is doing
3. The risks of running this specific command line on a computer

From now on look for the prompt starting with "COMMANDLINE: " followed by a command line and provide a response for this.
```

So using Sonnet 4.5 as an example:

> COMMANDLINE: tree -L 3 -I 'node_modules|out|.vscode-test'

Would give this an an option for the user to see on the approval page.

```
1. What the tool is and what it does:
tree is a command-line utility that displays the directory structure of a folder in a visual tree format.
2. What this specific command is doing:
This command shows the folder structure starting from the current directory (.), going up to 3 levels deep (-L 3), while excluding any folders named node_modules, out, or .vscode-test (-I flag).
3. The risks of running this command:
This command is very safe—it only reads and displays directory information without modifying, deleting, or executing anything on your computer.
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。