Share AppName validation between CLIs

It was not in the old code, will move it.