# Install oq with Homebrew, apk, MacPorts, Nix

Performant, and portable jq wrapper to support formats other than JSON. Version 1.3.5 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:oq
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install oq
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install oq
```

  Evidence: MacPorts ports tree: devel/oq/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add oq
```

  Evidence: Alpine Linux edge package indexes: oq from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#oq
```

  Evidence: nixpkgs package indexes: pkgs/by-name/oq/oq/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:oq
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/oq>
- **Version:** 1.3.5
- **Source summary:** Performant, and portable jq wrapper to support formats other than JSON
- **Homepage:** <https://blacksmoke16.github.io/oq>
- **Repository:** <https://github.com/Blacksmoke16/oq>
- **Upstream docs:** <https://blacksmoke16.github.io/oq>
- **License:** MIT
- **Source archive:** <https://github.com/Blacksmoke16/oq/archive/refs/tags/v1.3.5.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- oq (cli)
- oq (alias)

## Dependencies

- bdw-gc
- libyaml
- pcre2

## Build dependencies

- crystal

## Uses from macOS

- jq
- libxml2

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 1.3.5
- Local data: ok
- Upstream repository: https://github.com/Blacksmoke16/oq
- Upstream latest detected: v1.3.5 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

oq is a Crystal-written wrapper around `jq` that converts non-JSON formats into JSON for filtering and then serializes the result back out. Its core idea is to keep jq's filter language while adding practical YAML and XML input/output paths.

### Project history

George Dietrich introduced oq in a 2019 article after comparing existing jq-adjacent tooling and wanting a more portable, higher-performance option for large non-JSON documents. The project goals were portability, performance, and extending the formats that jq can handle without replacing jq's filter language.

The 1.x series broadened oq from a CLI into a small Crystal library as well. Release notes for v1.2.0 describe library support, a SimpleYAML format for streamable large inputs, and better handling of multiple non-JSON files; v1.3.0 added XML namespace options and forced-array behavior for XML parsing.

### Adoption history

oq remains a niche developer utility, but it has enough packaging surface to be available through Homebrew, Alpine, MacPorts, and Nix in the input metadata. Homebrew describes it as a performant and portable jq wrapper, with Crystal required only for source builds.

### How it is used

A typical use keeps jq syntax in place and adds format flags, such as reading YAML with `-i yaml`, writing XML with `-o xml`, or using the tool as a Crystal dependency through `OQ::Processor`. That makes it useful in shell scripts where JSON, YAML, and XML need the same transformation logic.

### Why package nerds care

oq is package-nerd interesting because it does less than a full data-query language and more than a one-off converter. It packages the proven jq execution model with format adapters and a single-binary distribution story, which is often the sweet spot for command-line glue.

### Timeline

- 2019: The author publishes the oq introduction and motivation.
- 2021-02-27: v1.2.0 adds library support, SimpleYAML, and improved multiple-file handling for non-JSON inputs.
- 2021-08-17: v1.3.0 adds XML namespace controls and XML force-array behavior.
- 2024-04-04: v1.3.5 is tagged.

### Related projects

- oq depends conceptually on jq and overlaps with yq-style data conversion workflows. Its implementation and library surface are tied to Crystal, libyaml, and XML/JSON conversion behavior.

### Sources

- <https://blacksmoke16.github.io/oq/>
- <https://dev.to/blacksmoke16/oq-a-portable-performant-jq-wrapper-18ka>
- <https://formulae.brew.sh/formula/oq>
- <https://github.com/Blacksmoke16/oq>
- <https://github.com/Blacksmoke16/oq/releases>
- <https://github.com/Blacksmoke16/oq/tags>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** oq
- **Version Scheme:** 0
- **Revision:** 2
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Nix - oq: normalized package name match | nixpkgs package indexes: pkgs/by-name/oq/oq/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - oq - 1.3.5-r0: normalized package name match | Alpine Linux edge package indexes: oq from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | portable jq wrapper with support of other formats than JSON | https://github.com/blacksmoke16/oq
- MacPorts - oq: normalized package name match | MacPorts ports tree: devel/oq/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [pcre2](https://www.automicvault.com/pkg/brew/pcre2/) - Runtime dependency declared by Homebrew.
- [crystal](https://www.automicvault.com/pkg/brew/crystal/) - Build dependency declared by Homebrew.
- [jaq](https://www.automicvault.com/pkg/brew/jaq/) - Shares av.db curated category or tags: cli, data-processing, developer-tools, jq, json.
- [python-yq](https://www.automicvault.com/pkg/brew/python-yq/) - Shares av.db curated category or tags: cli, data-processing, developer-tools, jq, json.
- [dasel](https://www.automicvault.com/pkg/brew/dasel/) - Shares av.db curated category or tags: cli, data-processing, developer-tools, json.
- [gron](https://www.automicvault.com/pkg/brew/gron/) - Shares av.db curated category or tags: cli, data-processing, developer-tools, json.
- [yq](https://www.automicvault.com/pkg/brew/yq/) - Shares av.db curated category or tags: cli, data-processing, developer-tools, json.
- [gojq](https://www.automicvault.com/pkg/brew/gojq/) - Shares av.db curated category or tags: cli, developer-tools, jq, json.
- [ijq](https://www.automicvault.com/pkg/brew/ijq/) - Shares av.db curated category or tags: cli, developer-tools, jq, json.
- [jnv](https://www.automicvault.com/pkg/brew/jnv/) - Shares av.db curated category or tags: cli, developer-tools, jq, json.

## Combined YAML source

View the package source record on GitHub. [combined/oq.yml](https://github.com/automic-vault/db/blob/main/combined/oq.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
