NewCommand creates a new Cobra command and a Runner to list environments using the current or specified workspace,
with optional flags for resource group and output.
Run creates an ApplicationsManagementClient using the provided context and workspace, then lists the environments in the
resource group and writes the formatted output to the Output. If any of these steps fail, an error is returned.
Validate checks the workspace, scope, and output format of the command and sets them in the Runner struct,
returning an error if any of these checks fail.