NAME

tomq - TOML query command for Developer Dashboard

SYNOPSIS

d2 tomq [path] [file]

DESCRIPTION

This command provides TOML query extraction for Developer Dashboard.

PURPOSE

This staged helper owns the public d2 tomq command. It accepts an optional dotted TOML path or $d-based Perl expression plus an optional input file, then hands the request to the shared query runtime so parsing, file-vs-STDIN handling, and output formatting stay consistent with the rest of the dashboard toolchain.

WHY IT EXISTS

It exists because the dashboard ships a private, repo-local TOML inspection tool instead of depending on a globally installed parser binary. Keeping tomq as a staged helper also preserves the thin-switchboard contract in bin/d2.

WHEN TO USE

Use this file when you are changing how d2 tomq chooses between STDIN and files, how it reports parse errors, or how the staged helper is wired into the shared query implementation.

HOW TO USE

Users run d2 tomq [path] [file]. The staged helper selects the TOML backend in the shared query runtime, which accepts the file and path in either order, reads STDIN when no file is given, prints scalar hits as plain text, and prints the whole parsed document when the path is $d or .. If the query text uses $d inside a Perl expression, the helper evaluates that expression against the decoded TOML document before formatting the result.

WHAT USES IT

It is used by the public d2 tomq command, by shell snippets that want a runtime-local TOML query tool, by integration smoke runs, and by the focused query-helper coverage under t/.

EXAMPLES

printf '[alpha]\nbeta = 4\n' | d2 tomq alpha.beta
d2 tomq settings.toml '$d'
d2 tomq '$d' settings.toml
printf '[foo]\na = 1\n[bar]\nb = 2\n' | d2 tomq 'sort keys %$d'
printf '[service]\nname = "demo"\n' | d2 tomq service.name