@anthriq/node-cli
v1.0.3
Published
CLI tool for packing and pushing operator registry nodes to the registry
Downloads
4
Readme
Node CLI
CLI tool for managing operator registry nodes. This tool helps you create, validate, and push operators to the registry.
Installation
cd tools/node-cli
npm install
npm run build # compile the TypeScript sources to dist/Tip: rerun
npm run buildwhenever you change the CLI source before invokingnode-cli.
Usage
Init - Create Operator Structure
Creates a folder structure template for a new operator:
node-cli init <operator-name> [options]Options:
-d, --dir <directory>- Target directory (default: current directory)
Example:
node-cli init myoperator
# Creates: ./myoperator/
# - lib/
# - meta.jsonDuring initialization the CLI will prompt you for key metadata (name, version, description, authors, tags, OS, architecture, entrypoint). Defaults are provided so you can hit enter to accept them.
Validate - Validate Operator
Validates the meta.json and folder structure:
node-cli validate <operator-path>Example:
node-cli validate operator_registry_nodes/myoperator
# or
node-cli validate ./myoperatorChecks:
- Folder structure (lib/ directory exists)
- meta.json exists and is valid JSON
- All required fields in meta.json
- Data type specifications
- Parameter definitions
- Signal definitions
- Entrypoint library exists
Push - Push to Registry
Validates, packages, and pushes operator to registry:
node-cli push <operator-path> [options]Options:
-r, --registry <url>- Registry URL (or setOPERATOR_REGISTRY_URLenv var)-t, --token <token>- Authentication token (or setOPERATOR_REGISTRY_TOKENenv var)
Example:
node-cli push operator_registry_nodes/myoperator --registry https://registry.example.com/api/operators --token your-tokenProcess:
- Validates the operator (same as
validatecommand) - Creates a tar.gz archive:
{operator-name}-{version}.tar.gz - Uploads to registry via POST request
- Cleans up temporary archive
Environment Variables
OPERATOR_REGISTRY_URL- Default registry URLOPERATOR_REGISTRY_TOKEN- Default authentication token
Operator Structure
operator_registry_nodes/
└── myoperator/
├── lib/
│ └── libmyoperator.dylib # Your shared library
└── meta.json # Operator metadataMeta.json Validation
The validator checks:
Required Fields
name- Must be lowercase, start with letter, alphanumeric + underscoresversion- Semantic versioning (e.g., "1.0.0")description- Human-readable descriptionauthors- Non-empty arraycreated_at- YYYY-MM-DD formattags- Array of stringsos- One of: darwin, linux, windowsarch- One of: arm64, x64, x86entrypoint- Library filename (must match OS)input_types- Array of data type definitionsoutput_types- Array of data type definitionsparameters- Array of parameter definitionssignals- Array of signal definitions
Data Types
"any"- Accepts any data typenumber- Requiressubtype: integer, double, or floatstring- Text valuesboolean- True/falsearray- Requiresitemsfieldobject- Requirespropertiesarrayenum- Requiressubtype,options, and optionallynumber_subtype
Parameters
- Must have
nameandtype required- Boolean (default: false)depends_on- Conditional requirementparameter- Name of parameter to depend onequals- Value must equalin- Value must be in array
Signals
- Must have
nameanddescription parameters- Array of signal parametersstandard- Boolean indicating standard signal
Examples
Create a new operator
# 1. Create structure
node-cli init myfilter
# 2. Copy your shared library
cp build/libmyfilter.dylib myfilter/lib/
# 3. Edit meta.json with your operator details
# 4. Validate
node-cli validate myfilter
# 5. Push to registry
node-cli push myfilter \
--registry https://registry.example.com/api/operators \
--token your-auth-tokenError Handling
The CLI will:
- Exit with code 1 on validation errors
- Show detailed error messages
- Warn about missing files but allow validation to pass
- Clean up temporary files on push errors
See Also
- META_JSON_DOCUMENTATION.md - Complete meta.json schema documentation
