`--allow-tool` や `--deny-tool` を使って制御する。設定ファイルや環境変数による設定はできないが、aliasや関数設定で回避はできる。
```bash
lot() {
copilot \
# ファイルの編集を許可 (shellコマンド以外)
--allow-tool 'write' \
# gitコマンドは基本的に許可. ただし push/reset/clean は禁止
--allow-tool "shell(git:*)" \
--deny-tool "shell(git push)" \
--deny-tool "shell(git reset:*)" \
--deny-tool "shell(git clean:*)" \
# ghコマンドは基本的に許可. ただし、apiとpr mergeは禁止
--allow-tool "shell(gh:*)" \
--deny-tool "shell(gh api)" \
--deny-tool "shell(gh pr merge)" \
# curlコマンドは基本的に許可
--allow-tool "shell(curl)" \
# curlコマンドなどによるURLのアクセス先を絞る (Searchは対象外)
--allow-url "api.github.com" \
--allow-url "raw.githubusercontent.com" \
--allow-url "github.com" \
"$@"
}
```
> [!note]
> `--allow-tool "shell(gh:*)"` と `--allow-tool "shell(gh)"` は同じっぽい
## MOC
- 📒**関連**
- [[📕よく使うGitHub Copilot CLIの--allow-tool設定]]
- [[📰GitHub Copilot CLI における --allow-tool --deny-tool の環境変数・設定ファイル対応調査]]
- 🌌 **未解決問題**
- [[特定コマンドを設定ファイルで許可 (GitHub Copilot CLI)|特定コマンドを設定ファイルで許可]]
- [[特定コマンドを環境変数で許可 (GitHub Copilot CLI)|特定コマンドを環境変数で許可]]
- 📜**アクティビティ**
- 📝**トラブルシューティング**