archmage bundle
The bundle subcommand reads multiple tree-structured data files and merges them into a single object. Each input file contributes one top-level key — the file’s base name without extension — mapped to its content. The output can be written to a JSON file or printed to stdout.
archmage bundle [flags] <file1> [<file2> ...]Input files may be specified as literal paths or glob patterns.
# Bundle all JSON files in a directory and print to stdoutarchmage bundle "configs/*.json"
# Bundle and write to a filearchmage bundle -o bundle.json "configs/*.yaml"
# Compact outputarchmage bundle --compact -o bundle.json "configs/*.json"Output Structure
Section titled “Output Structure”The output is a JSON object where each key is an input file’s base name (without extension), and the value is the file’s content.
For example, bundling weapon.json and accessory.yaml produces:
{ "accessory": { ... }, "weapon": { ... }}Keys are sorted alphabetically.
--add-meta
Section titled “--add-meta”Inject a __meta__ entry into the output object:
{ "__meta__": { "type": "map[string]" }, "weapon": { ... }}This explicitly marks the output as a filename-to-data map rather than a flat configuration object.
--banner
Section titled “--banner”Print the Archmage banner on startup.
--compact
Section titled “--compact”Output JSON without indentation.
--crlf
Section titled “--crlf”Write the output file with CRLF (\r\n) line endings instead of LF (\n).
Change the working directory before running. Relative paths are resolved from this directory.
--output / -o
Section titled “--output / -o”Path to the output JSON file. The file must have a .json extension.
If omitted, Archmage prints the result to stdout after flushing logs to stderr.
archmage bundle -o bundle.json "configs/*.json"Environment Variables
Section titled “Environment Variables”Environment variables fine-tune output behavior for things that require cross-layer penetration — file naming, indentation style, and language-specific options.
| Variable | Default | Description |
|---|---|---|
ARCHMAGE_INDENT_STYLE |
“tab” | Indentation style: tab or space. |
ARCHMAGE_INDENT_TAB_SIZE |
4 | Number of spaces per indent level when ARCHMAGE_INDENT_STYLE is space. |