Modify a YAML field in place.
Section: Scalar gotchas
Update a scalar with yq
bash
bash
yq -i '.app.version = "1.2.0"' app.yamlExplanation
A convenient way to bump versions or toggle config values automatically.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Scalar gotchas
Quote ambiguous boolean-like words
Avoid implicit booleans by quoting risky strings.
Quote date-like values
Prevent timestamps and date-like tokens from being auto-typed.
Single-quoted string
Keep backslashes literal and avoid interpolation-like behavior.