MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / parseFlags

Function parseFlags

ts/workflow-cli/cli/deploy/index.ts:70–104  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

68// ---------------------------------------------------------------------------
69
70const USAGE = `Usage: fh-workflow deploy <workflow.json> [flags]
71
72Generates a self-contained, standalone Engine deployment bundle (docker-compose.yml,
73engine-config.json, engine.env, README.md). The engine boots the workflow and runs
74autonomously. Missing values are filled in interactively, or supplied via
75--values when there is no terminal.
76
77LLM provider keys (set one for each provider your Agents use):
78${PROVIDER_IDS.map((id) => ` --${providerFlag(id)}-key KEY`).join("\n")}
79
80Custom components (extra containers to run alongside the engine):
81 --component DIR folder with a component.json (repeatable)
82
83Output:
84 --output DIR default: ./<workflow-name>-bundle
85 --force overwrite existing DIR
86 --log-level LEVEL ${logLevelSchema.options.join("|")} (default: info)
87
88Automation (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.
98export 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" },

Callers 2

index.test.tsFile · 0.90
deployCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected