github / github/copilot-cli

Allow copilot-cli to write via tool to only specific files

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

描述

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

When the copilot write tool option is allowed it gives access to all files

### Proposed solution

Allow to restrict the scope the model is allowed to write to, for example with directories or files
```bash
copilot --allow-tool 'write(foo.txt)' --allow-tool 'write(bar/)'
```

This is similar to the shell tool option that is already supported https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli#using-the-approval-options
```
copilot --deny-tool 'shell(git push)'
```

### Example prompts or workflows

```bash
copilot --allow-tool 'write(foo.txt)' --allow-tool 'write(bar/)'
```

### Additional context

_No response_

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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