yq CLI

The Go CLI reads and edits YAML, JSON and related formats for targeted agent-assisted configuration transformations.

  • 16,229 ★ on the repository
  • Last commit
  • MIT
CLI

Extended access

Why this level

  • The CLI can read secret configuration fields and overwrites source files when `-i` is used.
All reasons and checks

mikefarah/yq

Install

Manual install

Text for your agent

Choose an official binary from the first Install section. Verify mikefarah/yq, test the expression on a copy and show output before using `-i`.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The CLI can read secret configuration fields and overwrites source files when `-i` is used.

This is third-party code. Review the repository files before installing.

What it does

Mike Farah’s yq selects and transforms structured data from the terminal. An agent can read a YAML value, update one element or merge documents using jq-like expressions across several formats. Input can be a file or stdin, with separate output or in-place editing. Users choose paths and review configuration changes before application. A standalone binary avoids a separate language runtime.

Who it is for. Application-configuration maintainers needing inspectable YAML and JSON changes in agent workflows.

Good fit when

  • An agent needs one field from a large YAML without printing the whole file.
  • A test configuration needs a targeted value change.
  • Several documents need merging under an explicit rule.
  • Another tool needs conversion between JSON and YAML.

Not a fit when

  • You require full compatibility with every jq expression.
  • All comments and whitespace must remain byte-identical.
  • The environment invokes a different yq implementation.

Example request

Read the selected test YAML field with yq and show the proposed value without in-place writing.

Limitations

This is the Go implementation from mikefarah/yq; first verify which executable the current PATH resolves. It supports many familiar jq operations but not all, so test complex expressions on a representative sample. Comments and whitespace are preserved where possible without universal guarantees. The `-i` flag writes back to the source file; start with a copy or separate output and inspect the resulting configuration.

How to disable. Remove yq from scripts and restore edited configuration from Git or backups if needed. Uninstalling the binary does not undo changes.

FAQ

How do I read a selected field?

The example `yq '.a.b[0].c' file.yaml` selects that path. Adapt it to your document structure.

How do I output JSON from YAML?

Use `yq -o json file.yaml`.

What does `-i` do?

It writes the result in place, modifying the original file.

Why was yes not treated as true?

YAML 1.2 does not treat yes and no as booleans.

Does this implementation need Python?

No. It provides standalone Go binaries.

Discussion

No questions or reviews yet.

CLI tools

The CLI decodes binary formats with jq-style queries so an agent can inspect file structure and extract selected fields.

CLIMinimal access10.6KRepository stars

The CLI selects and changes JSON, YAML and other structured values so agents can transform data with one query language.

CLIExtended access8.1KRepository stars

The CLI runs SQL over CSV, JSON and other tabular files so agents can join exports and select output formats.

CLIExtended access2.2KRepository stars

The CLI imports CSV and JSON into SQLite, runs SQL and reshapes tables for agent-assisted local data preparation.

CLIExtended access2.2KRepository stars

jc converts command output, files and strings into JSON with dedicated parsers for use in scripts and downstream tools.

CLIExtended access8.7KRepository stars

migrate CLI applies versioned database changes in order, with a chosen step count or target schema version for each run.

CLIExtended access19KRepository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialRepository starsMain difference
yq (this card)no16,229
fqno10,627uses jq-style queries to inspect binary formats
Daselno8,054The CLI selects and changes JSON, YAML and other structured values so agents can transform data with one query language.
jnvno6,131The interactive JSON viewer updates filter results while you type, helping users verify a query proposed by an agent.

README in short

Array selection, loading other files and environment-based values are supported. Output formats can be selected explicitly.

README badge

Report a problem

Foxx AIyq
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.