Skip to content

edikt 0.2.0

Choose a tag to compare

@jhheider jhheider released this 06 Jul 01:00
5fd7177

edikt edits config files without reflowing them: a lossless, format-preserving editor for JSONC/JSON5, JSON, INI, TOML, YAML, KDL, and sectionless key-value files (.env, .properties). It changes only the bytes you target - comments, indentation, quoting, and trailing commas in every untouched region survive byte-for-byte. Query it like jq, edit in place like sed, convert between formats with -T.

This is the first public release.

Highlights

  • Seven formats, one jq-flavored expression language, all lossless in place (-i).
  • Comments are first-class: read them (.foo.#), edit them (.foo.# = "TODO"), and stream every comment in a document (comments | select(.text | test("TODO")) | .path) - across all seven formats.
  • Format conversion (-T) that carries comments into the target's native syntax and warns, per lost feature, on anything a target can't hold.
  • Sed-shaped execution: -i in place, -e/-f scripts, stdin/stdout streaming, // defaults, and sed-shaped exit codes (a query that matches nothing is a silent no-op).

Install

brew install jhheider/tap/edikt
# or
cargo install edikt

Built on the excellent toml_edit and kdl-rs; see the README's "Why edikt?" note for the origin story.