usage: Catalyst_Config_Auditor.py [-h] [-ho HOST | -hf HOST_FILE |
                                  --from-config FROM_CONFIG] [-u USERNAME]
                                  [-p PASSWORD] [-o OUTPUT] [-AIO] [--collect]
                                  [--backup-only] [--commands-only] [--vars]
                                  [--extract-vars] [--generate-templates]
                                  [--create] [--create-main]
                                  [--create-interfaces] [--create-full]
                                  [--interface-template INTERFACE_TEMPLATE]
                                  [--interface-vars INTERFACE_VARS] [--backup]
                                  [--excel]
                                  [--parser {auto,ttp,ntc,custom,raw}]
                                  [--parser-dir DIR] [--ntc-dir DIR]
                                  [--parser-test COMMAND] [--parser-check]
                                  [--input FILE] [--input-dir DIR]
                                  [--ttp-template FILE] [--json-output FILE]
                                  [--yaml] [--cmd-file CMD_FILE]
                                  [--selection SELECTION] [--vars-dir DIR]
                                  [--template [FILE]] [--variables [FILE]]
                                  [--extra-vars FILE] [--output-file FILE]
                                  [--model MODEL] [-w WORKERS] [--overwrite]
                                  [--debug] [--version]

Catalyst Config Auditor v1.4.0 | Excel, selective YAML and Jinja2

options:
  -h, --help            show this help message and exit
  -ho, --host HOST      Single hostname or management IP
  -hf, --host-file, --hosts-file HOST_FILE
                        File with one hostname/IP per line
  --from-config FROM_CONFIG
                        Read an existing local running-config instead of
                        connecting over SSH
  -u, --username USERNAME
                        SSH username (prompt when missing)
  -p, --password PASSWORD
                        SSH password (interactive prompt recommended)
  -o, --output OUTPUT   Root output folder (default: output)
  -AIO, --all-in-one    SSH backup + show commands + Excel + YAML + Jinja2
  --collect             SSH: running-config backup + show outputs (no Excel)
  --backup-only         SSH: save running-config only
  --commands-only       SSH: save show outputs only
  --vars                Offline YAML + Jinja2 (legacy combined mode)
  --extract-vars        Offline: generate only YAML files from running-config
  --generate-templates  Offline: generate only Jinja2 from running-config +
                        existing YAML
  --create, --create_config
                        Offline: generic Jinja2 + YAML renderer
  --create-main         Offline: render only main config, excluding interface
                        include
  --create-interfaces   Offline: render only interface config
  --create-full         Offline: render complete main + interfaces config
  --interface-template INTERFACE_TEMPLATE
                        Optional replacement for an included interface Jinja2
                        template (legacy support)
  --interface-vars INTERFACE_VARS
                        Optional extra interface YAML file (legacy support)
  --backup              Alias for --backup-only (SSH)
  --excel               Offline Excel from --input FILE, or saved
                        output/<host>/Backups/Commands_Output.txt
  --parser {auto,ttp,ntc,custom,raw}
                        Excel parser engine (auto: proven custom first, TTP >
                        NTC custom > NTC built-in > RAW)
  --parser-dir DIR      Folder holding .ttp templates (default:
                        Custom_Parsers/TTP)
  --ntc-dir DIR         External NTC TextFSM templates/index (default:
                        Custom_Parsers/NTC)
  --parser-test COMMAND
                        Offline test parser for a single CLI command; requires
                        --input
  --parser-check        Display parser availability and TTP/NTC external
                        templates
  --input FILE          Source TXT for --excel or --parser-test (Excel stays
                        in TXT folder by default)
  --input-dir DIR       With --excel, recursively create workbooks for all
                        Commands_Output.txt files under DIR
  --ttp-template FILE   Explicit .ttp template for --parser-test (overrides
                        --parser-dir)
  --json-output FILE    Save --parser-test structured result as JSON
  --yaml                Alias for --vars (offline)
  --cmd-file CMD_FILE   Command list for --collect; asks interactively when
                        omitted (default cmd.txt)
  --selection SELECTION
                        YAML field selection file
  --vars-dir DIR        Directory for generated YAML/Jinja2, or source folder
                        for --create-main/interfaces/full
  --template [FILE]     Main Jinja2 template; omit FILE to be prompted during
                        --create
  --variables [FILE]    ANY YAML variables; omit FILE to be prompted during
                        --create
  --extra-vars FILE     Additional YAML mapping; repeat to combine files (last
                        wins)
  --output-file, --dest FILE
                        Exact output filename for --excel or config rendering
  --model MODEL         Model hint for offline running-config processing
  -w, --workers WORKERS
                        Concurrent SSH sessions (default: 20)
  --overwrite           Allow overwriting existing output files
  --debug               Display detailed exceptions
  --version             show program's version number and exit

COLLECTION - SSH, read-only:
  # Collect running-config plus show commands (does not generate Excel)
  python Catalyst_Config_Auditor.py -ho SW01 --collect --cmd-file cmd.txt
  python Catalyst_Config_Auditor.py -hf hosts.txt --collect -w 20 -o output
  # Backup running-config only
  python Catalyst_Config_Auditor.py -ho SW01 --backup-only
  # Run show commands only, without running-config backup
  python Catalyst_Config_Auditor.py -ho SW01 --commands-only --cmd-file cmd.txt

EXCEL - offline, no SSH:
  # Input may be anywhere; Excel is saved NEXT TO that TXT by default
  python Catalyst_Config_Auditor.py --excel --input "C:\Backups\SW01\Commands_Output.txt"
  python Catalyst_Config_Auditor.py --excel --input "C:\Backups\SW01\Commands_Output.txt" --parser auto --overwrite
  # Batch: generate Excel beside EVERY Commands_Output.txt under a folder
  python Catalyst_Config_Auditor.py --excel --input-dir "C:\Backups\Cat9k" --parser auto
  # Custom output file and device label (optional)
  python Catalyst_Config_Auditor.py --excel --input saved.txt -ho SW01 --output-file SW01.xlsx
  # Original device-folder workflow is still supported
  python Catalyst_Config_Auditor.py -ho SW01 --excel -o output
  # Custom NTC and TTP templates
  python Catalyst_Config_Auditor.py --excel --input saved.txt --ntc-dir Custom_Parsers/NTC --parser-dir Custom_Parsers/TTP

VARIABLES AND TEMPLATES - offline, independent:
  # Generate ONLY var_main.yaml + var_interfaces.yaml from a backup
  python Catalyst_Config_Auditor.py -ho SW01 --extract-vars
  python Catalyst_Config_Auditor.py --extract-vars --from-config "C:\Backups\SW01\SW01_running_Config.txt"
  # Generate ONLY template_main.j2 + template_interfaces.j2, using existing YAML
  python Catalyst_Config_Auditor.py -ho SW01 --generate-templates
  # Legacy combined mode: variables AND templates
  python Catalyst_Config_Auditor.py -ho SW01 --vars

CONFIG GENERATION - offline only, never sends changes to switches:
  # Main configuration WITHOUT physical interface include
  python Catalyst_Config_Auditor.py -ho SW01 --create-main
  # Physical interfaces only
  python Catalyst_Config_Auditor.py -ho SW01 --create-interfaces
  # Complete configuration (main + included interfaces)
  python Catalyst_Config_Auditor.py -ho SW01 --create-full
  # Use a Variables folder at any location
  python Catalyst_Config_Auditor.py --create-interfaces --vars-dir "C:\Backups\SW01\Variables"
  # Generic Jinja2+YAML: any template/variables/output
  python Catalyst_Config_Auditor.py --create --template policy.j2 --variables site.yaml --output-file policy.cfg
  python Catalyst_Config_Auditor.py --create --template output/SW01/Variables/template_interfaces.j2 --variables output/SW01/Variables/var_interfaces.yaml

COMBINED / DIAGNOSTIC MODES:
  python Catalyst_Config_Auditor.py -ho SW01 -AIO  # collect + Excel + YAML + templates
  python Catalyst_Config_Auditor.py --parser-check
  python Catalyst_Config_Auditor.py --parser-test "show ip arp" --input arp.txt --parser ttp

NOTES:
  --collect is backup + show commands only in v1.4.0; use --excel separately.
  --vars retains old behavior (YAML + templates) for existing users.
  --input with --excel places XLSX beside the input unless --output-file is set.
  --input-dir recursively creates an XLSX beside every Commands_Output.txt.
  --from-config places extracted files beside the backup, in Variables/.
  Existing files are protected unless --overwrite is supplied.
  No configuration commands are sent to devices.
  See README.md for layout and security guidance.
