v2.4.1 · released 2026-08-30

Small, sharp tools for the command line.

PTools is a handful of single-purpose utilities for the parts of engineering work that never quite fit into a pipeline. No daemon, no config file, no dependencies — just static binaries that do one thing and exit.

Utilities

Four binaries, each under 4 MB, built to be piped into something else.

pt-grep

Pattern search over very large log files. Streams from disk, keeps constant memory, and understands the timestamp formats most services actually emit.

pt-slice

Extract a time window from a log without loading the whole file. Accepts absolute ranges, relative offsets like --since 2h, and timezone overrides.

pt-csv

Streaming CSV/TSV wrangling: select, reorder, filter and aggregate columns on files that do not fit in memory. Output stays valid CSV, including quoting edge cases.

pt-diff

Structural diff for JSON, YAML and TOML. Reports what changed by path instead of dumping two walls of text and leaving you to spot the difference.

Usage

Every utility takes input on stdin or as a trailing file argument.

# errors in the last two hours, newest first
pt-grep ERROR --since 2h /var/log/app/service.log

# just the incident window, with timezone normalised to UTC
pt-slice 09:40 10:15 --tz UTC access.log > incident.log

# pull three columns out of a 2 GB export and sum one of them
pt-csv export.csv --select ts,region,bytes --sum bytes --by region

# what actually changed between two deploys
pt-diff old/values.yaml new/values.yaml

Each binary exits non-zero on no match, so they compose with && and set -e without surprises.

Changelog

2.4.1
Fix pt-slice mishandling DST transitions in zone-aware timestamps.
2.4.0
pt-csv gains --by for grouped aggregation; adds AVX2 build.
2.3.2
pt-diff now preserves key order when comparing TOML tables.
2.3.0
Initial public release of pt-grep and pt-slice.