Command-Line Interface
XBridge provides a command-line interface for quick conversions and validation without writing code.
Usage
xbridge INPUT_FILE [OPTIONS]
xbridge validate INPUT_FILE [OPTIONS]
Arguments
Positional Arguments:
input_filePath to the input XBRL-XML file (required)
Optional Arguments:
--output-path PATHOutput directory path. If not specified, the output will be saved in the same directory as the input file.
--headers-as-datapointsTreat headers as datapoints in the output. Default is False.
--strict-validationRaise errors on validation failures. This is the default behavior.
--no-strict-validationEmit warnings instead of errors for validation failures. Use this to continue processing despite orphaned facts.
--validateRun validation before and after conversion. Pre-conversion errors stop the pipeline; post-conversion errors are reported after the output file has been written. Default is False.
--ebaEnable EBA-specific validation rules (entity format, decimal precision, currency checks, etc.). Only applies when
--validateis also set. Default is False.-h, --helpShow help message and exit.
CLI Examples
Basic conversion (output to same directory as input):
xbridge instance.xbrl
Specify output directory:
xbridge instance.xbrl --output-path ./converted
Continue with warnings instead of errors:
xbridge instance.xbrl --no-strict-validation
Include headers as datapoints:
xbridge instance.xbrl --headers-as-datapoints
Combine multiple options:
xbridge instance.xbrl \
--output-path ./output \
--headers-as-datapoints \
--no-strict-validation
Validate before and after conversion:
xbridge instance.xbrl --validate
Validate with EBA-specific rules:
xbridge instance.xbrl --validate --eba
Batch processing with shell:
# Convert all XBRL files in a directory
for file in instances/*.xbrl; do
xbridge "$file" --output-path converted/
done
Validate Command
The validate subcommand checks XBRL instance files against structural and regulatory rules without performing conversion.
xbridge validate INPUT_FILE [OPTIONS]
Positional Arguments:
input_filePath to the XBRL file (
.xbrl,.xml, or.zip) (required)
Optional Arguments:
--ebaEnable EBA-specific validation rules (entity format, decimal precision, currency checks, etc.). Default is False.
--post-conversionSkip structural checks guaranteed by xbridge’s converter. Only meaningful for
.zip(CSV) files. Default is False.--jsonOutput findings as JSON instead of human-readable text. Useful for integration with other tools.
-h, --helpShow help message and exit.
Validate Examples
Basic validation:
xbridge validate instance.xbrl
Enable EBA-specific rules:
xbridge validate instance.xbrl --eba
Validate an XBRL-CSV package:
xbridge validate report.zip --eba
Validate converter output (skip structural checks):
xbridge validate output.zip --eba --post-conversion
Get JSON output for tooling integration:
xbridge validate instance.xbrl --eba --json
The validate command exits with code 0 when no errors are found, and 1 when at least one ERROR-level finding is present.