package oq

All checked builds pass
  1. Overview
  2. Docs
Agent-first org query CLI

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v1.0.4.tar.gz
sha256=fd09bc0bc22e5ad46128c01eb67aca814513207915f47d730cccaf67b8d29fd6
sha512=5cdb3d24df9d3af124c758f04bd54dc73dad19d7133439759a75fee62b4bca539aa09e2efda6e080baaaa86a371b2a56258b9e453465e9b887cd86cf4de5b0f3

Description

oq is a deterministic query CLI for Org files optimized for agent workflows.

Added to opam-repository:

README

oq

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

Features

  • Query selectors for Org structure and content (.headings, .section, .search, .text, .todos, .scheduled, etc.).
  • Function pipelines with filtering and projection (filter(...), map(...)).
  • Deterministic date behavior via --now (RFC3339) and --tz (IANA timezone).
  • Directory mode with stable ordering, parse warnings, and strict parse coverage mode.

Requirements

  • OCaml >= 5.1
  • dune >= 3.14

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

  • 0: success
  • 1: query or usage error
  • 2: I/O, path, or permission error
  • 3: parse coverage failure

Documentation

  • Product requirements: docs/PRD-oq-v1.md
  • Agent contract: docs/agent-contract.md
  • Agent query cookbook: docs/agent-playbook.md
  • Agent skill (low-context querying): skills/oq-org-query/SKILL.md
  • CI policy: docs/ci-gates.md
  • Performance notes: docs/performance-notes.md
  • GitHub workflow guidance: docs/gh-operations.md
  • Release pipeline: docs/release-flow.md

License

MIT. See LICENSE.

Dev Dependencies

None

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building oq with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
1.0.4 (this version) n/a n/a good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure