CommandCodeAI / CommandCodeAI/command-code

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

Ouverte
#651 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Aucune donnée de langage
Étoiles
4k
Forks
350
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Reproduisez le problème en installant command-code avec npm, puis exécutez cmdc --permission-mode default dans PowerShell et demandez la création d’un fichier. Commencez par suivre le point d’entrée de l’invite d’autorisation et comparez la description de l’outil affichée avec la commande et les arguments demandés. C’est terminé lorsque l’invite affiche la commande PowerShell complète tout en conservant toute description générique, et que le comportement est vérifié pour le scénario signalé.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
powershell
Domaine
cli, security
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
64/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.