Skip to content

CLI Input Format Reference

This content is for v0.9.2. Switch to the latest version for up-to-date documentation.

Single source of truth for every Level 1 nxuskit-cli command’s input schema, with copy-paste runnable examples using the loopback provider.

All commands accept --input - for stdin and --format json (default). Output is wrapped in a ResponseEnvelope with trace_id, request_metadata, and timing fields.



LLM invocation. Accepts either prompt (single-turn) or messages (multi-turn).

Input schema (CallInput):

FieldTypeRequiredDescription
promptstringnoSingle-turn user prompt (convenience shorthand)
messagesarray of {role, content}noMulti-turn conversation messages
systemstringnoSystem message prepended to the conversation
providerstringnoProvider name (default: loopback, or $NXUSKIT_PROVIDER)
modelstringnoModel identifier (default: "default")
tool_definitionsarray of JSON objectsnoTool/function schemas passed to the LLM
max_tokensu32noMaximum output tokens
temperaturef32noSampling temperature
streamboolnoEnable streaming (JSONL output)

At least one of prompt or messages should be provided.

Example:

Terminal window
echo '{"prompt": "Hello", "provider": "loopback"}' \
| nxuskit-cli call --input - --format json

Common errors:

  • Invalid call input JSON: missing field ... — Fix: ensure the input is valid JSON with at least prompt or messages.
  • Unknown provider "xyz" — Fix: use a valid provider name (loopback, openai, claude, etc.) or set $NXUSKIT_PROVIDER.

ZEN decision table evaluation (Pro-gated).

Input schema (ZenEvalInput):

FieldTypeRequiredDescription
tableJSON objectyesJDM (JSON Decision Model) decision table definition
inputJSON objectyesContext data evaluated against the table

The table field must be a valid JDM model with nodes and edges arrays. Decision table nodes have type: "decisionTableNode" and contain rules in their content.

Example:

Terminal window
echo '{
"table": {
"nodes": [
{
"id": "1",
"name": "input",
"type": "inputNode",
"content": {}
},
{
"id": "2",
"name": "decision",
"type": "decisionTableNode",
"content": {
"hitPolicy": "first",
"rules": [
{"_id": "r1", "input.age": ">= 18", "output.status": "adult"}
],
"inputs": [{"id": "i1", "name": "age", "field": "input.age"}],
"outputs": [{"id": "o1", "name": "status", "field": "output.status"}]
}
},
{
"id": "3",
"name": "output",
"type": "outputNode",
"content": {}
}
],
"edges": [
{"id": "e1", "sourceId": "1", "targetId": "2", "type": "edge"},
{"id": "e2", "sourceId": "2", "targetId": "3", "type": "edge"}
]
},
"input": {"age": 25}
}' | nxuskit-cli zen eval --input - --format json

Common errors:

  • Entitlement check failed: zen — Fix: ZEN is Pro-gated. Ensure a valid Pro license is active.
  • Invalid ZEN eval input: missing field "table" — Fix: both table and input are required fields.

Z3 constraint solving (Pro-gated). Auto-detects three input formats.

The CLI accepts three distinct input formats, auto-detected at parse time:

FormatDetection RuleBest For
SimplifiedJSON with "type" on variables and string constraintsQuick CLI one-liners, human-authored problems
Library APIJSON with "var_type" on variables or "constraint_type" on constraintsCross-language scenario sharing with nxuskit-go/nxuskit-py
SMT-LIB 2Input starts with (Direct Z3 interaction, academic benchmarks

The library API format uses the same ConstraintInput struct as the Rust, Go, and Python SDKs. This means a JSON file authored for solver solve can be loaded directly by nxuskit.solve() in any SDK, enabling cross-language scenario sharing.


Input schema (SolverInput):

FieldTypeRequiredDescription
variablesarray of SolverVariableyesVariable declarations
constraintsarray of stringsyesConstraint expressions (e.g. "x + y == 10")
objectivestringno"minimize" or "maximize"
objective_exprstringnoExpression to optimize (requires objective)

SolverVariable fields:

FieldTypeRequiredDescription
namestringyesVariable identifier
typestringyes"integer", "real", or "boolean"
boundsarray of {"min": n} / {"max": n}noDomain bounds

Supported constraint operators: ==, !=, >=, <=, >, <. Arithmetic in LHS: x + y == 10, x - y == 5, x * y == 12.

Example (simplified):

Terminal window
echo '{
"variables": [
{"name": "x", "type": "integer", "bounds": [{"min": 0}, {"max": 10}]},
{"name": "y", "type": "integer", "bounds": [{"min": 0}, {"max": 10}]}
],
"constraints": ["x + y == 10", "x >= 3"],
"objective": "maximize",
"objective_expr": "x"
}' | nxuskit-cli solver solve --input - --format json

Input schema (ConstraintInput):

FieldTypeRequiredDescription
variablesarray of VariableDefnoVariable declarations
constraintsarray of ConstraintDefnoStructured constraint definitions
objectiveObjectiveDefnoSingle optimization objective
objectivesarray of ObjectiveDefnoMultiple objectives (multi-objective mode)
configSolverConfignoPer-request solver configuration overrides
retractarray of stringsnoNamed constraints to remove
assumptionsarray of ConstraintDefnoTemporary constraints (auto-retracted after solve)

VariableDef fields:

FieldTypeRequiredDescription
namestringyesVariable identifier
var_typestringyes"integer", "real", or "boolean"
domain{"min": f64, "max": f64} or [min, max]noDomain bounds
labelstringnoHuman-readable description

ConstraintDef fields:

FieldTypeRequiredDescription
namestringnoIdentifier for retraction / unsat core
constraint_typestringyes"eq", "neq", "lt", "gt", "le", "ge", "add", "sub", "mul", "div", "and", "or", "not", "implies", "iff", "all_different", "at_most", "at_least", "exactly", "in_range"
params / parametersJSON objectnoType-specific parameters (e.g. {"left": "x", "right": 3}). Both field names accepted. If omitted, auto-inferred from variables and expression fields (see below).
variablesstring[]noVariable names involved in the constraint. Used to auto-infer params when omitted.
expressionstringnoHuman-readable expression (e.g. "a * 20 = c"). Used to auto-infer params when omitted.
weightf64noSoft constraint penalty (omit for hard constraint)
labelstringnoHuman-readable description

ObjectiveDef fields:

FieldTypeRequiredDescription
namestringyesUnique objective identifier
directionstringyes"minimize" or "maximize"
expressionstringyesExpression to optimize (references variable names)
weightf64noWeight for weighted multi-objective mode
labelstringnoHuman-readable description
priorityu32noPriority for lexicographic mode (lower = higher priority)

Params auto-inference: When params/parameters is omitted or null, the CLI infers it from the variables and expression fields — matching the behavior of the Rust SDK’s ensure_parameters() helper. This means shared problem.json scenario files work directly without modification:

  • Comparison constraints (ge, le, eq, etc.) with variables: ["a", "b"] → infers params: {"left": "a", "right": "b"}
  • Arithmetic constraints (add, mul, etc.) with variables: ["a", "b", "c"] and expression: "a * 20 = c" → infers params: {"left": "a", "right": 20, "result": "c"}
  • Set constraints (all_different, at_most, at_least, exactly) with variables: ["x", "y", "z"] → infers params: {"variables": ["x", "y", "z"]}
  • Partial params (e.g., {"right": 19000} with variables: ["salary"]) → merges to {"left": "salary", "right": 19000}

Type aliases: The CLI accepts equal (→ eq) and not_equal (→ neq) as long-form constraint type names for compatibility with some scenario files.

Example (library API):

Terminal window
echo '{
"variables": [
{"name": "x", "var_type": "integer", "domain": {"min": 0, "max": 10}},
{"name": "y", "var_type": "integer", "domain": {"min": 0, "max": 10}}
],
"constraints": [
{"name": "sum", "constraint_type": "add", "params": {"left": "x", "right": "y", "result": 10}},
{"name": "lower_bound", "constraint_type": "ge", "params": {"left": "x", "right": 3}}
],
"objective": {
"name": "max_x",
"direction": "maximize",
"expression": "x"
}
}' | nxuskit-cli solver solve --input - --format json

Raw SMT-LIB 2 text. Auto-detected when input starts with (.

Example (SMT-LIB):

Terminal window
echo '(declare-const x Int)
(declare-const y Int)
(assert (>= x 0))
(assert (<= x 10))
(assert (>= y 0))
(assert (<= y 10))
(assert (= (+ x y) 10))
(assert (>= x 3))
(check-sat)
(get-model)' | nxuskit-cli solver solve --input - --format json

Common errors (all formats):

  • Entitlement check failed: solver — Fix: solver is Pro-gated. Ensure a valid Pro license.
  • Cannot parse constraint expression: 'x + y = 10' — Fix: use == for equality, not =.
  • Invalid solver input JSON: ... — Fix: ensure JSON is well-formed. Check that simplified format uses "type" (not "var_type").
  • Invalid solver library format: ... — Fix: library format requires "var_type" on variables and "constraint_type" on constraints.

CLIPS rule engine evaluation.

Input schema (ClipsEvalInput):

FieldTypeRequiredDescription
rulesstringyesCLIPS rule definitions (defrule, deftemplate, etc.)
factsarray of stringsnoInitial facts to assert (default: [])

Newline escaping: CLIPS rules contain newlines. In JSON strings you must use \n for line breaks. When piping from a shell, use $'...' quoting or a heredoc to embed literal newlines, then let jq handle escaping.

Example:

Terminal window
echo '{
"rules": "(defrule greet (person (name ?n)) => (assert (greeting (message (str-cat \"Hello \" ?n)))))",
"facts": ["(person (name \"World\"))"]
}' | nxuskit-cli clips eval --input - --format json

Multi-line rules (using jq for safe escaping):

Terminal window
RULES=$(cat <<'CLIPS'
(deftemplate person (slot name))
(deftemplate greeting (slot message))
(defrule greet
(person (name ?n))
=>
(assert (greeting (message (str-cat "Hello " ?n)))))
CLIPS
)
jq -n --arg rules "$RULES" '{"rules": $rules, "facts": ["(person (name \"World\"))"]}' \
| nxuskit-cli clips eval --input - --format json

Common errors:

  • Failed to load CLIPS rules: ... — Fix: check CLIPS syntax. Common issues: unbalanced parentheses, missing => in defrule.
  • Failed to assert fact '(foo)': ... — Fix: if using deftemplates, facts must match the template signature (e.g. (person (name "x")) not (person "x")).
  • Invalid CLIPS eval input: missing field "rules" — Fix: rules is required. Use "rules": "" for an empty ruleset.

Bayesian network inference via variable elimination.

Input schema (BnInferInput):

FieldTypeRequiredDescription
networkNetworkDefyesBayesian network structure and CPDs
evidencemap of string to stringnoObserved variable states (default: {})
query_nodesarray of stringsyesVariables to compute posterior probabilities for
algorithmstringnoInference algorithm (default: "variable_elimination")

NetworkDef fields:

FieldTypeRequiredDescription
nodesarray of NodeDefyesVariable definitions with states
edgesarray of EdgeDefyesDirected edges (parent to child)
cpdsmap of string to CpdDefyesConditional probability distributions

NodeDef fields:

FieldTypeRequiredDescription
namestringyesVariable name
statesarray of stringsyesPossible states for this variable

EdgeDef fields:

FieldTypeRequiredDescription
fromstringyesParent node name
tostringyesChild node name

CpdDef fields:

FieldTypeRequiredDescription
probabilitiesarray of f64yesFlat probability table (row-major order over parent states)

Example:

Terminal window
echo '{
"network": {
"nodes": [
{"name": "Rain", "states": ["yes", "no"]},
{"name": "Sprinkler", "states": ["on", "off"]},
{"name": "GrassWet", "states": ["wet", "dry"]}
],
"edges": [
{"from": "Rain", "to": "GrassWet"},
{"from": "Sprinkler", "to": "GrassWet"}
],
"cpds": {
"Rain": {"probabilities": [0.2, 0.8]},
"Sprinkler": {"probabilities": [0.4, 0.6]},
"GrassWet": {"probabilities": [0.99, 0.01, 0.9, 0.1, 0.8, 0.2, 0.0, 1.0]}
}
},
"evidence": {"GrassWet": "wet"},
"query_nodes": ["Rain"]
}' | nxuskit-cli bn infer --input - --format json

Common errors:

  • Invalid variable name '...': ... — Fix: node names must be non-empty alphanumeric identifiers.
  • Failed to set CPD for '...': ... — Fix: probability array length must equal the product of the node’s state count and all parent nodes’ state counts.
  • Invalid BN inference input: missing field "network" — Fix: network and query_nodes are both required.

Sequential multi-stage pipeline execution. Accepts YAML or JSON.

Input schema (PipelineDefinition):

FieldTypeRequiredDescription
namestringyesPipeline name
stagesarray of StageyesOrdered list of stages to execute

Stage fields:

FieldTypeRequiredDescription
namestringyesStage identifier
typestringyesStage type: "llm", "clips_eval", "zen_eval", "solver_solve", "bn_infer"
configJSON objectnoStage-specific configuration (passed to the engine)
output_keystringnoBind stage output to a named key for {{key}} interpolation in later stages

For llm stages, config accepts prompt, provider, and model. For clips_eval stages, config accepts rules and facts. For other stage types, config mirrors the respective command’s input schema.

Stages execute sequentially. Each stage receives the previous stage’s output. String values in config support {{key}} interpolation from output_key bindings. If a stage fails, all subsequent stages are marked "skipped".

Example:

Terminal window
echo '{
"name": "demo-pipeline",
"stages": [
{
"name": "generate",
"type": "llm",
"config": {"prompt": "Say hello", "provider": "loopback"},
"output_key": "llm_result"
},
{
"name": "evaluate",
"type": "llm",
"config": {"prompt": "Summarize: {{llm_result}}", "provider": "loopback"}
}
]
}' | nxuskit-cli pipeline run --input - --format json

Common errors:

  • Invalid pipeline definition: ... — Fix: ensure input is valid YAML or JSON with name and stages fields.
  • Unknown stage type: xyz — Fix: valid stage types are llm, clips_eval, zen_eval, solver_solve, bn_infer.
  • PipelineStageFailed { stage: "...", detail: ... } — Fix: check the stages[].result.message field in the output for the root cause.

Deep-merge multiple JSON artifact files with conflict detection.

This command takes multiple --input flags (not stdin JSON). Each input must be a JSON object (not an array or scalar).

CLI arguments:

ArgumentTypeRequiredDescription
--inputstring (repeatable)yes (>= 2)Paths to JSON files to merge
--merge-strategystringnoConflict resolution: "error" (default), "first", "last"

No JSON input schema — inputs are arbitrary JSON objects read from files.

Example:

Terminal window
echo '{"a": 1, "b": {"x": 10}}' > /tmp/art1.json
echo '{"b": {"y": 20}, "c": 3}' > /tmp/art2.json
nxuskit-cli artifact merge \
--input /tmp/art1.json --input /tmp/art2.json \
--format json

Common errors:

  • artifact merge requires at least 2 input files — Fix: provide at least two --input paths.
  • MergeConflict { paths: ["b.x"] } — Fix: two files have different values at the same key path. Use --merge-strategy first or --merge-strategy last to resolve.
  • '...' is not a JSON object — Fix: each input file must contain a JSON object ({...}), not an array or scalar.

Summarize a JSON artifact’s structure and estimated token cost.

CLI arguments:

ArgumentTypeRequiredDescription
--inputstringyesPath to JSON file or - for stdin

No JSON input schema — the input is any valid JSON value.

Output fields:

FieldTypeDescription
field_countu32Total number of fields (recursive)
top_level_keysarray of stringsKeys at the root level
estimated_tokensu32Rough token estimate (byte length / 4)

Example:

Terminal window
echo '{"name": "test", "data": {"x": 1, "y": 2}}' \
| nxuskit-cli artifact summarize --input - --format json

Common errors:

  • Invalid artifact JSON: ... — Fix: input must be valid JSON.

Validate a JSON document against a JSON Schema.

CLI arguments:

ArgumentTypeRequiredDescription
--inputstringyesPacket data file (JSON) or - for stdin
--schemastringyesPath to a JSON Schema file

No custom input schema — the packet is any JSON value validated against the provided JSON Schema.

Example:

Terminal window
echo '{"type": "string"}' > /tmp/schema.json
echo '"hello"' | nxuskit-cli packet validate --input - --schema /tmp/schema.json --format json

Output fields:

FieldTypeDescription
validbooltrue if the packet conforms to the schema
errorsarray of {path, message, keyword}Validation errors (empty when valid)

Common errors:

  • SchemaNotFound { path: "..." } — Fix: the --schema path must point to an existing file.
  • Invalid JSON Schema: ... — Fix: ensure the schema file is a valid JSON Schema draft.
  • Exits with code 1 when validation fails (output still written to stdout).

Iterative tool-augmented LLM loop. The model is called repeatedly until it converges (stops requesting tool calls) or hits max_iterations.

Input schema (ToolLoopInput):

FieldTypeRequiredDescription
promptstringyesInitial user prompt
providerstringnoProvider name (default: loopback or $NXUSKIT_PROVIDER)
modelstringnoModel identifier (default: "default")
max_iterationsu32noMaximum loop iterations (default: 10)
toolsarray of stringsnoTool adapter names: "file_reader", "calculator", "web_search"
tool_configsJSON objectnoPer-tool configuration
tool_definitionsarray of JSON objectsnoFunction/tool schemas passed to the LLM for function calling

Built-in tool adapters:

  • file_reader — reads a file, expects {"path": "..."} arguments
  • calculator — evaluates a math expression, expects {"expression": "..."} arguments
  • web_search — searches the web, expects {"query": "..."} arguments (MCP-gated)

Example:

Terminal window
echo '{
"prompt": "What is 2 + 2?",
"provider": "loopback",
"tools": ["calculator"],
"max_iterations": 5
}' | nxuskit-cli tool-loop run --input - --format json

Common errors:

  • Invalid tool-loop input: missing field "prompt" — Fix: prompt is the only required field.
  • Unknown tool adapter: xyz — Fix: valid adapters are file_reader, calculator, web_search.
  • Entitlement check failed: mcp — Fix: the mcp tool adapter is Pro-gated.

LLM-based candidate selection. Sends candidates and criteria to an LLM and parses a structured JSON response with scores and reasoning.

Input schema (JudgeSelectInput):

FieldTypeRequiredDescription
candidatesarray of CandidateyesCandidates to evaluate
criteriastringnoEvaluation criteria description
providerstringnoProvider name (default: "loopback")
modelstringnoModel identifier (default: "default")

Candidate fields:

FieldTypeRequiredDescription
idstringyesUnique candidate identifier
contentstringyesCandidate text to evaluate

Example:

Terminal window
echo '{
"candidates": [
{"id": "a", "content": "The answer is 42."},
{"id": "b", "content": "The answer is approximately 42.0."}
],
"criteria": "accuracy and conciseness",
"provider": "loopback"
}' | nxuskit-cli judge select --input - --format json

Common errors:

  • Invalid judge select input: missing field "candidates" — Fix: candidates array is required with at least one entry.
  • Failed to parse judge response as structured JSON: ... — Fix: the LLM must return a JSON object with selected_id, reasoning, and scores. The loopback provider may not produce valid judge output; use a real LLM provider for meaningful results.

Fan out a single prompt to multiple models concurrently.

Input schema (BranchForkInput):

FieldTypeRequiredDescription
promptstringyesPrompt sent to all models
modelsarray of stringsyesModel identifiers to invoke in parallel
providerstringnoProvider name (default: "loopback")
systemstringnoSystem message prepended to each request

Alternatively, models can be specified via the --models CLI flag as a comma-separated list, which overrides the models field in the JSON input.

Example:

Terminal window
echo '{
"prompt": "Explain recursion in one sentence.",
"models": ["model-a", "model-b"],
"provider": "loopback"
}' | nxuskit-cli branch fork --input - --format json

Using --models flag:

Terminal window
echo '{"prompt": "Explain recursion."}' \
| nxuskit-cli branch fork --input - --models model-a,model-b --format json

Common errors:

  • Invalid fork input: missing field "prompt" — Fix: prompt is required.
  • Invalid fork input: missing field "models" — Fix: provide models in JSON or via --models flag.

Compare results from a previous branch fork invocation. Input is the JSON output of branch fork (the BranchForkResult object).

Input schema (BranchForkResult):

FieldTypeRequiredDescription
resultsarray of BranchModelResultyesResults from branch fork

BranchModelResult fields:

FieldTypeRequiredDescription
modelstringyesModel identifier
contentstringyesModel’s response text
usage{input_tokens, output_tokens, total_tokens}noToken usage
elapsed_msf64yesResponse latency in milliseconds

Output includes:

  • comparison: per-model length and optional quality score
  • diffs: structural differences (content_length, word_count, sentence_count, elapsed_ms, content_similarity for 2-model comparisons)

Example (piping fork output to compare):

Terminal window
echo '{
"prompt": "Explain recursion.",
"models": ["model-a", "model-b"],
"provider": "loopback"
}' | nxuskit-cli branch fork --input - --format json \
| jq '.result' \
| nxuskit-cli branch compare --input - --format json

Common errors:

  • Invalid fork result input: missing field "results" — Fix: input must be a BranchForkResult object (the result field from a fork envelope, not the full envelope).