Skip to main content
Builtins catalog / nika:jq

Data

Tool family from the canonical registry.

invoke

Call this builtin through the invoke verb.

Read this contract

This reference preserves the specification at the revision linked below. Source examples are fragments: their surrounding tasks, inputs and permissions are not supplied here. Consult engine status and nika catalog --tools --json for the installed implementation; a registry declaration is not a runtime qualification.

Usage and behavior

illustration
Run a jq expression. The single data-transform-and-extraction language: map · filter · select · group_by · reshape · string-interpolation "\(.x)" · @base64/@base64d encoders (the embedded jaq has NO @csv/@tsv — use nika:convert to: csv) · array flatten · leaf_paths/getpath/setpath. The same jq used in extract: bindings (see 04-variables.md). jq is also the law after an extract: the model emits facts (infer.schema: as type: integer for numeric enums); this builtin (or nika:decide) names the level. Do not pay a second infer: to score. Teaching shape · examples/13-extract-then-law.nika.yaml. After . as $c, write ($c | map(...)) — a bare map( maps the current value (hint jq-as-map). input is any JSON value: a single ref (input: "${{ tasks.X.output }}") OR a constructed array for multi-input ops. Recursive merge of two objects (this is exactly why json_merge is NOT a builtin · jaq’s * does it) ·
illustration
Same shape combines / zips N inputs · build the array, index inside jq. The arg is expression:, exactly that name (not query: · not expr: · one name everywhere · the conformance oracle gates it). Throws · NIKA-BUILTIN-JQ-001 (program error at runtime · tool_error). Compile errors are caught statically (NIKA-VAR-005). Implementation · reference engine uses jaq (Rust jq).

Arguments

Pass the values required by the tool contract.

Permissions

Understand authority before granting effects.

Errors and recovery

Read diagnostics and choose a recovery policy.

Workflow templates

Put the fragment inside a complete workflow.

Contract provenance

Read the pinned specification · Canonical registry. Tool identity: nika:jq. Specification revision: f8c5df2127c7. The Lab language identity is language:tool:jq; the registry view is ecosystem:tool/nika:jq. They refer to this contract without merging their graph identities.