Syncthing Config Tool

stcfg is a tool for working with the textual Syncthing configuration, in XML or JSON format.

Usage

Reformat a configuration

To load and print a configuration with the same formatting, sorting and indentation as Syncthing, use the -print-config option:

$ stcfg -print-config config.xml

If the configuration is in JSON format (from the API or support bundle), use the -json option:

$ stcfg -json -print-config config-from-api.json

Validate a configuration

By default a configuration is simply loaded as-is, with the minimal amount of validation. The XML or JSON structure must be valid, but other checks performed by Syncthing (malformed device IDs, etc.) are not done. To perform these checks as Syncthing would, use the -validate option with a valid device ID. A device ID is required because as part of configuration loading & validation Syncthing applies some transformations based on the local device ID. For example, the local device ID is always added as sharing all folders.

$ stcfg -validate I6KAH76-66SLLLB-...-BV5RQST-3PSROAU config.xml

If the configuration passes validation the exit code will be zero and no error is printed. If a validation error is detected the exit code is one and the error is shown.

This can be combined with -print-config or other options to affect the output.

Further options

Please see stcfg -help for the full set of available options.

Downloads

The version number is the download file refers to the corresponding Syncthing version. Use the one appropriate for the version of configuration you are working on. Each download package contains the tool compiled for Windows, Linux and macOS.

If you require a config tool supporting a different Syncthing version, please contact support