# yq

## v4.x

- [yq](https://mikefarah.gitbook.io/yq/readme.md)
- [How It Works](https://mikefarah.gitbook.io/yq/how-it-works.md)
- [Recipes](https://mikefarah.gitbook.io/yq/recipes.md)
- [Upgrading from V3](https://mikefarah.gitbook.io/yq/upgrading-from-v3.md)
- [Evaluate](https://mikefarah.gitbook.io/yq/commands/evaluate.md): Evaluates the given expression against each yaml document in each file, in sequence
- [Evaluate All](https://mikefarah.gitbook.io/yq/commands/evaluate-all.md): Read all documents of all given yaml files into memory, then run the given expression once against the lot.
- [Shell Completion](https://mikefarah.gitbook.io/yq/commands/shell-completion.md): Generate a shell completion file for supported shells (bash/fish/zsh/powershell)
- [Operators](https://mikefarah.gitbook.io/yq/operators.md)
- [Add](https://mikefarah.gitbook.io/yq/operators/add.md)
- [Alternative (Default value)](https://mikefarah.gitbook.io/yq/operators/alternative-default-value.md)
- [Anchor and Alias Operators](https://mikefarah.gitbook.io/yq/operators/anchor-and-alias-operators.md)
- [Array to Map](https://mikefarah.gitbook.io/yq/operators/array-to-map.md)
- [Assign (Update)](https://mikefarah.gitbook.io/yq/operators/assign-update.md)
- [Boolean Operators](https://mikefarah.gitbook.io/yq/operators/boolean-operators.md)
- [Collect into Array](https://mikefarah.gitbook.io/yq/operators/collect-into-array.md)
- [Column](https://mikefarah.gitbook.io/yq/operators/column.md)
- [Comment Operators](https://mikefarah.gitbook.io/yq/operators/comment-operators.md)
- [Compare Operators](https://mikefarah.gitbook.io/yq/operators/compare.md)
- [Contains](https://mikefarah.gitbook.io/yq/operators/contains.md)
- [Create, Collect into Object](https://mikefarah.gitbook.io/yq/operators/create-collect-into-object.md)
- [Date Time](https://mikefarah.gitbook.io/yq/operators/datetime.md)
- [Delete](https://mikefarah.gitbook.io/yq/operators/delete.md)
- [Divide](https://mikefarah.gitbook.io/yq/operators/divide.md)
- [Document Index](https://mikefarah.gitbook.io/yq/operators/document-index.md)
- [Encode / Decode](https://mikefarah.gitbook.io/yq/operators/encode-decode.md)
- [Entries](https://mikefarah.gitbook.io/yq/operators/entries.md)
- [Env Variable Operators](https://mikefarah.gitbook.io/yq/operators/env-variable-operators.md)
- [Equals](https://mikefarah.gitbook.io/yq/operators/equals.md)
- [Eval](https://mikefarah.gitbook.io/yq/operators/eval.md)
- [File Operators](https://mikefarah.gitbook.io/yq/operators/file-operators.md)
- [Filter Operator](https://mikefarah.gitbook.io/yq/operators/filter.md)
- [First Operator](https://mikefarah.gitbook.io/yq/operators/first.md)
- [Flatten](https://mikefarah.gitbook.io/yq/operators/flatten.md)
- [Group By](https://mikefarah.gitbook.io/yq/operators/group-by.md)
- [Has](https://mikefarah.gitbook.io/yq/operators/has.md)
- [Keys](https://mikefarah.gitbook.io/yq/operators/keys.md)
- [Kind](https://mikefarah.gitbook.io/yq/operators/kind.md)
- [Length](https://mikefarah.gitbook.io/yq/operators/length.md)
- [Line](https://mikefarah.gitbook.io/yq/operators/line.md)
- [Load](https://mikefarah.gitbook.io/yq/operators/load.md)
- [Min](https://mikefarah.gitbook.io/yq/operators/min.md)
- [Map](https://mikefarah.gitbook.io/yq/operators/map.md)
- [Max](https://mikefarah.gitbook.io/yq/operators/max.md)
- [Modulo](https://mikefarah.gitbook.io/yq/operators/modulo.md)
- [Multiply (Merge)](https://mikefarah.gitbook.io/yq/operators/multiply-merge.md)
- [Omit](https://mikefarah.gitbook.io/yq/operators/omit.md)
- [Parent](https://mikefarah.gitbook.io/yq/operators/parent.md)
- [Path](https://mikefarah.gitbook.io/yq/operators/path.md)
- [Pick](https://mikefarah.gitbook.io/yq/operators/pick.md)
- [Pipe](https://mikefarah.gitbook.io/yq/operators/pipe.md)
- [Pivot](https://mikefarah.gitbook.io/yq/operators/pivot.md)
- [Recursive Descent (Glob)](https://mikefarah.gitbook.io/yq/operators/recursive-descent-glob.md)
- [Reduce](https://mikefarah.gitbook.io/yq/operators/reduce.md)
- [Reverse](https://mikefarah.gitbook.io/yq/operators/reverse.md)
- [Select](https://mikefarah.gitbook.io/yq/operators/select.md)
- [Shuffle](https://mikefarah.gitbook.io/yq/operators/shuffle.md)
- [Slice Array](https://mikefarah.gitbook.io/yq/operators/slice-array.md)
- [Sort](https://mikefarah.gitbook.io/yq/operators/sort.md)
- [Sort Keys](https://mikefarah.gitbook.io/yq/operators/sort-keys.md)
- [Split into Documents](https://mikefarah.gitbook.io/yq/operators/split-into-documents.md)
- [String Operators](https://mikefarah.gitbook.io/yq/operators/string-operators.md)
- [Style](https://mikefarah.gitbook.io/yq/operators/style.md)
- [Subtract](https://mikefarah.gitbook.io/yq/operators/subtract.md)
- [System](https://mikefarah.gitbook.io/yq/operators/system-operators.md)
- [Tag](https://mikefarah.gitbook.io/yq/operators/tag.md)
- [To Number](https://mikefarah.gitbook.io/yq/operators/to_number.md)
- [Traverse (Read)](https://mikefarah.gitbook.io/yq/operators/traverse-read.md)
- [Union](https://mikefarah.gitbook.io/yq/operators/union.md)
- [Unique](https://mikefarah.gitbook.io/yq/operators/unique.md)
- [Variable Operators](https://mikefarah.gitbook.io/yq/operators/variable-operators.md)
- [With](https://mikefarah.gitbook.io/yq/operators/with.md)
- [Output format](https://mikefarah.gitbook.io/yq/usage/output-format.md): Flags to control yaml and json output format
- [Working with Base64](https://mikefarah.gitbook.io/yq/usage/base64.md)
- [Working with CSV, TSV](https://mikefarah.gitbook.io/yq/usage/csv-tsv.md)
- [Working with JSON](https://mikefarah.gitbook.io/yq/usage/convert.md)
- [Working with Properties](https://mikefarah.gitbook.io/yq/usage/properties.md)
- [Working with XML](https://mikefarah.gitbook.io/yq/usage/xml.md)
- [Working with HCL](https://mikefarah.gitbook.io/yq/usage/hcl.md)
- [Working with LUA](https://mikefarah.gitbook.io/yq/usage/lua.md)
- [Working with TOML](https://mikefarah.gitbook.io/yq/usage/toml.md)
- [Working with KYAML](https://mikefarah.gitbook.io/yq/usage/kyaml.md)
- [Working with Shell Output](https://mikefarah.gitbook.io/yq/usage/shellvariables.md)
- [Front Matter](https://mikefarah.gitbook.io/yq/usage/front-matter.md)
- [Split into multiple files](https://mikefarah.gitbook.io/yq/usage/split-into-multiple-files.md)
- [GitHub Action](https://mikefarah.gitbook.io/yq/usage/github-action.md)
- [Tips, Tricks, Troubleshooting](https://mikefarah.gitbook.io/yq/usage/tips-and-tricks.md)

## v3.x

- [yq](https://mikefarah.gitbook.io/yq/v3.x/master.md): yq is a lightweight and portable command-line YAML processor
- [Upgrading from V2](https://mikefarah.gitbook.io/yq/v3.x/upgrading-from-v2.md): New features and breaking changes
- [Read](https://mikefarah.gitbook.io/yq/v3.x/commands/read.md): Returns matching nodes/values of a path expression for a given yaml document
- [Validate](https://mikefarah.gitbook.io/yq/v3.x/commands/validate.md): Validate a given yaml file
- [Compare](https://mikefarah.gitbook.io/yq/v3.x/commands/compare.md): Deeply compare two yaml documents
- [Write](https://mikefarah.gitbook.io/yq/v3.x/commands/write-update.md): Updates all the matching nodes of path expression in a yaml file to the supplied value.
- [Create](https://mikefarah.gitbook.io/yq/v3.x/commands/create.md)
- [Delete](https://mikefarah.gitbook.io/yq/v3.x/commands/delete.md): Deletes all the matching nodes for the path expression in the given yaml input
- [Merge](https://mikefarah.gitbook.io/yq/v3.x/commands/merge.md): Merge multiple yaml files into a one
- [Prefix](https://mikefarah.gitbook.io/yq/v3.x/commands/prefix.md): Prefixes a yaml document with the given path expression. The complete yaml content will be nested inside the new prefix path.
- [Shell Completion](https://mikefarah.gitbook.io/yq/v3.x/commands/shell-completion.md): Generate a shell completion file for supported shells (bash/fish/zsh/powershell)
- [Output format](https://mikefarah.gitbook.io/yq/v3.x/usage/output-format.md): Flags to control yaml and json output format
- [Path Expressions](https://mikefarah.gitbook.io/yq/v3.x/usage/path-expressions.md): Path expressions are used to deeply navigate and match particular yaml nodes.
- [Value Parsing](https://mikefarah.gitbook.io/yq/v3.x/usage/value-parsing.md): How values are parsed from the CLI to commands that create/update yaml (e.g. new/write).
- [Working with JSON](https://mikefarah.gitbook.io/yq/v3.x/usage/convert.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information, you can query the documentation dynamically by asking a question.
Perform an HTTP GET request on a page URL with the `ask` query parameter:
```
GET https://mikefarah.gitbook.io/yq/readme.md?ask=<question>
```
The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.
Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
