Pipelines CLI 用于直接、本地、一次性执行独立的 pipeline 规格文件。它并非 Flow CLI:不要运行 flow init,不要启动 Flow 运行时,也不要把独立的 pipeline 请求转换为 .flow/workflows。
用途
该技能适用于用户希望使用 pipelines CLI 对独立的 pipeline YAML 或 JSON 文件进行校验、预演或执行的场景,且不涉及 Flow 仓库。
CLI 可用性
使用前先验证二进制文件:
pipelines --version
如果命令缺失,从 GitHub Packages 安装已发布的包:
npm config set @workbench-ai:registry https://npm.pkg.github.com
npm install -g @workbench-ai/pipeline-cli
pipelines --version
如果 npm 报告 GitHub Packages 认证或注册表错误,告知用户 npm 需要 @workbench-ai GitHub Packages 访问权限,且令牌需具备读取包的权限,然后干净地停止,而不是回退到 Flow。
工作规则
- 除非用户明确要求跳过校验,否则在 pipelines run 之前先使用 pipelines validate。
- 只使用一个规格来源:--file PATH 用于 YAML 或 .json 文件,或 --stdin 用于从标准输入读取 YAML 或 JSON。
- 仅当仓库就绪状态、harness 或密钥有意不可用时,才使用 --schema-only 进行结构校验。
- 将 pipelines run --dry-run 视为变更前的就绪预检。
- 默认使用 --mode scratch;仅当用户明确希望在目标仓库产生副作用时,才使用 --mode project。
- 使用 --repo PATH 进行就绪检查和运行。不要使用 --server。
- 对于载荷,使用重复的 --input key=value、恰好一个 --payload-json,或恰好一个 --payload-file PATH。
- 当原始 JSON 载荷应来自标准输入时,使用 --payload-file -。
- 当其他工具或智能体需要结构化输出时,优先使用 --json。
- 不要使用已移除的 Flow 所属 pipeline 标志,例如 --pipeline-file、--pipeline-stdin 或 --pipeline-json。
常用流程
pipelines validate --file pipeline.yaml --repo . --json
pipelines run --file pipeline.yaml --repo . --dry-run --json
pipelines run --file pipeline.yaml --repo . --json
对于生成的规格:
cat pipeline.yaml | pipelines validate --stdin --repo . --json
cat pipeline.yaml | pipelines run --stdin --repo . --json
对于有意的原地运行:
pipelines run --file pipeline.yaml --repo . --mode project --json
JSON 输出
对于 pipelines validate --json,读取 success、schema_valid、readiness_checked、pipeline_id、workspace_mode、stage_ids、harnesses 和 errors。
对于 pipelines run --json,读取 status、terminal_reason、workspace_path、final_output、trace.summaries[] 和 harness_events。
除非顶层 status 或 stage 摘要失败,否则不要将 provider stderr 或工具级错误 span 视为终止。
本地参考
- 阅读 references/docs/cli.md 获取规范命令契约。在作者仓库树中,相同内容位于 docs/cli.md。
- 使用 references/docs/examples/pipelines 获取独立 pipeline 示例。
- 在改进此技能的产品本地 eval 表面时,使用 evals/evals.json 和 evals/README.md。