github / github/copilot-cli

Make `!shell` commands and their output visible to the agent

Fermée
#2,961 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area:context-memory area:tools
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

When I run a command through the !/bang syntax, 9 times out of 10 I want the agent to observe both the command and its output so I don't have to re-paste it.

### Proposed solution

Simply add the command line along with the command's output to the context, just as when the agent ran a command itself. It seems completely oblivious to commands I ran even though the mechanism should be pretty similar.

Nice to have:

- A per-invocation opt-out (e.g. `!!cmd` stays private) for commands with sensitive output.
- A setting for the default (visible vs. private).
- Truncation with "N lines omitted" for very long output, same as existing shell tool.

Why: Right now I either re-run the command through the agent (redundant) or paste the output manually (friction). Bang mode is faster to type but loses context, which defeats the purpose mid-conversation.

### Example prompts or workflows

```
rg 4996 || echo nothing

│ nothing

└ 1 line
```

As you can see, we already removed the pragmas.

### Additional context

```
❯ rg 4996

❯ Can you see the command and its output that I just ran?

● No — I don't have visibility into commands you run in your own terminal. I only see output from tools I invoke myself (powershell via this session, etc.). If you want me to see it,
paste it or let me re-run it.

❯ But it wasn't terminal. It was here with the ! prefix

● No — !-prefixed commands you run in the CLI UI aren't surfaced to me. I only see what's in the conversation stream (your messages, tool results from my own calls, system
notifications). If you want me to act on that output, paste it.
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start by tracing the !/bang command handling and compare it with the existing shell tool's command and output context behavior. Define how a bang command and its output appear in the conversation, then verify the core workflow where the agent can use the result; treat opt-out, default visibility, and truncation as separate decisions because the issue lists them as nice-to-haves.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
shell
Domaine
cli
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

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