You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
can't see a clear way to show all available options for gh repo create <name> -l <license> #8946
provide a list of available options for things like --gitignore or --license
example: gh repo create --license -l
mit
etc.
gh repo create --gitignore -l
Go
Node
reason: I don't know whether it's Go or go and I don't find other way than trying until it works
also mit or MIT? what if I wanted to check if new licenses are getting added?
also idk if this is the best syntax for listing these options or not. knowing that it's not available on the docs
changed the title [-]can't see a clear way to show all available options for `gh repo create <name> -l <license>[/-][+]can't see a clear way to show all available options for `gh repo create <name> -l <license>`[/+]on Apr 8, 2024
While this idea of a semi-flag for listing options is interesting, I don't think it is realistic with how most argument and flag parsing libraries work. Again, the GitHub CLI doesn't govern what is a valid value.
@andyfeller So, Can't we just provide a CLI option to make a GET request to these external APIs to list the available flag options? If not, We could provide these links in the docs under each flag to be more clear (as the docs were the first place I headed to when I couldn't enter a valid license and found nothing there). I also can't find the code for the mentioned documentation page where I can contribute and add the links you provided.
@babakks Okay so that's fetched directly in the docs website here? @andyfeller A PR that enhances the description of the -g and -l flags to include where the options can be found would be appropriate?
@devhindo I think what you see in the CLI manual website you mentioned above is actually generated from the code (@andyfeller please correct if I'm wrong). So if you update the docs in the code, then both the the CLI manual website and the gh repo create --help output will be updated, in the next release.
@devhindo : My sincere apologies for letting this slip from the notification box! 🙇
So, Can't we just provide a CLI option to make a GET request to these external APIs to list the available flag options?
That is a possibility on top of updating the help usage information, yeah.
Looking through gh reference and gh repo create --help, we don't really have anything to help users make the connection much less retrieve the content and present options. 🤔 The only thing I'm aware of is the mislav/gh-license extension that @mislav created for adding a license to an existing repository.
So what might this look like?
Perhaps this is something similar to gh repo deploy-key with new subcommandsets?
$ gh repo deploy-key --help
Manage deploy keys in a repository
USAGE
gh repo deploy-key <command> [flags]
AVAILABLE COMMANDS
add: Add a deploy key to a GitHub repository
delete: Delete a deploy key from a GitHub repository
list: List deploy keys in a GitHub repository
FLAGS
-R, --repo [HOST/]OWNER/REPO Select another repository using the [HOST/]OWNER/REPO format
INHERITED FLAGS
--help Show helpforcommand
LEARN MORE
Use `gh <command><subcommand> --help`for more information about a command.
Read the manual at https://cli.github.com/manual
This would be the ideal experience but certainly no small amount of work especially given the need for testing.
So what do we do here?
I think there are 2 actions to take here:
Short term solution: Update gh repo create documentation with information pointing users to the URLs above
Long term solution: Add new subcommandsets to gh repo as described above
For the former, I think it makes the most sense to expand the Long documentation section with the links so others can follow:
To create a repository interactively, use %[1]sgh repo create%[1]s with no arguments.
To create a remote repository non-interactively, supply the repository name and one of %[1]s--public%[1]s, %[1]s--private%[1]s, or %[1]s--internal%[1]s.
Pass %[1]s--clone%[1]s to clone the new repository locally.
To create a remote repository from an existing local repository, specify the source directory with %[1]s--source%[1]s.
By default, the remote repository name will be the name of the source directory.
Pass %[1]s--push%[1]s to push any local commits to the new repository.
`, "`"),
Example: heredoc.Doc(`
# create a repository interactively
gh repo create
# create a new remote repository and clone it locally
gh repo create my-project --public --clone
# create a remote repository from the current directory
Hey @andyfeller any updates on this? I was using gh repo create <name> --gitignore today and had to guess the spelling of the template I was after. Didn't realize until after I started digging around that the templates are at github/gitignore. It would be nice if under the -g, --gitignore <string> flag description of gh_repo_create there was a link to the available templates.
Hey @andyfeller any updates on this? I was using gh repo create <name> --gitignore today and had to guess the spelling of the template I was after. Didn't realize until after I started digging around that the templates are at github/gitignore. It would be nice if under the -g, --gitignore <string> flag description of gh_repo_create there was a link to the available templates.
Sorry for missing this, @ReynCode. This issue was open for anyone to pick up, but threw together a quick PR in #9630, getting docs updated at least.
👋 Hey @Shion1305, so sorry I didn't comment on this when I had started, that is my mistake 😔 I already have work done on this, so I wrapped it up and opened a PR in #9721.
Activity
[-]can't see a clear way to show all available options for `gh repo create <name> -l <license>[/-][+]can't see a clear way to show all available options for `gh repo create <name> -l <license>`[/+]andyfeller commentedon Apr 8, 2024
@devhindo : As these options are governed beyond
ghby GitHub API endpoint ingithub/gitignoreand choosealicense.com, I think its fair we should at least have the documentation point the user to refer to these sites for more information.While this idea of a semi-flag for listing options is interesting, I don't think it is realistic with how most argument and flag parsing libraries work. Again, the GitHub CLI doesn't govern what is a valid value.
devhindo commentedon Apr 8, 2024
@andyfeller So, Can't we just provide a CLI option to make a GET request to these external APIs to list the available flag options? If not, We could provide these links in the docs under each flag to be more clear (as the docs were the first place I headed to when I couldn't enter a valid license and found nothing there). I also can't find the code for the mentioned documentation page where I can contribute and add the links you provided.
babakks commentedon Apr 8, 2024
@devhindo You can find the documentation for
gh repo createcommand here.devhindo commentedon Apr 8, 2024
@babakks Okay so that's fetched directly in the docs website here?
@andyfeller A PR that enhances the description of the
-gand-lflags to include where the options can be found would be appropriate?babakks commentedon Apr 8, 2024
@devhindo I think what you see in the CLI manual website you mentioned above is actually generated from the code (@andyfeller please correct if I'm wrong). So if you update the docs in the code, then both the the CLI manual website and the
gh repo create --helpoutput will be updated, in the next release.andyfeller commentedon Jul 9, 2024
@devhindo : My sincere apologies for letting this slip from the notification box! 🙇
That is a possibility on top of updating the help usage information, yeah.
Looking through
gh referenceandgh repo create --help, we don't really have anything to help users make the connection much less retrieve the content and present options. 🤔 The only thing I'm aware of is themislav/gh-licenseextension that @mislav created for adding a license to an existing repository.So what might this look like?
Perhaps this is something similar to
gh repo deploy-keywith new subcommandsets?gh repo deploy-key --helpexampleThis would be the ideal experience but certainly no small amount of work especially given the need for testing.
So what do we do here?
I think there are 2 actions to take here:
gh repo createdocumentation with information pointing users to the URLs abovegh repoas described aboveFor the former, I think it makes the most sense to expand the
Longdocumentation section with the links so others can follow:cli/pkg/cmd/repo/create/create.go
Lines 80 to 104 in 0df5596
primlock commentedon Jul 23, 2024
Hey @andyfeller any updates on this? I was using
gh repo create <name> --gitignoretoday and had to guess the spelling of the template I was after. Didn't realize until after I started digging around that the templates are at github/gitignore. It would be nice if under the-g,--gitignore <string>flag description of gh_repo_create there was a link to the available templates.Enhance gh repo create docs, fix random cmd link
andyfeller commentedon Sep 16, 2024
Sorry for missing this, @ReynCode. This issue was open for anyone to pick up, but threw together a quick PR in #9630, getting docs updated at least.
Mmohmd commentedon Oct 4, 2024
Shion1305 commentedon Oct 4, 2024
I'll work on this:)
devhindo commentedon Oct 4, 2024
Good luck!
BagToad commentedon Oct 6, 2024
👋 Hey @Shion1305, so sorry I didn't comment on this when I had started, that is my mistake 😔 I already have work done on this, so I wrapped it up and opened a PR in #9721.