github / github/copilot-cli

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

已關閉
#2,961 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area:context-memory area:tools
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

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

貢獻指南

開啟貢獻指南

研究方向

先追蹤 !/bang 命令的處理方式,並將其與現有 shell tool 對命令和輸出內容的處理行為進行比較。定義 bang 命令及其輸出在對話中如何呈現,接著驗證 agent 可以使用該結果的核心工作流程;將 opt-out、預設可見性和截斷視為獨立的決策,因為 issue 將它們列為 nice-to-haves。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
shell
領域
cli
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。