Split large configuration files into smaller, version-control–friendly pieces and reassemble them back into the original file.
Supported formats:
- XML
- JSON
- JSON5
- JSONC
- YAML
- TOON
- TOML
- INI
cargo install config-disassembler# Split config.json into ./config/
config-disassembler json disassemble config.json
# Rebuild config.json
config-disassembler json reassemble configResult:
config/
├── database.json
├── features.json
├── users.json
└── .config-disassembler.json
config-disassembler xml disassemble flow.xml \
--unique-id-elements name,idResult:
flow/
├── assignments/
├── decisions/
├── screens/
└── flow-meta.xml
These formats can be converted freely between each other:
- JSON
- JSON5
- JSONC
- YAML
- TOON
Example:
# Split JSON into YAML files
config-disassembler json disassemble config.json --output-format yaml
# Rebuild as JSON
config-disassembler json reassemble config --output-format jsonXML can be split into:
- XML
- JSON
- JSON5
- YAML
…and reassembled back into XML.
Advanced XML features are documented separately:
- unique-id strategy
- grouped-by-tag strategy
- split tags
- multi-level disassembly
See docs/xml.md.
TOML and INI are intentionally isolated:
- TOML ↔ TOML only
- INI ↔ INI only
This avoids lossy or invalid conversions.
See docs/formats.md for details.
config-disassembler <format> <command>
Formats:
xml
json
json5
jsonc
yaml
toon
toml
ini
Commands:
disassemble
reassemble
parse (XML only)
Examples:
config-disassembler yaml disassemble envs/
config-disassembler toml reassemble Cargo
config-disassembler xml parse flow.xml| Option | Description |
|---|---|
--output-format <fmt> |
Output format |
--unique-id <field> |
Name array items using a field |
--ignore-path <path> |
Ignore file path |
--prepurge |
Remove existing output before writing |
--postpurge |
Remove input after success |
Directory disassembly supports .gitignore-style filtering using .cdignore.
Example:
**/secret.json
**/generated/
Usage:
config-disassembler yaml disassemble envs/Each nested XML element is written to its own file using a unique identifier.
config-disassembler xml disassemble flow.xml \
--unique-id-elements name,idBest for:
- fine-grained diffs
- version control
- large metadata files
Groups nested elements by tag into shared files.
config-disassembler xml disassemble flow.xml \
--strategy grouped-by-tagBest for:
- fewer files
- quick inspection
- simpler layouts
See docs/xml.md for advanced XML configuration.
use config_disassembler::disassemble::{disassemble, DisassembleOptions};
use config_disassembler::reassemble::{reassemble, ReassembleOptions};
use config_disassembler::format::Format;Node.js support is available via napi-rs bindings:
See CONTRIBUTING.md.