← All projects

Developer Tools / 2026

jqcpp

jqcpp is a C++20 command-line tool for selecting fields, array items, slices, keys, and calculated values from JSON input.

ROLECreator / C++ Engineer
FOCUSC++ CLI Tool
STATUSOpen source
DEMO_OUTPUTCLI_SESSION
Terminal examples of jqcpp filtering JSON data
LanguagePractical jq-like subset
ArchitectureCompiler-style stages
QualityLayered tests + CI

Supported filters

JSON is easy for software to exchange but awkward for a person to inspect quickly. Pulling one nested field or array slice often becomes a temporary script, manual copying, or a long scroll through an API response.

jqcpp implements identity filters, nested field and array access, slicing, iteration, simple arithmetic, length, and keys. This subset covers common terminal inspection tasks while keeping the grammar and evaluator small enough to study.

Implementation

The tool is divided into explicit stages. A JSON tokenizer and parser build the value tree. A separate expression lexer and parser produce a filter AST. The evaluator applies that AST to the input, and the pretty printer serializes the result.

Objects use vector-backed key-value storage so insertion order stays stable in formatted output. The value type is move-oriented with explicit deep-copy behavior where evaluation needs an independent result from nested data.

Tests and CI

Catch2 tests cover each stage and the complete command-line path. This makes it possible to locate failures in tokenization, parsing, evaluation, or output formatting. GitHub Actions configures the project, builds it, and runs the test suite on each change.