How do you set the autocreate namespace option from the 'argocd app create' cli command?

I have done searching and reading of the reference here:

argocd app create Command Reference - Argo CD - Declarative GitOps CD for Kubernetes (argo-cd.readthedocs.io)

The docs keep this a bit well hidden, I have to admit. The option you want is --sync-option:

      --sync-option Prune=false                    Add or remove a sync option, e.g add Prune=false. Remove using `!` prefix, e.g.

Instead of Prune=false, pass

--sync-option CreateNamespace=true

Thank you!

One way in which we can say it is hidden is that the word CreateNamespace doesn’t appear in the ‘argocd app create’ documentation. It can be inferred from other documentation, though.