Skip to content

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.

Terminal window
archmage bundle [flags] <file1> [<file2> ...]

Input files may be specified as literal paths or glob patterns.

Terminal window
# Bundle all JSON files in a directory and print to stdout
archmage bundle "configs/*.json"
# Bundle and write to a file
archmage bundle -o bundle.json "configs/*.yaml"
# Compact output
archmage bundle --compact -o bundle.json "configs/*.json"

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.

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.

Print the Archmage banner on startup.

Output JSON without indentation.

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.

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.

Terminal window
archmage bundle -o bundle.json "configs/*.json"

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.