Any command line handling of install/uninstall would require that the code be written to do that. It won't do it automatically. I'm not sure where you see a description that says it will do this automatically. On my currently updated version of VS 2019 the only worker service option for .NET 5 is an empty template.
If you look at pretty much every example they will all use sc. This makes sense in most cases because you have to have admin privileges to install a service and is generally installed using an installer program. However I suspect you might be looking at an example of using the third party library Topshelf. This third party library makes it easier to build Windows services and it does support the ability to specify an install/uninstall option from the command line. Under the hood it is going to require that you write code to determine whether to install/uninstall from command line (or whatever) but otherwise it handles the details. Refer to its documentation on how to do this.