edikt 0.2.0
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:
-iin place,-e/-fscripts, 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 ediktBuilt on the excellent toml_edit and kdl-rs; see the README's "Why edikt?" note for the origin story.