CommandCodeAI / CommandCodeAI/command-code

Permission prompts show only tool descriptions instead of the actual shell command

Aperta
#651 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Nessun dato sulla lingua
Stelle
4k
Fork
350
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Summary

When Command Code requests permission to execute a mutating PowerShell command, the CLI displays only a generic tool description instead of the actual command and its arguments. This prevents users from reviewing exactly what will be executed before granting permission, which creates a significant safety and usability concern.

Expected Behavior

The permission prompt should display the complete command that Command Code is asking to execute, including all arguments, paths, flags, and redirections.
For example, the prompt should show:

New-Item -ItemType File -Path 'C:\Users{UserName}\command-code-permission-test-2.tmp' -Force:$false

The generic tool description may be shown in addition to the command, but it should not replace the command.

Actual Behavior

The CLI displays only a generic description such as:

Create a new file at specified path without overwriting

The actual PowerShell command, including the target path and parameters, is not visible in the permission prompt. The command is therefore difficult or impossible to audit before approval.

Additionally, I found that the fields below with default values cannot be edited. Whenever I try to edit one of these fields, it immediately reverts to its default value. Therefore, I cannot enter the information about my Command Code version, terminal, or shell in the fields below. I am providing the information here instead:

  • Command Code version: 1.14.1 (latest)
  • Terminal: Windows Terminal
  • Shell: PowerShell 7
Steps to reproduce the issue
  1. Install Command Code through npm:
    npm install -g command-code

  2. Start a normal interactive session without auto-accept or bypass mode:
    cmdc --permission-mode default

  3. Ask Command Code to create a new empty file, for example:
    Create a new empty file named command-code-permission-test-2.tmp in C:\Users\12391.

  4. Wait for the permission prompt.

  5. Observe that the prompt displays only a generic description, such as:
    Create a new file at specified path without overwriting

  6. Observe that the actual PowerShell command and its arguments are not displayed.

Command Code Version

Unknown

Operating System

Windows

Terminal/IDE

Unknown

Shell

cmd.exe

Session file (optional)

No response

Fix prompt (optional)

No response

Additional context

No response

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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

Riproduci il problema installando command-code con npm, quindi esegui cmdc --permission-mode default in PowerShell e richiedi la creazione di un file. Inizia tracciando il punto di ingresso del prompt di autorizzazione e confronta la descrizione dello strumento visualizzata con il comando e gli argomenti richiesti. Il lavoro è completato quando il prompt mostra il comando PowerShell completo mantenendo qualsiasi descrizione generica e il comportamento è verificato per lo scenario segnalato.

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

Valutazione

Stack tecnologico
powershell
Ambito
cli, security
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
64/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.