GitHub Copilot CLI
GitHub Copilot CLI is a terminal-native coding-agent harness. This entry covers its instruction discovery, session controls, and permissions, not the behavior of whichever model it runs.
Summary
GitHub Copilot CLI is a terminal-native coding-agent harness. This entry covers its instruction discovery, session controls, and permissions, not the behavior of whichever model it runs.
Instruction files
Repository-level instruction files this harness reads. Treat their effective permissions as part of the setup.
Recommended
- Put repository-wide conventions in
.github/copilot-instructions.md; use.github/instructions/**/*.instructions.mdwithapplyTowhen guidance should follow particular paths or file types. - Use
AGENTS.md,CLAUDE.md, orGEMINI.mdwhere their standard-location discovery is useful, and inspect the effective set with/instructions. - Keep user, repository, and path-specific instructions consistent because Copilot CLI combines applicable files without defining a general precedence order.
- In automation, allow only the tools and URLs the task needs and set an explicit model when reproducibility across environments matters.
- Treat
copilot initor/initas a repository authoring action: review the generated or updated.github/copilot-instructions.mdbefore committing it.
Avoid
- Describing this entry as coverage for Copilot in IDEs, GitHub.com, cloud agent, or code review; those surfaces have different support matrices.
- Assuming a path-specific instruction applies when its
applyTopattern does not match the files in the current task. - Using
--allow-allor--yoloas a routine shortcut outside an isolated environment. - Attributing instruction merging, permission prompts, or tool availability to the model.
Context & tool use
Copilot CLI combines applicable personal, repository, agent, and path-specific instructions at session start. Supported instruction files can import repository-local files with @path; /instructions shows the discovered set. Tool availability and approval are separate controls: --available-tools or --excluded-tools restrict what the model can see, while --allow-tool and --deny-tool control approval.
Known limitations
Instruction changes are not immediately applied to an already-running CLI session; start a new session or resume after exiting. Copilot CLI is evolving, so confirm current behavior with /help and the current command reference before depending on an option in automation.
Evidence
- officialGitHub Copilot CLI discovers repository-wide, path-specific, and agent instruction files from documented repository and user-level locations, with applyTo controlling path-specific instructions.
Adding custom instructions for GitHub Copilot CLI ↗ - officialCopilot CLI provides /instructions to inspect and toggle discovered instruction files and supports repository-local @path imports from supported instruction files.
GitHub Copilot CLI command reference ↗ - officialCopilot CLI asks for approval for potentially destructive tool use and supports separate allow or deny controls for tools, paths, and URLs.
Allowing and denying tool use ↗ - officialCopilot CLI's applicable user, repository, and path-specific instructions are combined without a general precedence order, so conflicting instructions should be avoided.
Adding custom instructions for GitHub Copilot CLI ↗