github / github/copilot-cli

Add /remove-dir command to revoke directory access

Aperta
#4,830 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

triage
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando i punti di ingresso esistenti dei comandi /add-dir e /list-dirs e il modo in cui vengono tracciate le autorizzazioni delle directory della sessione corrente. Definisci il completamento in base ai comportamenti richiesti: rimozione da /list-dirs, scaricamento sicuro delle risorse caricate, segnalazione chiara dei riferimenti attivi o delle attività in esecuzione e un errore per i percorsi non consentiti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
shell
Ambito
cli, security
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.