Generated boolean options can only be set to `true` (no way to send `false`)

Đang mở Phù hợp với người mới
#58 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@anilonayy đang làm issue này rồi.

Từ ngày 11/10/2026.

  • #59 của @anilonayy — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
cli

Hướng nghiên cứu

Đọc scripts/generate.ts, bắt đầu từ generateOptionLine, và kiểm tra cách các tùy chọn boolean được tạo đi đến bước chuyển đổi yêu cầu. Cập nhật các tùy chọn được tạo để bên gọi có thể gửi false, trong khi các giá trị boolean bị bỏ qua vẫn nằm ngoài các bản cập nhật từng phần. Hoàn tất khi ví dụ --no-autoDeploy được đưa ra gửi autoDeploy: false và hành vi hiện có của boolean vẫn hoạt động.

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

Mô tả

Summary

Every boolean field in the generated commands is registered as a bare commander flag (.option('--autoDeploy', ...)). Passing the flag sends true; there is no way to send false. So you can't turn a setting off from the CLI, e.g. disabling auto-deploy, preview deployments, cleanCache or enabled on a schedule/notification.

For the handful of required boolean inputs (e.g. --isEnabled, --createEnvFile, --enabled), the CLI forces you to pass the flag, so those commands can only ever send true.

Reproduction (@dokploy/cli 0.30.7)

dokploy application update --applicationId <id> --autoDeploy false
# error: too many arguments for 'update'. Expected 0 arguments but got 1.

dokploy application update --applicationId <id> --autoDeploy=false
# error: unknown option '--autoDeploy=false'

dokploy application update --applicationId <id> --no-autoDeploy
# error: unknown option '--no-autoDeploy'

The generated code already converts the string "false" for booleans (opts.x === true || opts.x === "true"), but because the option takes no value, that string can never reach it.

Expected

Some way to send false, e.g. commander's standard negated flag:

dokploy application update --applicationId <id> --no-autoDeploy
# -> {"applicationId":"<id>","autoDeploy":false}

Omitted booleans should still be left out of the request entirely, so a partial update doesn't overwrite unrelated settings.

Root cause

generateOptionLine in scripts/generate.ts emits --<name> for boolean fields and never defines --no-<name>.

Ngôn ngữ chính
TypeScript
Star
175
Fork
52
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

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.

Issue khác của Dokploy/cli

Tất cả issue của Dokploy/cli

Issue tương tự

Thêm issue về TypeScript

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.