For the complete documentation index, see llms.txt. This page is also available as Markdown.

Working with TOML

Decode from TOML. Note that yq does not yet support outputting in TOML format (and therefore it cannot roundtrip)

Parse: Simple

Given a sample.toml file of:

A = "hello"
B = 12

then

yq -oy '.' sample.toml

will output

A: hello
B: 12

Parse: Deep paths

Given a sample.toml file of:

person.name = "hello"
person.address = "12 cat st"

then

will output

Encode: Scalar

Given a sample.toml file of:

then

will output

Parse: inline table

Given a sample.toml file of:

then

will output

Parse: Array Table

Given a sample.toml file of:

then

will output

Parse: Array of Array Table

Given a sample.toml file of:

then

will output

Parse: Empty Table

Given a sample.toml file of:

then

will output

Roundtrip: inline table attribute

Given a sample.toml file of:

then

will output

Roundtrip: table section

Given a sample.toml file of:

then

will output

Roundtrip: array of tables

Given a sample.toml file of:

then

will output

Roundtrip: arrays and scalars

Given a sample.toml file of:

then

will output

Roundtrip: simple

Given a sample.toml file of:

then

will output

Roundtrip: deep paths

Given a sample.toml file of:

then

will output

Roundtrip: empty array

Given a sample.toml file of:

then

will output

Roundtrip: sample table

Given a sample.toml file of:

then

will output

Roundtrip: empty table

Given a sample.toml file of:

then

will output

Roundtrip: comments

Given a sample.toml file of:

then

will output

Roundtrip: sample from web

Given a sample.toml file of:

then

will output

Encode: Simple mapping produces table section

Given a sample.yml file of:

then

will output

Last updated