@funcdraw/fd-cli
v0.1.10
Published
Command line interface for FuncDraw workspaces backed by the filesystem.
Readme
fd-cli
Command line interface for running FuncDraw workspaces directly from filesystem folders that contain .fs expressions. The CLI walks folders, exposes them through FuncDraw's resolver, and can evaluate any expression tree.
Installation
npm install -g @tewelde/fd-cliOnce installed globally you can invoke fd-cli from any FuncDraw workspace folder.
Usage
fd-cli <package-folder> --expression <name> [options]
fd-cli <package-folder> <name> [view-name]Arguments:
<package-folder>: folder that containspackage.jsonandfuncdraw.json(defaults tocwd).<name>: FuncDraw module or expression name; do not pass file paths such asmain.fs.
Key options:
-e, --expression <name>: expression name using collection segments (e.g.graphics/main).--view <name>: optional view expression name; falls back to the built-in default viewport when omitted.-f, --format <raw|svg|png>: choose between JSON output, SVG markup, or PNG bitmap rendering.-o, --out <file>: write SVG/PNG output to a file (PNG uses./fd-output.pngwhen omitted).--width,--height,--padding: configure render dimensions.--font <filename>: load a font from the workspacefontsfolder (defaults todefault.ttf; fd-cli bundles a monospace default based on Source Code Pro).--time,--time-name: control the injected FuncDraw time variable (seconds).--list: print all discovered expressions.
SVG output is printed to stdout when --out is omitted, while PNG output always writes to a file.
