`gh repo set-default --unset` should not require a repository argument
Describe the bug
I noticed that running gh repo set-default --unset from a script (or with redirected input) fails unexpectedly, citing a missing repository argument:
$ gh repo set-default --unset </dev/null
repository required when not running interactively
Usage: gh repo set-default [<repository>] [flags]Since --unset is supposed to remove whatever repository is currently set as the default, it doesn't make sense for the command to require it as an argument. In fact, passing an argument is actually accepted, but silently ignored (e.g. if the current default is upstream, running gh repo set-default --unset origin doesn't fail, but unsets upstream as the default and completely ignores origin).
A similar pattern was already identified for gh repo set-default --view, in #7442, which PR #7441 fixed by allowing --view without a repository argument. The same exemption should also apply to --unset.
I'd be happy to submit this fix as a PR if the direction sounds right.
Affected version
gh version 2.101.0 (2026-09-15) https://github.com/cli/cli/releases/tag/v2.101.0
Source: cli/cli