github / github/copilot-cli

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

Ouverte
#291 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area:permissions
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

### 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.
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.