CircleCI’s CLI now includes an
env subst command, which serves as a wrapper around the popular envsubst CLI tool. The command is used to substitute environment variables in a text string or file.
circleci env subst is available in both the local CLI and inside all CircleCI jobs (coming to CircleCI server v4.2+). More information and usage examples can be found in the docs as well as in this Discuss post.