difyctl 从不要求你确认命令,无法撤销的命令也不例外。运行这类命令前,先核对它要操作的 ID,例如用对应的 get 命令查看。
help 会把无法撤销的命令标为 destructive,例如 stop run 和操作服务器的 delete 命令。如果 help 把 stop run 显示为 write,说明你的服务器或 difyctl 版本过旧,还不会标出破坏性命令。在两者都更新之前,凡是没有标为 read 的命令,运行前都要核对目标。
用标志传值
每个要用的字段都以对应的标志传入,后面跟上值。命令的帮助会列出它的标志,以及每个标志的类型、默认值和是否必填。例如,以下是 run console_app workflow 的部分帮助内容:
Flags --app-id string required --inputs map<string, json> optional Variables declared by the app. … --workflow-id string optional Pin a published workflow version
值该怎么传,由类型决定。大多数字段直接传值即可。例如,按 ID 查看某个应用,ID 可从 difyctl get console_app 列出的结果中找到: