Documents
configuration
configuration
Type
External
Status
Published
Created
Feb 27, 2026
Updated
Feb 27, 2026

Configuration Guide#

This document provides comprehensive documentation for opnDossier configuration, covering all available options, environment variables, CLI flags, and configuration patterns.

Table of Contents#


Configuration Precedence#

opnDossier uses a layered configuration system. When a setting is specified in multiple places, higher-precedence sources override lower ones:

PrioritySourceDescription
1 (High)Command-line flagsDirect CLI arguments (e.g., --verbose)
2Environment variablesVariables with OPNDOSSIER_ prefix
3Configuration fileYAML file (default: ~/.opnDossier.yaml)
4 (Low)Built-in defaultsHardcoded sensible defaults

Example: Precedence in Action#

# ~/.opnDossier.yaml
verbose: false
format: markdown
# Environment variable
export OPNDOSSIER_FORMAT=json

# CLI invocation - verbose flag overrides config file, format uses env var
opnDossier --verbose convert config.xml

# Result:
# - verbose: true (from CLI flag)
# - format: json (from env var, overrides file)

Configuration File#

File Location#

By default, opnDossier looks for configuration at ~/.opnDossier.yaml. You can specify a custom location:

# Use custom config file
opnDossier --config /path/to/custom-config.yaml convert config.xml

# Use config in current directory
opnDossier --config ./.opnDossier.yaml convert config.xml

File Format#

The configuration file uses YAML format. Both flat and nested structures are supported for backward compatibility.

Complete Configuration Reference#

# opnDossier Configuration File
# ================================
# Configuration precedence (highest to lowest):
# 1. Command-line flags
# 2. Environment variables (OPNDOSSIER_*)
# 3. Configuration file
# 4. Built-in defaults

# ------------------------------------------------------------------------------
# Basic Settings (Flat)
# ------------------------------------------------------------------------------

# Default input file path (typically not set - use CLI argument)
input_file: ''

# Default output file path (empty = stdout)
output_file: ''

# Enable verbose logging (debug level)
verbose: false

# Enable quiet mode (suppress all except errors)
quiet: false

# Output format: markdown, md, json, yaml, yml
format: markdown

# Default theme for terminal output: light, dark, auto, none, custom
theme: ''

# Template name for generation
template: ''

# Sections to include in output (empty = all sections)
sections: []

# Text wrap width (-1 = auto-detect, 0 = no wrap, >0 = specific width)
wrap: -1

# Report generation engine: programmatic, template
engine: programmatic

# Enable template mode explicitly
use_template: false

# Output errors in JSON format for automation
json_output: false

# Minimal output mode (suppress progress and verbose messages)
minimal: false

# Disable progress indicators
no_progress: false

# ------------------------------------------------------------------------------
# Display Settings (Nested)
# ------------------------------------------------------------------------------

display:
  # Terminal width for display (-1 = auto-detect)
  width: -1

  # Enable pager for long output
  pager: false

  # Enable syntax highlighting
  syntax_highlighting: true

# ------------------------------------------------------------------------------
# Export Settings (Nested)
# ------------------------------------------------------------------------------

export:
  # Default export format: markdown, md, json, yaml, yml
  format: markdown

  # Default export directory
  directory: ''

  # Default export template
  template: ''

  # Create backup before overwriting
  backup: false

# ------------------------------------------------------------------------------
# Logging Settings (Nested)
# ------------------------------------------------------------------------------

logging:
  # Log level: debug, info, warn, error
  level: info

  # Log format: text, json
  format: text

# ------------------------------------------------------------------------------
# Validation Settings (Nested)
# ------------------------------------------------------------------------------

validation:
  # Enable strict validation
  strict: false

  # Enable XML schema validation
  schema_validation: false

Environment Variables#

Naming Convention#

All environment variables use the OPNDOSSIER_ prefix with the following transformations:

  • Flat keys: Convert to uppercase and prefix with OPNDOSSIER_

    • verbose -> OPNDOSSIER_VERBOSE
    • input_file -> OPNDOSSIER_INPUT_FILE
  • Nested keys: Convert dots to underscores

    • display.width -> OPNDOSSIER_DISPLAY_WIDTH
    • logging.level -> OPNDOSSIER_LOGGING_LEVEL

Complete Environment Variable Reference#

Configuration KeyEnvironment VariableTypeDefault
input_fileOPNDOSSIER_INPUT_FILEstring""
output_fileOPNDOSSIER_OUTPUT_FILEstring""
verboseOPNDOSSIER_VERBOSEbooleanfalse
quietOPNDOSSIER_QUIETbooleanfalse
formatOPNDOSSIER_FORMATstring"markdown"
themeOPNDOSSIER_THEMEstring""
templateOPNDOSSIER_TEMPLATEstring""
sectionsOPNDOSSIER_SECTIONS[]string[]
wrapOPNDOSSIER_WRAPint-1
engineOPNDOSSIER_ENGINEstring"programmatic"
use_templateOPNDOSSIER_USE_TEMPLATEbooleanfalse
json_outputOPNDOSSIER_JSON_OUTPUTbooleanfalse
minimalOPNDOSSIER_MINIMALbooleanfalse
no_progressOPNDOSSIER_NO_PROGRESSbooleanfalse
display.widthOPNDOSSIER_DISPLAY_WIDTHint-1
display.pagerOPNDOSSIER_DISPLAY_PAGERbooleanfalse
display.syntax_highlightingOPNDOSSIER_DISPLAY_SYNTAX_HIGHLIGHTINGbooleantrue
export.formatOPNDOSSIER_EXPORT_FORMATstring"markdown"
export.directoryOPNDOSSIER_EXPORT_DIRECTORYstring""
export.templateOPNDOSSIER_EXPORT_TEMPLATEstring""
export.backupOPNDOSSIER_EXPORT_BACKUPbooleanfalse
logging.levelOPNDOSSIER_LOGGING_LEVELstring"info"
logging.formatOPNDOSSIER_LOGGING_FORMATstring"text"
validation.strictOPNDOSSIER_VALIDATION_STRICTbooleanfalse
validation.schema_validationOPNDOSSIER_VALIDATION_SCHEMA_VALIDATIONbooleanfalse

Boolean Values#

Boolean environment variables accept various formats:

# All these are valid "true" values:
export OPNDOSSIER_VERBOSE=true
export OPNDOSSIER_VERBOSE=TRUE
export OPNDOSSIER_VERBOSE=True
export OPNDOSSIER_VERBOSE=1

# All these are valid "false" values:
export OPNDOSSIER_VERBOSE=false
export OPNDOSSIER_VERBOSE=FALSE
export OPNDOSSIER_VERBOSE=False
export OPNDOSSIER_VERBOSE=0

List Values#

List values (like sections) use comma-separated strings:

export OPNDOSSIER_SECTIONS="system,network,firewall,dhcp"

CLI Flags#

Global Flags#

These flags are available on all commands:

FlagShortDescription
--configConfiguration file path (default: ~/.opnDossier.yaml)
--verbose-vEnable verbose/debug output
--quiet-qSuppress all output except errors

Command-Specific Flags#

convert#

opnDossier convert [flags] <config.xml>
FlagShortDescriptionDefault
--output-oOutput file path (default: stdout)""
--format-fOutput format (markdown, json, yaml)"markdown"
--engineGeneration engine (programmatic, template)"programmatic"
--sectionsSections to include (comma-separated)all
--forceOverwrite existing output filefalse

display#

opnDossier display [flags] <config.xml>
FlagShortDescriptionDefault
--wrap-wText wrap width (-1=auto, 0=none)-1
--theme-tDisplay theme (light, dark, auto, none)"auto"

validate#

opnDossier validate [flags] <config.xml>
FlagShortDescriptionDefault
--strictEnable strict validationfalse

Configuration Sections#

Basic Settings#

SettingTypeDefaultValid ValuesDescription
input_filestring""Any valid file pathDefault input file path
output_filestring""Any valid file pathDefault output file path
verbosebooleanfalsetrue, falseEnable debug-level logging
quietbooleanfalsetrue, falseSuppress non-error output
formatstring"markdown"markdown, md, json, yaml, ymlOutput format
themestring""light, dark, auto, none, customTerminal display theme
templatestring""Template nameTemplate for generation
sections[]string[]Section namesSections to include (empty = all)
wrapint-1-1, 0, or positive integerText wrap width
enginestring"programmatic"programmatic, templateGeneration engine
use_templatebooleanfalsetrue, falseExplicitly enable template mode
json_outputbooleanfalsetrue, falseOutput errors as JSON
minimalbooleanfalsetrue, falseMinimal output mode
no_progressbooleanfalsetrue, falseDisable progress indicators

Display Settings#

Nested under display: in the configuration file.

SettingTypeDefaultValid ValuesDescription
widthint-1-1, 0, or positive intTerminal width (-1=auto-detect)
pagerbooleanfalsetrue, falseEnable pager for long output
syntax_highlightingbooleantruetrue, falseEnable syntax highlighting

Export Settings#

Nested under export: in the configuration file.

SettingTypeDefaultValid ValuesDescription
formatstring"markdown"markdown, md, json, yaml, ymlExport format
directorystring""Directory pathDefault export directory
templatestring""Template nameExport template
backupbooleanfalsetrue, falseCreate backup before overwrite

Logging Settings#

Nested under logging: in the configuration file.

SettingTypeDefaultValid ValuesDescription
levelstring"info"debug, info, warn, errorLog verbosity level
formatstring"text"text, jsonLog output format

Validation Settings#

Nested under validation: in the configuration file.

SettingTypeDefaultValid ValuesDescription
strictbooleanfalsetrue, falseEnable strict validation
schema_validationbooleanfalsetrue, falseEnable XML schema validation

Common Configuration Patterns#

Development/Debugging#

# ~/.opnDossier.yaml - Development configuration
verbose: true
logging:
  level: debug
  format: text
validation:
  strict: true
display:
  syntax_highlighting: true
  width: 120

CI/CD Pipeline#

#!/bin/bash
# CI/CD script with environment variables
export OPNDOSSIER_QUIET=true
export OPNDOSSIER_JSON_OUTPUT=true
export OPNDOSSIER_VALIDATION_STRICT=true
export OPNDOSSIER_NO_PROGRESS=true

opnDossier validate config.xml
opnDossier convert config.xml -o report.md

Production/Automated Reports#

# ~/.opnDossier.yaml - Production configuration
verbose: false
quiet: false
minimal: true
no_progress: true
format: markdown
export:
  format: markdown
  backup: true
  directory: /var/reports/opnsense
logging:
  level: warn
  format: json
validation:
  strict: true

Airgapped/Offline Environment#

# ~/.opnDossier.yaml - Airgapped system
input_file: /mnt/configs/opnsense-config.xml
output_file: /mnt/reports/firewall-documentation.md
verbose: false
quiet: false
engine: programmatic # No external dependencies
export:
  backup: true

JSON Output for Automation#

# ~/.opnDossier.yaml - Machine-parseable output
format: json
json_output: true
logging:
  format: json
quiet: true
no_progress: true

Config Commands#

opnDossier provides commands to manage configuration:

config init#

Generate a template configuration file:

# Create default config at ~/.opnDossier.yaml
opnDossier config init

# Create config at specific path
opnDossier config init --output /path/to/config.yaml

# Overwrite existing config
opnDossier config init --force

config show#

Display current effective configuration:

# Show all configuration values (styled terminal output)
opnDossier config show

# Show config in JSON format (for scripting)
opnDossier config show --json

config validate#

Validate configuration file:

# Validate default config file
opnDossier config validate

# Validate specific config file
opnDossier config validate --config /path/to/config.yaml

Troubleshooting#

Configuration File Not Found#

Symptom: opnDossier uses defaults instead of your configuration.

Solution:

# Verify config file exists
ls -la ~/.opnDossier.yaml

# Check file permissions (should be readable)
chmod 644 ~/.opnDossier.yaml

# Explicitly specify config path
opnDossier --config ~/.opnDossier.yaml convert config.xml

Environment Variables Not Working#

Symptom: Environment variables are ignored.

Solutions:

  1. Check prefix is correct:

    # List all opnDossier environment variables
    env | grep OPNDOSSIER
    
  2. Verify variable names match exactly:

    # Correct
    export OPNDOSSIER_VERBOSE=true
    
    # Wrong (missing underscore)
    export OPNDOSSIERVERBOSE=true
    
  3. For nested config, use underscore separator:

    # Correct
    export OPNDOSSIER_DISPLAY_WIDTH=120
    
    # Wrong (dot separator)
    export OPNDOSSIER_DISPLAY.WIDTH=120
    

Validation Errors#

Symptom: Configuration fails validation with error messages.

Solution: Use config validate to see detailed error information:

opnDossier config validate --config /path/to/config.yaml

Common validation errors:

ErrorSolution
"invalid theme value"Use: light, dark, auto, none, or custom
"invalid format"Use: markdown, md, json, yaml, or yml
"invalid log level"Use: debug, info, warn, or error
"invalid engine"Use: programmatic or template
"wrap width must be >= -1"Use -1 (auto), 0 (no wrap), or positive number
"input file does not exist"Check file path and permissions
"output directory does not exist"Create directory with mkdir -p

CLI Flags Not Overriding Config#

Symptom: CLI flags seem to be ignored.

Solutions:

  1. Verify flag syntax is correct:

    # Correct
    opnDossier --verbose convert config.xml
    
    # Wrong (flag after command)
    opnDossier convert --verbose config.xml # May work for some flags
    
  2. Global flags must come before the command:

    # Correct
    opnDossier --config custom.yaml --verbose convert config.xml
    
  3. Check for typos in flag names:

    # Show available flags
    opnDossier convert --help
    

Debug Configuration Loading#

Enable verbose mode to see configuration details:

opnDossier --verbose config show

This displays:

  • Configuration file path being used
  • Environment variables detected
  • Final merged configuration values