| Crates.io | toml-collapse |
| lib.rs | toml-collapse |
| version | 0.1.0 |
| created_at | 2025-10-11 18:51:32.576939+00 |
| updated_at | 2025-10-11 18:51:32.576939+00 |
| description | A simple cli application for merging TOML files with duplicate keys |
| homepage | |
| repository | https://git.sagev.space/sage/toml-collapse |
| max_upload_size | |
| id | 1878444 |
| size | 20,622 |
This is a simple cli application for merging TOML files with duplicate keys.
I'm personally using this to maintain a few local overrides to a shared starship.toml file,
since TOML does not support duplicate keys or imports. For me, that looks like this:
# ~/.my_zshrc_local
cd ~/.config
toml-collapse starship-base.toml starship-overrides.toml > starship.toml
I tried to keep the --help text useful, so for now I'll just reproduce it here.
Collapse toml files, overwriting existing values with new ones, and merging any tables.
Useful for adding dynamic overrides to immutable configuration files.
Usage: toml-collapse [OPTIONS] [FILE]...
some-stdin | toml-collapse [OPTIONS] [FILE]...
New values overwrite existing ones, unless *both* are tables,
in which case they are merged, recursively following the same rules.
Any values from stdin are applied last (i.e. have the highest precedence)
By default, mutations of existing (non-table) values are reported via stderr.
Arguments:
[FILE]... Files to collapse
Options:
-h, --help: Show this help text
-n, --no-report Don't report replacements
-c, --concat-arrays Concatenate subsequent arrays, instead of replacing.
Array and non-array values will still replace each other.