github / github/copilot-cli

Add /remove-dir command to revoke directory access

Đang mở
#4,830 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

triage
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

Describe the feature or problem you'd like to solve

Copilot CLI provides /add-dir and /list-dirs, but no corresponding command to remove a previously allowed directory. Users cannot reduce directory access during a session without restarting or otherwise resetting session state.

Proposed solution

Add /remove-dir <path> as the counterpart to /add-dir. It should:

  • Revoke file access to the specified previously allowed directory for the current session.
  • Remove the directory from /list-dirs immediately.
  • Unload trusted skills, agents, and instructions loaded from that directory when safe.
  • Clearly report active references or running work that prevent immediate removal.
  • Return a clear error when the path is not currently allowed.

This improves least-privilege workflows by allowing users to grant temporary access and revoke it as soon as it is no longer needed, without restarting the session.

Example prompts or workflows
  1. /add-dir C:\work\shared-library, work with files there, then run /remove-dir C:\work\shared-library when finished.

  2. Run /list-dirs, identify an accidentally added directory, and remove it with /remove-dir <path>.

  3. Temporarily allow access to generated artifacts, inspect them, then revoke access while keeping the current conversation.

  4. Attempt to remove a directory used by a running task and receive a clear message explaining what must finish or stop first.

Additional context

A dedicated removal command would make /add-dir reversible and provide a clearer least-privilege permission model. /reset-allowed-tools does not address directory access, and restarting a session is unnecessarily disruptive.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách xem xét các điểm vào lệnh hiện có của /add-dir và /list-dirs cũng như cách các quyền thư mục của phiên hiện tại được theo dõi. Xác định tiêu chí hoàn thành dựa trên các hành vi được yêu cầu: xóa khỏi /list-dirs, dỡ tải an toàn các tài nguyên đã tải, thông báo rõ ràng về các tham chiếu đang hoạt động hoặc công việc đang chạy, và trả về lỗi đối với các đường dẫn không được phép.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
shell
Lĩnh vực
cli, security
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.