CommandCodeAI / CommandCodeAI/command-code

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

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

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

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
4k
Fork
350
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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

Tái hiện vấn đề bằng cách cài đặt command-code với npm, sau đó chạy cmdc --permission-mode default trong PowerShell và yêu cầu tạo một tệp. Bắt đầu bằng cách lần theo điểm vào của lời nhắc quyền, rồi so sánh mô tả công cụ được hiển thị với lệnh và các đối số được yêu cầu. Được xem là hoàn tất khi lời nhắc hiển thị đầy đủ lệnh PowerShell mà vẫn giữ lại mọi mô tả chung, và hành vi được xác minh cho kịch bản đã báo cáo.

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

Đánh giá

Công nghệ
powershell
Lĩnh vực
cli, security
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
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
64/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.