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_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。