Programmatically create content-type? possible?

Is it possible to create a content-type programatically? Like this command but through code ? (see pic)

This topic has been created from a Discord post (1265753003764486275) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord