Files
medusa-store/www/utils/packages/workflows-diagrams-generator/src/index.ts
Shahed Nasser b39de05535 chore: move docs-util to www (#7232)
* reorganize docs apps

* add README

* fix directory

* add condition for old docs

* move docs-util to www

* remove remaining docs-util

* fixes of paths

* fix scripts

* path fixes

* fix github actions

* add build packages script
2024-05-06 09:13:50 +03:00

38 lines
1002 B
JavaScript

#!/usr/bin/env node
import { Command, Option } from "commander"
import generate from "./commands/generate.js"
const program = new Command()
program
.name("workflows-diagram-generator")
.description("Generate diagram(s) for workflow(s).")
program
.command("run")
.description(
"Generate Mermaid.js diagrams for your workflows based on the type you choose."
)
.argument(
"<workflowPath>",
"The path to a workflow file or a directory of workflow files."
)
.requiredOption(
"-o, --output <output>",
"The directory to output the files in."
)
.addOption(
new Option("-t, --type <type>", "Type of diagrams to be generated.")
.choices(["docs", "markdown", "mermaid", "console", "svg", "png", "pdf"])
.default("docs")
)
.option("--no-theme", "Remove theming from outputted diagrams.", true)
.option(
"--pretty-names",
"Prettify step names. Useful for creating presentational diagrams.",
false
)
.action(generate)
program.parse()