Describe the feature or problem you’d like to solve
Pretty frequently I've got codespaces in a few repos I own and have wanted to wipe them all at once. If the repos were in an org, I could use --org, but since I own them that flag doesn't work (it ends up trying to hit /orgs/cmbrose/members/cmbrose/codespaces which 404s). So the best I can do in that case is to delete all codespaces by repo, for each repo.
It would be nice if there was a flag I could use to delete all codespaces in repos I own.
Proposed solution
[Edit] As pointed out by @kousikmitra - an option used by other commands is to have a --owner parameter for this case - in that case --owner could be a user or an org name. This has some apparent overlap with the existing --org parameter, but that flag is meant only for admins and can't be used by normal users so really they support distinct scenarios.
Another option is to support wildcards in --repo - e.g. --repo cmbrose/*. I think that this just entails switching the repo filter from exact match to supporting the wildcard.
Alternatively, we could overload the --org flag to support passing usernames in addition to orgs, but that will likely make the code convoluted because the --org flag is already only used in an org admin context and has some special behaviors.
Finally, if it's not desirable to change the usage of --repo we could add a new flag like --repo-like to make it explicit that the user wants to use a wildcard. This feels unnecessary though.
Additional context
n/a
Describe the feature or problem you’d like to solve
Pretty frequently I've got codespaces in a few repos I own and have wanted to wipe them all at once. If the repos were in an org, I could use
--org, but since I own them that flag doesn't work (it ends up trying to hit/orgs/cmbrose/members/cmbrose/codespaceswhich 404s). So the best I can do in that case is to delete all codespaces by repo, for each repo.It would be nice if there was a flag I could use to delete all codespaces in repos I own.
Proposed solution
[Edit] As pointed out by @kousikmitra - an option used by other commands is to have a
--ownerparameter for this case - in that case--ownercould be a user or an org name. This has some apparent overlap with the existing--orgparameter, but that flag is meant only for admins and can't be used by normal users so really they support distinct scenarios.Another option is to support wildcards in
--repo- e.g.--repo cmbrose/*. I think that this just entails switching the repo filter from exact match to supporting the wildcard.Alternatively, we could overload the
--orgflag to support passing usernames in addition to orgs, but that will likely make the code convoluted because the--orgflag is already only used in an org admin context and has some special behaviors.Finally, if it's not desirable to change the usage of
--repowe could add a new flag like--repo-liketo make it explicit that the user wants to use a wildcard. This feels unnecessary though.Additional context
n/a