
jq
CLI轻量的命令行 JSON 处理器,用简洁的过滤表达式切片、筛选、映射与转换 JSON,零运行时依赖,是 agent 解析接口返回与日志的常用工具。
jq
jq is a lightweight and flexible command-line JSON processor akin to sed,awk,grep, and friends for JSON data. It's written in portable C and has zero runtime dependencies, allowing you to easily slice, filter, map, and transform structured data.
Documentation
- Official Documentation: jqlang.org
- Try jq Online: play.jqlang.org
Installation
Prebuilt Binaries
Download the latest releases from the GitHub release page.
The platform-specific assets are standalone executables, not archives. On macOS and Linux,
rename the downloaded file to jq and make it executable with chmod +x jq.
Docker Image
Pull the jq image to start quickly with Docker.
Run with Docker
Example: Extracting the version from a package.json file
docker run --rm -i ghcr.io/jqlang/jq:latest < package.json '.version'
Example: Extracting the version from a package.json file with a mounted volume
docker run --rm -i -v "$PWD:$PWD" -w "$PWD" ghcr.io/jqlang/jq:latest '.version' package.json
Building from source
Dependencies
- libtool
- make
- automake
- autoconf
Instructions
git submodule update --init # if building from git to get oniguruma
autoreconf -i # if building from git
./configure --with-oniguruma=builtin
make clean # if upgrading from a version previously built from source
make -j8
make check
sudo make install
Build a statically linked version:
make LDFLAGS=-all-static
If you're not using the latest git version but instead building a released tarball (available on the release page), skip the autoreconf step, and flex or bison won't be needed.
Cross-Compilation
For details on cross-compilation, check out the GitHub Actions file and the cross-compilation wiki page.
Community & Support
- Questions & Help: Stack Overflow (jq tag)
- Chat & Community: Join us on Discord
- Wiki & Advanced Topics: Explore the Wiki
License
jq is released under the MIT License. jq's documentation is
licensed under the Creative Commons CC BY 3.0.
jq uses parts of the open source C library "decNumber", which is distributed
under ICU License
相關資源

dasel
CLI用同一套选择器语法查询、修改和转换 JSON、YAML、TOML、XML、CSV、HCL、INI 等格式的数据,可以直接改写配置文件,也能在格式之间互转,适合 agent 在脚本里处理结构化数据。单个无运行时依赖的二进制文件,用法类似 jq / yq。
TomWright/dasel8k
yq
CLI类 jq 语法的轻量命令行处理器,可读取、修改和转换 YAML、JSON、XML、INI、CSV 等格式,支持原地编辑配置文件,单一 Go 二进制无依赖。
mikefarah/yq16.1k
jc
CLI把 dig、ps、ls、ifconfig 等上百种命令的输出及常见文件格式转换成 JSON,便于 agent 用 jq 或脚本可靠解析;也可作为 Python 库使用。
kellyjonbrazil/jc8.7k
Miller
CLI像 awk、sed、cut、join、sort 一样处理 CSV、TSV、JSON 等结构化数据,按字段名操作,支持清洗、聚合统计、格式转换与美化输出。命令为 mlr,Go 编写零运行时依赖。
johnkerl/miller10k
Claude Code
CLIAnthropic 官方终端编码 Agent:读懂代码库、修改代码、执行命令、处理 git 流程,支持插件、MCP 与无头模式(claude -p)。需要登录 Claude 账号或配置 API Key。
anthropics/claude-code151k
Codex CLI
CLIOpenAI 官方在本地运行的编码 Agent,Rust 实现,可读写代码、执行命令并在系统沙箱中运行;可用 ChatGPT 订阅登录,也可配置 API Key。
openai/codex130k