Niet: YAML, JSON, TOML CLI Tool

3.2.0 · active · verified Thu Apr 16

Niet is a powerful command-line interface (CLI) tool designed for efficient interaction with YAML, JSON, and TOML data files. It allows users to slice, filter, map, transform, and convert structured data using simple expressions or advanced XPath features directly from the shell. Written in Python, `niet` is actively maintained, with its latest version 3.2.0 released in April 2023.

Common errors

Warnings

Install

Quickstart

This quickstart demonstrates basic data extraction from YAML and JSON files using `niet`. First, it creates a sample `config.yaml` file and extracts the project name. Then, it creates a `data.json` file and extracts a specific item's value using a filter expression.

echo "---\nproject:\n  meta:\n    name: my-app\n  version: 1.0.0" > config.yaml
niet config.yaml "project.meta.name"
# Expected output: my-app

echo '{"data": {"items": [{"id": 1, "value": "alpha"}, {"id": 2, "value": "beta"}]}}' > data.json
niet data.json "data.items[?id=2].value"
# Expected output: beta

view raw JSON →