(args: string[])
| 68 | // --------------------------------------------------------------------------- |
| 69 | |
| 70 | const USAGE = `Usage: fh-workflow deploy <workflow.json> [flags] |
| 71 | |
| 72 | Generates a self-contained, standalone Engine deployment bundle (docker-compose.yml, |
| 73 | engine-config.json, engine.env, README.md). The engine boots the workflow and runs |
| 74 | autonomously. Missing values are filled in interactively, or supplied via |
| 75 | --values when there is no terminal. |
| 76 | |
| 77 | LLM provider keys (set one for each provider your Agents use): |
| 78 | ${PROVIDER_IDS.map((id) => ` --${providerFlag(id)}-key KEY`).join("\n")} |
| 79 | |
| 80 | Custom components (extra containers to run alongside the engine): |
| 81 | --component DIR folder with a component.json (repeatable) |
| 82 | |
| 83 | Output: |
| 84 | --output DIR default: ./<workflow-name>-bundle |
| 85 | --force overwrite existing DIR |
| 86 | --log-level LEVEL ${logLevelSchema.options.join("|")} (default: info) |
| 87 | |
| 88 | Automation (no terminal — e.g. a Claude Code skill or CI): |
| 89 | --values FILE JSON partial deploy config supplying the answers |
| 90 | (chmod 600 — may hold secrets). Without a terminal, |
| 91 | any missing required value exits non-zero. |
| 92 | |
| 93 | --help, -h this message |
| 94 | `; |
| 95 | |
| 96 | // parseFlags / partialFromFlags / loadValues / missingRequired / configFromPartial |
| 97 | // are exported for unit testing; deployCommand is their only runtime caller. |
| 98 | export function parseFlags(args: string[]): RawFlags { |
| 99 | // One --<provider>-key string flag per catalog provider (flag = id lowercased). |
| 100 | const keyOptions = Object.fromEntries(PROVIDER_IDS.map((id) => [`${providerFlag(id)}-key`, { type: "string" as const }])); |
| 101 | const { values } = parseArgs({ |
| 102 | args, |
| 103 | options: { |
| 104 | ...keyOptions, |
| 105 | output: { type: "string" }, |
| 106 | "log-level": { type: "string" }, |
| 107 | values: { type: "string" }, |
no outgoing calls
no test coverage detected