Jsonnet
Data templating language for generating JSON configurations. Jsonnet is a superset of JSON with variables, conditionals, functions, and imports — compiles down to plain JSON. Used to generate Kubernetes manifests, Grafana dashboards, and complex configurations that would be repetitive in plain JSON. Native Go and C++ bindings, Python via go-jsonnet.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Local execution only — no network exposure. Jsonnet can import files from the filesystem so agent execution environments should restrict JSONNET_PATH to prevent reading sensitive files.
⚡ Reliability
Best When
You're managing large, repetitive JSON configs (Kubernetes, Grafana, CI) and want a principled templating language with functions and inheritance instead of copy-paste.
Avoid When
Your config format is YAML-native or you need runtime dynamic configuration — use Helm/Kustomize for Kubernetes YAML or a proper config library for runtime settings.
Use Cases
- • Generate Kubernetes manifests with shared abstractions — define base configs once and override per environment (dev/staging/prod)
- • Build Grafana dashboard templates where panels share common variables, axes, and formatting via Jsonnet functions
- • Create parameterized config generation pipelines for agent infrastructure where configuration varies by environment or tenant
- • Reduce repetition in large JSON config files by using Jsonnet's object inheritance and mixin patterns
- • Generate multiple related output files (CI config, deployment manifests, API schemas) from shared Jsonnet libraries
Not For
- • General-purpose scripting or application logic — Jsonnet is data templating, not a programming language
- • YAML-first workflows — if your toolchain is YAML-native (Helm, Kustomize), Jsonnet adds friction
- • Runtime config loading — Jsonnet compiles to static JSON; it's a build-time tool, not a runtime config system
Interface
Authentication
No authentication — Jsonnet is a local CLI and library tool. No network calls; runs entirely locally.
Pricing
Jsonnet is open source and free. Commercial tools built on top of it (Tanka, Grafana Tanka) are also open source.
Agent Metadata
Known Gotchas
- ⚠ Jsonnet files use .jsonnet extension for executables and .libsonnet for libraries — mixing them up causes import errors
- ⚠ Import paths are relative to the file being compiled, not the working directory — set JSONNET_PATH or use --jpath flag for library discovery
- ⚠ Jsonnet has no native YAML output — must post-process JSON to YAML if needed (use jsonnet --yaml-stream or external converter)
- ⚠ Late binding in Jsonnet (self/super) can be confusing — object fields are lazily evaluated, leading to unexpected behavior with recursive self-reference
- ⚠ The go-jsonnet Python bindings (gojsonnet package) are separate from the C++ jsonnet package — API differs slightly between implementations
- ⚠ Circular imports cause infinite loops at compile time — Jsonnet has no cycle detection, so circular dependencies will hang the compiler
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Jsonnet.
Scores are editorial opinions as of 2026-03-06.