Configuration check from command line

Is there a flag for syncthing to check the config file for it’s correctness without actually starting it with this config file? I’m trying to make some automations and it would be handy to know, if configuration somehow became unusable/incorrect for syncthing before deploying it.

As a side-effect, the new syncthing generate subcommand will read and write the config file when you use it to set the GUI authentication credentials. See --gui-user and --gui-password in Syncthing — Syncthing v1 documentation.

Not strictly related to Syncthing, but you could also use some standard XML command line tools to validate the syntax.

In the next release, the syncthing generate command will unconditionally write out a completely “normalized” config.xml. If there was an existing file with invalid contents, I assume there will be an error message, so in effect you can use that for validation.