config-disassembler
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
Installation
Quick start
JSON
# Split config.json into ./config/
# Rebuild config.json
Result:
config/
├── database.json
├── features.json
├── users.json
└── .config-disassembler.json
XML
Result:
flow/
├── assignments/
├── decisions/
├── screens/
└── flow-meta.xml
Format support
Cross-format conversions
These formats can be converted freely between each other:
- JSON
- JSON5
- JSONC
- YAML
- TOON
Example:
# Split JSON into YAML files
# Rebuild as JSON
XML
XML 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
TOML and INI are intentionally isolated:
- TOML ↔ TOML only
- INI ↔ INI only
This avoids lossy or invalid conversions.
See docs/formats.md for details.
CLI overview
config-disassembler <format> <command>
Formats:
xml
json
json5
jsonc
yaml
toon
toml
ini
Commands:
disassemble
reassemble
parse (XML only)
Examples:
Common options
| 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 |
Ignore files
Directory disassembly supports .gitignore-style filtering using .cdignore.
Example:
**/secret.json
**/generated/
Usage:
XML strategies
unique-id (default)
Each nested XML element is written to its own file using a unique identifier.
Best for:
- fine-grained diffs
- version control
- large metadata files
grouped-by-tag
Groups nested elements by tag into shared files.
Best for:
- fewer files
- quick inspection
- simpler layouts
See docs/xml.md for advanced XML configuration.
Library usage
use ;
use ;
use Format;
Node.js bindings
Node.js support is available via napi-rs bindings:
Documentation
License
Contributing
See CONTRIBUTING.md.