FY-TOOL(1) libfyaml FY-TOOL(1)

fy-tool - fy-tool documentation

fy-tool [OPTIONS] [<file> …]

fy-dump [OPTIONS] [<file> …]

fy-testsuite [OPTIONS] <file>

fy-filter [OPTIONS] [-f FILE] [<path> …]

fy-join [OPTIONS] [-T PATH] [-F PATH] [-t PATH] [<file> …]

fy-ypath [OPTIONS] <ypath-expression> [<file> …]

fy-compose [OPTIONS] [<file> …]

fy-b3sum [OPTIONS] [<file> …]

fy-tool is the libfyaml command-line front-end for parsing, rewriting, querying, joining, testing and hashing YAML and JSON data.

The executable changes behaviour either by the invoked program name (fy-dump, fy-testsuite, fy-filter, fy-join, fy-ypath, fy-compose, fy-b3sum) or by an explicit mode-select option such as --dump or --filter.

The default mode is dump.

General options

Display the built-in help message.
Display the libfyaml version.
Suppress informational and non-fatal diagnostic output.
Set the minimum diagnostic severity emitted by the library. The default is 3 (warning level).
Control ANSI color output. Supported values are on, off, and auto. The default is auto.
Make spaces, tabs, and line breaks visible in text output.
Parse the input but suppress normal output generation.

Diagnostic options

Disable diagnostic output for the named module.
Enable diagnostic output for the named module.
Show the named diagnostic field. Supported values are source, position, type, and module.
Hide the named diagnostic field.

Parser options

Add DIR to the input include search path.
Select JSON input handling. Supported values are no, force, and auto. The default is auto.
Resolve anchors and merge keys while parsing.
Force YAML 1.1 rules when the input does not declare a version.
Force YAML 1.2 rules when the input does not declare a version.
Force YAML 1.3 rules when the input does not declare a version.
Follow aliases during path traversal and related path-based operations.
Accept relaxed indentation rules in flow mode.
Prefer recursive algorithms over iterative ones.
--ypath-aliases
Enable alias processing for ypath evaluation.
Allow duplicate mapping keys.
Collect multiple parsing errors before reporting failure.
Disable parser/emitter acceleration features.
Disable stdio buffering and use direct file-descriptor reads.
Disable memory-mapped input.
Disable the normal nesting-depth limit.

Emitter options

Set the output indentation width. The default is 2.
Set the preferred output width. Use inf for no width limit. The default is 80.
Select the output style. Supported values are original, block, flow, flow-oneline, json, json-tp, json-oneline, dejson, pretty, flow-compact, and json-compact.
Sort mapping keys before emitting output.
Preserve and emit comments where supported.
Strip anchors and aliases from emitted output.
Strip emitted tags.
Strip document start and end markers.
Omit keys whose values are empty or null.
Suppress normal output generation.
Do not append a final trailing newline.
Preserve single-line flow collection layout when possible.
Indent block sequences that appear inside block mappings.
Use streaming output mode. This is the default.
Disable streaming output mode.
Recreate streaming events instead of passing them through directly.

Testsuite options

Omit testsuite flow markers.
Omit testsuite document markers.
Omit testsuite scalar-style markers.
Build a document first and then generate the event stream from it.
Emit testsuite output in TSV format.

Input options

Read from FILE instead of standard input where the selected mode uses a single input source. If FILE begins with >, the remaining text is treated as literal input content.

Join options

Join into PATH. The default is /.
Take joined input from PATH. The default is /.
Emit only PATH from the joined result. The default is /.

YPATH options

Start evaluation from PATH. The default is /.
--dump-pathexpr
Dump the parsed path expression before evaluation.
Parse the expression but do not execute it.

Compose options

--dump-path
Dump the path while composing a document.

B3SUM options

Enable BLAKE3 hashing mode.
Use key-derivation mode with CONTEXT.
Omit file names from checksum output.
Emit raw digest bytes.
Emit only N output bytes, up to the BLAKE3 maximum.
Verify checksums read from input files.
Use keyed hashing, reading the secret key from standard input.
Select the BLAKE3 backend implementation.
List available BLAKE3 backends.
Set the worker-thread count. 0 means automatic selection and -1 disables threaded hashing.
Set the per-file I/O buffer size.
Set the minimum chunk size used for memory-mapped hashing input.
Set the maximum chunk size used for memory-mapped hashing input.

Modes

Select dump mode. This is the default and also the mode used by fy-dump.
Select testsuite mode. This is also the mode used by fy-testsuite.
Select filter mode. This is also the mode used by fy-filter.
Select join mode. This is also the mode used by fy-join.
Select ypath query mode. This is also the mode used by fy-ypath.
Select the internal scan-dump mode.
Select the internal parse-dump mode.
Select composer-driver dump mode. This is also the mode used by fy-compose.
Print YAML version information.

Dump a YAML file back out using the default emitter mode:

$ fy-dump invoice.yaml

Resolve anchors and strip labels from the result:

$ fy-dump -r --strip-labels simple-anchors.yaml

Read literal input text via --file:

$ fy-filter --file \">foo: bar\" /

Select data from a file using a path expression:

$ fy-filter --file simple-anchors.yaml /baz/bar

Join two root mappings into a single document:

$ fy-join simple-anchors.yaml invoice.yaml

Generate testsuite event output:

$ fy-testsuite invoice.yaml

List available BLAKE3 backends:

$ fy-b3sum --list-backends

Pantelis Antoniou <pantelis.antoniou@konsulko.com>

  • The only supported input and output character encoding is UTF8.
  • Sorting does not respect language settings.
  • There is no way for the user to specific a different coloring scheme.

libfyaml(3)

2019-2026, Pantelis Antoniou

March 15, 2026