oq

oq is an agent-first CLI for querying Org files with deterministic output.

Features

Requirements

Install Locally

git clone https://github.com/s-kostyaev/oq.git
cd oq
dune build
dune install

Build and Test

dune build
dune runtest

Usage

oq [--now RFC3339] [--tz IANA_TZ] [--strict] FILE_OR_DIR [QUERY]

Examples:

oq notes.org ".tree"
oq notes.org ".tree | .length"
oq notes.org ".tree | filter(.level <= 2) | map(.title)"
oq notes.org ".tree[0:5] | map(.start_line)"
oq notes.org ".headings | map(.title)"
oq notes.org ".section('Inbox', 6:8) | .text"
oq notes.org ".todos | filter(.state == 'NEXT') | map(.title)"
oq --now 2026-02-17T08:00:00-08:00 --tz America/Los_Angeles notes.org ".scheduled('next_7d') | map(.title)"
oq --strict notes/ ".headings | .length"

Exit Codes

Documentation

License

MIT. See LICENSE.