mirror of
https://github.com/jpetrucciani/aq.git
synced 2026-09-09 19:53:33 +00:00
multi-format data processing tool
https://aq.cobi.dev/
- Rust 96.3%
- Python 3.5%
- Nix 0.2%
| .github/workflows | ||
| benchmarks | ||
| docs | ||
| examples/starlark | ||
| scripts | ||
| src | ||
| tests | ||
| .envrc | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| default.nix | ||
| LICENSE | ||
| README.md | ||
aq
aq is a jq-style CLI for querying and rewriting structured data across more than just JSON.
It currently supports:
- jq-style query semantics and result streams
- JSON, JSONL, YAML, TOML, CSV, and TSV input and output
- output-only table rendering for inspection
- atomic in-place rewrites
- optional Starlark scripting and a persistent REPL with history, editing, and IDE-style completion for heavier transforms
Install
- Release artifacts:
tagged releases publish Linux musl
x86_64andaarch64, macOSaarch64, and Windowsx86_64binaries. - Nix: TODO
Quick Start
cargo build --release
aq '.users[] | select(.age >= 30) | .name' users.json
aq '.name' -
aq -f yaml -o json '.services[].port' compose.yaml
aq -o table '.items[] | {name, status, owner}' data.json
aq --stream 'select(.status >= 500)' logs.jsonl
aq --in-place '.version = "2.0"' config.toml
aq -n --starlark '1 + 2'
aq -n -P
Merging files
Use --slurp to read multiple input documents into one array, then merge the
first document with the second:
# Shallow object merge. Top-level keys from overlay.yaml replace base.yaml.
aq --slurp '.[0] + .[1]' base.yaml overlay.yaml
# Recursive object merge. Nested objects are merged, deepest values still let
# overlay.yaml win.
aq --slurp '.[0] * .[1]' base.yaml overlay.yaml
# Merge every slurped document recursively, in file order.
aq --slurp 'merge_all(true)' base.yaml env.yaml local.yaml
Docs
- Site source:
docs/ - Performance:
docs/performance.md - jq compatibility:
docs/jq-compatibility.md - Starlark:
docs/starlark.md - Starlark examples:
examples/starlark/README.md
Development
cargo fmt
cargo clippy --all --benches --tests --examples --all-features -- -D warnings
cd docs
bun install
bun run docs:dev