export Command

The export command converts a Mauro JSON model to a different format for external use or documentation.

Synopsis

MauroImportExport.Cli export FORMAT [INPUT-MODEL-JSON | --input-key KEY] OUT
                         [--param KEY=VALUE]... [--overwrite] [--zip] [--show-params] 
                         [--verbose] [--log-file FILE] [--log-level LEVEL]

Description

The export command transforms a Mauro JSON model into another format. The source model can be loaded from:

  • A JSON file path (INPUT-MODEL-JSON argument)
  • The in-memory model store (--input-key option)

Output can be a single file or multiple files packaged as either a directory hierarchy or a ZIP archive, depending on the exporter's capabilities.

Arguments

FORMAT
Target format identifier (e.g., dita, skos, mermaid, svg). Use list-formats to see available exporters.
INPUT-MODEL-JSON
Path to the input Mauro JSON model file. Mutually exclusive with --input-key.
OUT
Output destination. For single-file exporters, this is a file path. For multi-file exporters, this is a directory path or a ZIP file path (ending in .zip or with --zip option).

Options

--input-key KEY
Use a model from the in-memory store instead of loading from file. Mutually exclusive with INPUT-MODEL-JSON argument.
--param KEY=VALUE
Specify an exporter parameter. Repeatable. Use export FORMAT --show-params to see available parameters.
--overwrite
Overwrite existing output file, directory contents, or ZIP archive.
--zip
Force ZIP packaging for multi-file exporters. Can also be indicated by using a .zip extension in OUT path.
--show-params
Display available parameters for the exporter without performing export. OUT argument is not required when using this option.
--verbose
Show detailed export progress and diagnostic information.
--log-file FILE
Path to log file
--log-level LEVEL
Minimum logging level

Exit Status

Code Description
0 Success - model exported
1 Export failed (invalid model, format error, parameter error)
130 Operation cancelled

Export to SKOS Turtle

MauroImportExport.Cli export skos model.json vocabulary.ttl

Export Using Stored Model

MauroImportExport.Cli export dita --input-key vocab1 documentation --overwrite

Export to ZIP Archive

MauroImportExport.Cli export svg-diagrams model.json diagrams.zip --zip --overwrite

Export with Parameters

MauroImportExport.Cli export dita model.json output \
    --param dita.generateMaps=true \
    --param dita.topicsDir=topics \
    --overwrite

Show Exporter Parameters

MauroImportExport.Cli export dita --show-params

Multi-File Exports

Exporters that produce multiple files (e.g., DITA, SVG diagrams) can package output as:

Directory Hierarchy
Files are written to subdirectories within the specified OUT path. The directory is created if it doesn't exist.
ZIP Archive
All files are packaged into a single ZIP file with appropriate directory structure preserved as ZIP entries.

Overwrite Behaviour

The --overwrite option controls how existing outputs are handled:

  • Single file: Existing file is replaced
  • Directory: Existing non-empty directory is deleted and recreated
  • ZIP: Existing archive is replaced

Without --overwrite, the command fails if output already exists.

Notes

Important:

You must specify either INPUT-MODEL-JSON or --input-key, but not both.

Tip:

Use format-info to check if an exporter supports multi-file output and ZIP packaging.