Only somewhat relevant, but Google Cloud does this in their console at least for some products. E.g., go through the UI Kubernetes cluster flow, but instead of clicking the create button at the end, you can click a button to get the equivalent `gcloud` command line. Also works for VMs, VPCs, and others I'm sure.