Copilot CLI: Permissions, Config, Trusted Folders, and Environment Variables/Allow specific shell commands only
Permit a narrow shell tool pattern.
Section: Permissions, tools, paths, and URLs
Allow specific shell commands only
bash
bash
copilot --allow-tool="shell(git:*)" -p "Summarize branch divergence and recent merge risks."Explanation
A safer way to let Copilot use Git commands without opening everything.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Permissions, tools, paths, and URLs
Deny a dangerous shell action
Block a specific command even when a broader rule allows related commands.
Allow all tools, paths, and URLs
Disable approval prompts for the whole run.
Block a specific URL or domain
Prevent access to sites you do not want queried.