wave-binder-cli
v0.0.3
Published
CLI Tools for Wave Binder development
Readme
Wave Binder CLI
Command-line utilities to create and edit Wave Binder input JSON files.
Features
- Add new nodes to a target JSON file.
- Edit existing nodes (type and dependencies).
- Choose an existing JSON file interactively if not provided.
- Create a new JSON file from the CLI flow.
- Support node types:
SIMPLE,COMPLEX,MULTI,LIST.
Requirements
- Node.js 18+ (recommended)
- npm
Installation
Install dependencies:
npm installLink the CLI globally in your local environment:
npm run linkAfter linking, the command wbcli is available in your terminal.
CLI Commands
Add a node
wbcli add <nodeName> <nodeType> [options]Options:
-f, --father <fathernode>: add the new node inside a parent node.-j, --json <jsonfile>: target JSON file.
Examples:
wbcli add country MULTI -j test_target_file.json
wbcli add city SIMPLE -f address -j test_target_file.jsonNotes:
- If
<nodeType>is invalid, the CLI asks you to select a valid one. - If
--jsonis not provided, the CLI opens an interactive file picker.
Edit a node
wbcli edit <nodeName> [options]Options:
-t, --type <nodeType>: set a new node type.-j, --json <jsonfile>: target JSON file.
Example:
wbcli edit province -t MULTI -j test_target_file.jsonDuring edit, the CLI can also add/remove/reset dependencies interactively.
JSON Structure
Nodes are stored in an array and include fields such as:
nametypepathladep
Depending on the node type:
LISTnodes can contain aprotonode.COMPLEXnodes can containprotos(children nodes array).
You can use test_target_file.json as a reference example.
