Generated boolean options can only be set to `true` (no way to send `false`)
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
- 领域
- cli
调研方向
阅读 scripts/generate.ts,从 generateOptionLine 开始,检查生成的布尔选项如何传递到请求转换。更新生成的选项,使调用方能够发送 false,同时省略的布尔值仍不包含在部分更新中。完成标准是所示的 --no-autoDeploy 示例会发送 autoDeploy: false,且现有的布尔值行为仍然正常。
由索引模型根据 Issue 内容生成。
描述
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>.
- 主要语言
- TypeScript
- 星标
- 175
- 派生
- 52
- 平均合并
- 2 天 10 小时
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Dokploy/cli 的其他 Issue
-
Set User Agent to Avoid Cloudflare issues可能已有人在做 @Gourav224 于 40 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
-
apiGet sends params as ?input=<JSON> instead of named query params — all GET commands with parameters fail (400)可能已有人在做 @gooyoung 于 103 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 1/5 1 小时以内 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 72/100
-
application drop-deployment is missing required multipart upload options可能已有人在做 @gooyoung 于 102 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 62/100
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
ardia-browser/ardia#5042 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
clipy-recorder/clipy#695 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 83/100
ag-ui-protocol/ag-ui#3504 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Dokploy/dokploy#6151 · 2 条评论 ·
维护者通常 1 天内回复