-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Description
For gh cs commands which show a codespace selection prompt (code, ssh, ports, etc), we can accept an optional -r parameter to specify a repo. This parameter can be used to pre-filter the list of codespaces and in the case that only a single codespace matches, auto-select it.
In terms of implementation, most/all of these commands go through getOrChooseCodespace, so adding the parameter there should allow all of these commands to get the same functionality at once.
For example:
Without -r
$ gh cs code
? Choose codespace: [Use arrows to move, type to filter]
> cli/cli (trunk): didactic parakeet
cli/cli (trunk): fictional fiesta
devcontainer/features (main): humble trainMultiple matches with -r
$ gh cs code -r cli/cli
? Choose codespace: [Use arrows to move, type to filter]
> cli/cli (trunk): didactic parakeet
cli/cli (trunk): fictional fiestaMultiple matches with -r
$ gh cs code -r devcontainer/features
(vscode immediately opens "humble train")No matches with -r
$ gh cs code -r foo/bar
Error: no codespaces exist for the specified repositoryReactions are currently unavailable