Brifing

Grev: Unix Filters Powered by Jev's Typed Question Models

Command-line tools that search by meaning rather than patterns

Hacker News: Show HN2 min

1Semantic Unix filters

Grev introduces a new approach to Unix filters by leveraging TypeSafe's Jev models. Instead of pattern matching like grep, these tools answer typed questions about input data. For example, grev can identify vegan meals from a menu by understanding food attributes. The tools maintain Unix philosophy - output remains your input, with optional metadata columns.

2Jev model integration

The tools use Jev models that answer questions with calibrated probabilities rather than generating text. This enables semantic operations like labeling log entries by meaning or ranking tickets by urgency. Unlike traditional NLP, Jev maintains type safety and focuses on structured question answering. Queries cost fractions of a cent per thousand lines.

3Practical use cases

Grev supports diverse operations: searching logs by meaning (e.g., finding timeout errors), guarding commits against secrets, labeling/tagging tickets, and deduplicating records by semantic similarity. The toolset includes specialized commands like pickv for extracting relevant lines and lookv for bisecting logs by semantic changes. Each tool has Unix-style man pages and --help.

4Command examples

Users can search nginx logs for timeout messages, filter commits by bug fixes, or validate changesets for secrets. The rank command sorts records by relevance to a query, while uniqv collapses semantically similar entries. Tools like cutv extract CSV columns matching descriptions, and seek finds files by content meaning. All commands maintain Unix pipe compatibility.

5Installation options

Grev provides native packages for Linux (deb, rpm, apk), macOS, FreeBSD and Windows. Arch users can build from PKGBUILD. Go developers can install via go install. The Makefile supports source installation with man pages and shell completions. Configuration uses a single ~/.grevconfig file with git-config syntax, manageable via jev commands.

6Configuration management

The tools centralize configuration in ~/.grevconfig, supporting API key storage (with mode 0600), spend limits, and tool-specific defaults. Users set daily/monthly spending caps and confidence thresholds. Command-line flags override environment variables, which override config. CI environments can use TYPESAFE_API_KEY. The jev command manages configuration and spending.

7Cost structure

Jev charges $0.042 per million input tokens, with free output. Typical operations cost cents - grepping 4,000 lines costs ~$0.008. The tools include safeguards like confirmation prompts for expensive operations. Users can monitor spending via jev spend. The cost model favors predictable pricing over complex token counting.

8Documentation and licensing

Grev provides comprehensive docs: DESIGN.md explains question phrasing and cost models, CONFIG.md details configuration. The project includes man pages for each tool and grev-tools(7) for overview. Licensed under Apache 2.0 or MIT at user's choice. Contributions are dual-licensed. The tools represent a novel approach to semantic processing in Unix pipelines.

Original article: Hacker News: Show HN — Grev: Unix Filters Powered by Jev's Typed Question Models