Nodora
Getting started

Commands

Reference for the nodora CLI commands

The CLI exposes four commands: compile, eval (alias run), registry, and version.

compile

Compile a .ruleset source file to NIR JSON.

nodora compile -f path/to/rule.ruleset [-o path/to/output.json]

Flags:

  • -f, --file: source file (required).
  • -o, --output: output path. Defaults to the source path with the extension replaced by .json.

If the source has parse or semantic errors, the CLI prints them with file paths and source positions and exits non-zero.

eval / run

Evaluate a compiled NIR file against an input.

nodora eval -f rule.json [-r RuleName] (-i input.json | --stdin)

Flags:

  • -f, --file: compiled NIR JSON (required).
  • -r, --rule: rule name. Optional if the file contains exactly one rule.
  • -i, --input-file: JSON file with the input object.
  • --stdin: read input JSON from standard input.
  • --debug: print slot, op, and emission traces during evaluation.
  • -e, --exec "Signal=cmd": run a shell command for every emission of Signal. The placeholders {1}, {2}, ... are replaced with the signal's positional arguments.

The result is printed as JSON on stdout along with the elapsed time:

echo '{"age":21}' | nodora eval -f ExampleRule.json --stdin
\(^_^)/ evaluation completed in 5.89 µs
---
{"outputs":{"is_adult":true},"emitted_signals":[]}

Signal handlers

nodora eval -f AccountApproval.json -i input.json \
    -e "BlockAccount=./block.sh {1}" \
    -e "SendVerificationEmail=./send.sh {1}"

Each emission spawns a shell process (/bin/sh -c on Unix, cmd /c on Windows). The CLI waits for all spawned processes to finish before exiting.

registry

Introspect available built-in namespaces and functions.

nodora registry              # list namespaces and counts
nodora registry math         # list functions in a namespace
nodora registry core         # list bare-name (core) functions

The output prints each function's signature, description, argument table, and return type.

version

Print the installed CLI version.

nodora version

On this page