A set of tools around GNU recutils.
Rust FFI bindings to librec with a safe wrapper to contain unsafe FFI calls.
Also has an optional arrow feature to read recfiles into Arrow RecordBatches and to serialize RecordBatches back out as .rec text (with %rec: / %type: / %mandatory: declarations).
CLI binary that converts .rec files to Apache Parquet
rec2parquet <INPUT> <OUTPUT> -t <TYPE> [-c <COMPRESSION>] [--max-row-group-size N] [-p] [-n]CLI tool to query .rec files with SQL via Apache DataFusion.
recsql <INPUT> -q '<SQL>'
recsql library.rec -q 'SHOW TABLES'
recsql library.rec -q '
SELECT b."Title", b."Year", a."Country"
FROM book b JOIN author a ON b."Author" = a."Name"
ORDER BY b."Year"'
# Query a CSV-derived recfile (no %rec: descriptor)
csv2rec books.csv > books.rec
recsql books.rec -q 'SELECT "Title", "Year" FROM rec ORDER BY "Year"'
# Emit results as a .rec record stream instead of the default pretty table
recsql library.rec -q 'SELECT "Title", "Year" FROM book' -f rec -t Book
# Write query results to a new .rec file with %type: / %mandatory: from the schema
recsql library.rec -q "
COPY (SELECT \"Title\", \"Year\", \"Pages\" FROM book WHERE \"Year\" > 1990)
TO '/tmp/recent.rec' STORED AS REC
OPTIONS ('record_type' 'Book')"cargo build --workspace --all-targetsThis repo also has a K recfile parser and a relational query engine in the folder k-rec
recutils-rs/build.rs searches for librec in this order:
RECUTILS_PREFIX(expectsinclude/andlib/underneath)RECUTILS_INCLUDE_DIRand/orRECUTILS_LIB_DIRbrew --prefix recutils(macOS Homebrew)- Compiler defaults
bindgen requires libclang (Xcode CLT on macOS, libclang-dev on Linux).
On Linux: apt install recutils libgnurec-dev.
A Claude Code skill teaching recsql usage lives at .claude/skills/recsql/SKILL.md. It covers the table-naming rules (named %rec: types vs. anonymous rsets), DataFusion identifier-quoting, declared-vs-inferred column types, and filter pushdown.
- Inside this repo: nothing to do — Claude Code auto-loads project-level skills from
.claude/skills/. - Anywhere else: copy it once into your user skills directory.
mkdir -p ~/.claude/skills/recsql
curl -fsSL https://raw.githubusercontent.com/Mark1626/recutil-tools/main/.claude/skills/recsql/SKILL.md \
-o ~/.claude/skills/recsql/SKILL.mdGPL-3.0-or-later