github / github/copilot-cli

--allow-tool='shell(docker ps)' doesn't work

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

描述

### Describe the bug

https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference#tool-permission-patterns - documentation mentions `shell(git push)` as an example pattern for --allow-tool. This seems to imply that there's a flexible mechanism for allowing subcommands (we don't have to allow all `git` commands, we can pick specific subcommands like `git push` to allow).

This does work for `git` (I tested it with `git status`) but doesn't work for other commands. For example:
```copilot --model gpt-5-mini --allow-tool='shell(docker ps)' -p 'Run this command in Bash: `docker ps`'```

This doesn't work. Same with `shell(docker ps:*)`

### Affected version

GitHub Copilot CLI 1.0.21.

### Steps to reproduce the behavior

```copilot --model gpt-5-mini --allow-tool='shell(docker ps)' -p 'Run this command in Bash: `docker ps`'```

### Expected behavior

Expected the `docker ps` command to be allowed to run, without asking for permissions. But instead seeing "Permission denied and could not request permission from user"

### Additional context

_No response_

貢獻指南

開啟貢獻指南

研究方向

Start by reproducing the reported command with GitHub Copilot CLI 1.0.21, comparing shell(git status) with shell(docker ps) and shell(docker ps:*). Read the tool-permission-patterns documentation linked in the issue and trace the permission-pattern handling entry point. Done means the documented docker ps pattern runs without a permission prompt while unrelated commands remain protected.

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

評估

技術堆疊
docker, shell
領域
cli, security
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
描述清楚
新手友好度
68/100

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

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