github / github/copilot-cli

Feature Request: Allow/filter/ignore/include/exclude files/paths and file types/languages

Open
#899 4 comments 7 reactions 0 assignees View on GitHub
area:configuration area:permissions
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

### Describe the feature or problem you'd like to solve

There is no way to allow or disallow specific files or file types from being viewed and edited by GitHub Copilot.

### Proposed solution

Giving complete control over the GitHub Copilot CLI's ability to view and edit files will allow for file operations to be both at their most efficient but also incredibly secure, especially in contexts where the CLI is not being run in interactive mode. Bonus points if view and edit permissions can be managed separately. This feature request should be rolled up as part of #316.

### Example prompts or workflows

In interactive mode:
```bash
/allow-path # Allow the CLI to see file paths that match this pattern. If any are present, all other paths are disallowed.
/list-paths # List all allowed and disallowed file paths, and allow them to be interactively selected and removed from the list.
/disallow-path # Disallow the CLI from seeing file paths that match this pattern.
```

From the command line (these filters complement the configuration set in interactve mode):
```bash
copilot -p "What are the purposes of each .bat file in this repository?" --allow-path *.bat
copilot -p "Identify all the README files in this repository and what they each represent." --allow-path README.md --allow-path */*README.md
copilot -p "Are there any image files in this repository?" --disallow-path *.webp # Find images to compress
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.