If you use more than one Compose file for a swarm stack, you want to see the result before you deploy it. docker stack config prints it without touching the swarm.
docker stack config -c docker-compose.yml -c docker-compose.prod.yml
The docs describe it as outputting the final Compose file after doing the merges and interpolations of the input files. The -c (--compose-file) option can be given several times, or you can pass - to read the file from stdin.
Variables like ${TAG} are replaced from your environment in that output. Sometimes you do not want that, and --skip-interpolation gives you only the merged file with the variables left alone.
The docs have a specific warning about that second option. If you pipe the output back into docker stack deploy, always use --skip-interpolation. The reason given is that the output of the first step already has the variables filled in.
I’d use it as a review step, the swarm equivalent of docker compose config. The caveat is that interpolation uses the environment variables of your current shell, so the output can differ from one terminal to the next.
Further reading: docker stack config