qmetrics.net

yq

Portable CLI processor for YAML, JSON, and XML

yq screenshot

yq is a command-line processor for YAML, JSON, XML, CSV, TOML, HCL, properties, and related formats. It uses jq-like expressions for reading and editing structured files.

Overview

yq is a lightweight Go binary for querying and transforming structured configuration and data files. Its expression style mirrors jq but extends to YAML, INI, XML, properties, CSV, TSV, TOML, and HCL, including Terraform-flavored HCL.

Common tasks include reading paths from files or stdin, in-place updates, merges across multiple inputs, array searches and edits, and format conversion such as JSON to YAML or XML. Multi-document YAML, front matter blocks, comments, tags, anchors, and styling are supported to varying degrees when updating.

Install options include direct binaries for many CPU and OS combinations, Homebrew, snap, Docker or Podman one-shot runs, package managers on Windows and macOS, and importing yqlib from Go code. Shell completion is available for several shells.

It can run in CI via a published GitHub Action. Documentation and recipes cover advanced merges, environment variable substitution, and timezone-aware date operators when timezone data is present in the container image.

Key features

  • jq-like queries across many formats
  • In-place YAML and JSON updates
  • Merge and multi-file reductions
  • Format conversion including Terraform HCL
  • Multi-document YAML and front matter
  • Colorized output and comment preservation
  • Go library package for embedding
  • Docker and Podman execution

Use cases

  • Patching Kubernetes or CI YAML files
  • Shell pipelines over JSON or YAML
  • Converting config between JSON and YAML
  • Terraform and properties file edits

Tags

Similar software

gulp.js

Streaming JavaScript toolkit for development workflow automation

Gulp automates repetitive development tasks by chaining streaming file transformations. It offers a small API, thousands of plugins, and runs with Node.js and other platforms used in major IDEs.

★ 32.9k⟳ 9 months agoMIT
Build & DeploymentDesktop/CLI app

Task

Cross-platform YAML task runner inspired by Make

Task runs project commands defined in a Taskfile.yml with a single CLI binary. It is intended as a readable alternative to Make for local workflows and CI.

★ 16.4k⟳ todayMIT
Build & DeploymentDesktop/CLI app

Chocolatey

Command-line package manager for Windows software

Chocolatey installs, upgrades, and manages Windows software from the command line, wrapping installers, executables, archives, and scripts into packages.

★ 11.6k⟳ 8 days agoApache-2.0
Build & DeploymentDesktop/CLI app

Conda

Cross-platform binary package and environment manager

Conda installs and updates packages, resolves dependencies, and manages isolated environments on major operating systems. Its CLI is open source and language-agnostic.

★ 7.6k⟳ 2 days agoBSD-3-Clause
Build & DeploymentDesktop/CLI app

Clasp

Command-line Google Apps Script project manager

clasp develops and deploys Google Apps Script from your terminal. It syncs local folders with script.google.com, manages versions and deployments, and supports standalone or container-bound projects.

★ 5.9k⟳ 3 months agoApache-2.0
Build & DeploymentDesktop/CLI app

watchfiles

Rust-backed Python file watch and reload

watchfiles watches paths and reloads or restarts Python processes when files change, with sync and async APIs.

★ 2.6k⟳ 5 days agoMIT
Build & DeploymentDesktop/CLI app