Programmatically create gitlab-ci.yml file?

Is there any tool to generate gitlab-ci.yml file like Jenkins has job-dsl-plugin to create jobs?

gitlab-ci.yml is the equivalent of Jenkins’ DSL plugin, allowing to specify pipelines as code, rather than configuring them via some GUI.

Jenkins DSL plugin allows me to generate jobs using Groovy, which output an xml describe a job for Jenkins.
I can use DSL and a json file to generate jobs in Jenkins. What I’m looking for is tool help me generate gitlab-ci.yml base on a specification.