Skip to content

feat(builtins): add tomlq builtin (jq-style TOML query and transform) #566

@chaliy

Description

@chaliy

Goal

Add first-class TOML processing without introducing a second major query language.

Proposal

Implement a native tomlq builtin with jq-style semantics:

  • parse TOML input/file into structured data
  • run existing jq/jaq-style filters against that data model
  • emit JSON by default
  • optional round-trip back to TOML for write/update workflows

Why this shape

Bashkit already has strong jq support. Reusing the jq mental model is lower-friction than adopting a separate TOML-specific DSL.

Initial scope

  • tomlq FILTER [FILE]
  • stdin support
  • -r raw output
  • -c compact JSON output
  • -t / --toml-output to render result back as TOML when possible
  • good errors for non-representable TOML values / invalid top-level output

Non-goals

  • shelling out to external tools
  • adding a large independent TOML CLI surface before validating demand

Implementation sketch

  • parse via Rust TOML crate
  • convert TOML -> JSON-like value for filter execution
  • optionally convert filtered result back to TOML for output
  • spec tests for read, select, update, stdin, invalid TOML, invalid round-trip cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions