Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list the various alias permutations for the command and subcommands, via '--help' and 'gh reference' #8824

Merged
merged 5 commits into from May 17, 2024

Conversation

gabemontero
Copy link
Contributor

@gabemontero gabemontero commented Mar 16, 2024

Hey @andyfeller !!

After our recent catch up over lunch, I finally got some time to check out some of the github CLI stuff you were involved with, and noticed a couple of open issues you had filed, and decided to take a crack at coding up a fix for one of them to get better acclimated with things! The one that caught my eye ....

Fixes #8677

[Editor note: there were a couple of pivots through the course of the PR on what to do exactly. Final screen shots on output are the last few comments]

@gabemontero gabemontero requested a review from a team as a code owner March 16, 2024 15:45
@gabemontero gabemontero requested review from andyfeller and removed request for a team March 16, 2024 15:45
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Mar 16, 2024
@cliAutomation cliAutomation added this to Needs review 🤔 in The GitHub CLI Mar 16, 2024
@@ -0,0 +1,27 @@
package root
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file was soley for ease of use testing purposes really, though technically we are validating some basic errors are not occurring on command construction and help generation.

I'm fine removing it if you like

@andyfeller
Copy link
Contributor

Thanks for opening up this PR and contributing to the GitHub CLI, @gabemontero! ❤️

🤔 Is there an easier format include alias information while making it easier to read?

Building the changes locally, there are a few concerns that come to mind:

  1. Subcommands could have multiple aliases
  2. Commands could have multiple aliases
  3. Square bracket notation is somewhat inconsistent in our usage as [flags] are optional but [codespace|cs] are required choice.
  4. I'm unsure how a screenreader would handle this format
### `gh [codespace|cs] list [flags]`

List codespaces

  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -L, --limit int         Maximum number of codespaces to list (default 30)
  -o, --org login         The login handle of the organization to list codespaces for (admin-only)
  -R, --repo string       Repository name with owner: user/repo
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -u, --user username     The username to list codespaces for (used with --org)
  -w, --web               List codespaces in the web browser, cannot be used with --user or --org
$ ./bin/gh cs ls --help
List codespaces of the authenticated user.

Alternatively, organization administrators may list all codespaces billed to the organization.

For more information about output formatting flags, see `gh help formatting`.

USAGE
  gh codespace list [flags]

ALIASES
  ls

FLAGS
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -L, --limit int         Maximum number of codespaces to list (default 30)
  -o, --org login         The login handle of the organization to list codespaces for (admin-only)
  -R, --repo string       Repository name with owner: user/repo
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -u, --user username     The username to list codespaces for (used with --org)
  -w, --web               List codespaces in the web browser, cannot be used with --user or --org

INHERITED FLAGS
  --help   Show help for command

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual

Tossing around ideas

Should we avoid the complexity of having command aliases show up as h3?

I mention this in the issue but I think trying to get all aliases to show up like other command h3 is really complex and uncertain. However, we could do something akin to how help usage for the command looks by listing the various alias permutations underneath for the command and subcommand:

### `gh codespace list [flags]`

List codespaces

ALIASES
  gh codespace ls
  gh cs ls

FLAGS
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields

@williammartin
Copy link
Member

Gentle nudge @gabemontero, looks like Andy left some thoughts for you if you're still interested, otherwise please close so someone else can pick it up. Cheers!

@gabemontero
Copy link
Contributor Author

Gentle nudge @gabemontero, looks like Andy left some thoughts for you if you're still interested, otherwise please close so someone else can pick it up. Cheers!

yeah @andyfeller and I talked a bit offline @williammartin .... unfortunately I simply have had no time to deal with this so far with my regular job. How about if I can't get back to it this week, I'll close it. That sound OK?

thanks

@williammartin
Copy link
Member

Cool, I totally understand. You can also close it now and reopen it whenever you feel like you would have time to contribute if no one has picked it up. Whatever you feel better captures your intent. Thanks!

@gabemontero
Copy link
Contributor Author

ok @andyfeller @williammartin I've redone things based on @andyfeller 's #8824 (comment)

Log snippet:

ALIASES
  gh codespace ls
  gh cs ls

FLAGS
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -L, --limit int         Maximum number of codespaces to list (default 30)

I'll redo the PR title in a sec since it does not affect gh reference any more. I'll remove the "fixes" claim for #8677 for now, since I'm not addressing the original issue, but of course please advise.

@gabemontero gabemontero changed the title add command aliases to 'gh reference' help output list the various alias permutations for the command and subcommands May 2, 2024
@gabemontero gabemontero force-pushed the ggm-issue-8677-tinker branch 2 times, most recently from 98476f9 to 3b6c957 Compare May 2, 2024 22:40
@andyfeller
Copy link
Contributor

@williammartin : how do you feel about the ALIASES section being more than the alias of the command but being also containing gh?

Latest release

$ gh codespace --help
Connect to and manage codespaces

USAGE
  gh codespace [flags]

ALIASES
  cs

...
$ gh codespace list --help
List codespaces of the authenticated user.

Alternatively, organization administrators may list all codespaces billed to the organization.

For more information about output formatting flags, see `gh help formatting`.

USAGE
  gh codespace list [flags]

ALIASES
  ls

...

Changes under test

$ ./bin/gh codespace --help     
Connect to and manage codespaces

USAGE
  gh codespace [flags]

ALIASES
  gh cs

...
$ ./bin/gh codespace list --help
List codespaces of the authenticated user.

Alternatively, organization administrators may list all codespaces billed to the organization.

For more information about output formatting flags, see `gh help formatting`.

USAGE
  gh codespace list [flags]

ALIASES
  gh codespace ls
  gh cs ls

...

@williammartin
Copy link
Member

I think the only thing I'd find weird is if we had a parent and a subcommand both with more than one alias, it gets pretty gnarly. For example, adding a new alias to ext list we would end up with:

➜  cli git:(ggm-issue-8677-tinker) ✗ ./bin/gh ext list --help
List installed extension commands

USAGE
  gh extension list [flags]

ALIASES
  gh ext ls
  gh ext l
  gh extension ls
  gh extension l
  gh extensions ls
  gh extensions l

I think that's kinda bad? It's not something we have right now though.

@andyfeller
Copy link
Contributor

andyfeller commented May 6, 2024

I think the only thing I'd find weird is if we had a parent and a subcommand both with more than one alias, it gets pretty gnarly. For example, adding a new alias to ext list we would end up with:

➜  cli git:(ggm-issue-8677-tinker) ✗ ./bin/gh ext list --help
List installed extension commands

USAGE
  gh extension list [flags]

ALIASES
  gh ext ls
  gh ext l
  gh extension ls
  gh extension l
  gh extensions ls
  gh extensions l

I think that's kinda bad? It's not something we have right now though.

@williammartin: How would you recommend proceeding?

I agree IF we get into such a situation of parent and child having multiple aliases this is going to look 🤢.

Offhand, 4 options come to mind:

  1. Go with it as-is and iterate if/when a problem
  2. Comma separate the various aliases to use less vertical space like we were discussing with JSON flags
  3. Don't list the parent aliases when looking at a subcommand
  4. Don't implement the feature

@williammartin
Copy link
Member

I think I'd favour 3 but I'm not intensely against 1, it just seems like if someone is interested in the aliases they would check them on any command they care about. Are either of these options significantly more complex than the other technically?

@gabemontero
Copy link
Contributor Author

I could do 3 short term in a separate commit in case comparing the implementations factors into the final choice

WDYT @williammartin @andyfeller ?

I'll see about squeezing in a few minutes this week to do it.

@williammartin
Copy link
Member

Sounds good to me thanks. Note that if we don't include the parent we also need to drop the gh.

@gabemontero
Copy link
Contributor Author

wait ... just refreshed my memory with the code diff, and 3 is the original implementation, isn't it :-) ?

When I reverted my change:

USAGE
  gh codespace list [flags]

ALIASES
  ls

or am I missing some nuance wrt what 3 means?

@andyfeller
Copy link
Contributor

andyfeller commented May 8, 2024

wait ... just refreshed my memory with the code diff, and 3 is the original implementation, isn't it :-) ?

When I reverted my change:

USAGE
  gh codespace list [flags]

ALIASES
  ls

or am I missing some nuance wrt what 3 means?

ah, let me see if I can take a step back as there are 2 areas being discussed:

  1. How should Aliases show up when gh reference is called, which doesn't show any aliases?

    ###  gh codespace list [flags]                                                                                      
                                                                                                                          
      List codespaces                                                                                                     
                                                                                                                          
        -q, --jq expression     Filter JSON output using a jq expression                                                  
            --json fields       Output JSON with the specified fields                                                     
        -L, --limit int         Maximum number of codespaces to list (default 30)                                         
        -o, --org login         The login handle of the organization to list codespaces for (admin-only)                  
        -R, --repo string       Repository name with owner: user/repo                                                     
        -t, --template string   Format JSON output using a Go template; see "gh help formatting"                          
        -u, --user username     The username to list codespaces for (used with --org)                                     
        -w, --web               List codespaces in the web browser, cannot be used with --user or --org     
  2. How should Aliases show up when gh ... --help is called, which does show aliases?

    ›$ gh codespace list --help
    List codespaces of the authenticated user.
    
    Alternatively, organization administrators may list all codespaces billed to the organization.
    
    For more information about output formatting flags, see `gh help formatting`.
    
    USAGE
      gh codespace list [flags]
    
    ALIASES
      ls

With that said, I think there are 2 questions:

  1. gh <unaliased> <alias> or <alias> for alias format?
    I honestly like the first
  2. how does this look when added to gh reference?

@gabemontero gabemontero force-pushed the ggm-issue-8677-tinker branch 2 times, most recently from 36068e3 to 6580b36 Compare May 9, 2024 19:56
@gabemontero
Copy link
Contributor Author

thanks @andyfeller those clarifications helped alot

here's my initial take, where for you question 1 at the end, I took the liberty of creating a comma separated list, where the "unaliased" i.e. "original" item is listed first.

PTAL

@gabemontero
Copy link
Contributor Author

if we are all in agreement I'll adjust the PR title and description again, and add back the fixes 8824

@andyfeller
Copy link
Contributor

Made a few minor changes, which I'll demonstrate here that I think should finish this up:

1. Removed unaliased command name from showing up under aliases

$ ./bin/gh codespace list --help
List codespaces of the authenticated user.

Alternatively, organization administrators may list all codespaces billed to the organization.

For more information about output formatting flags, see `gh help formatting`.

USAGE
  gh codespace list [flags]

ALIASES
  gh codespace ls, gh cs ls
$ ./bin/gh reference                                

   gh reference                                          

  ...
                                                                                                                      
  ##  gh codespace                                                                                                    
                                                                                                                      
  Connect to and manage codespaces                                                                                    
                                                                                                                      
  Aliases                                                                                                             
                                                                                                                      
  gh cs                                                                                                               
  
  ...
                                                                                                                      
  ###  gh codespace list [flags]                                                                                      
                                                                                                                      
  List codespaces                                                                                                     
                                                                                                                      
    -q, --jq expression     Filter JSON output using a jq expression                                                  
        --json fields       Output JSON with the specified fields                                                     
    -L, --limit int         Maximum number of codespaces to list (default 30)                                         
    -o, --org login         The login handle of the organization to list codespaces for (admin-only)                  
    -R, --repo string       Repository name with owner: user/repo                                                     
    -t, --template string   Format JSON output using a Go template; see "gh help formatting"                          
    -u, --user username     The username to list codespaces for (used with --org)                                     
    -w, --web               List codespaces in the web browser, cannot be used with --user or --org                   
                                                                                                                      
  Aliases                                                                                                             
                                                                                                                      
  gh codespace ls, gh cs ls

2. Removed "No aliases" showing up for commands without aliases

                                                                                                                      
  ###  gh codespace logs [flags]                                                                                      
                                                                                                                      
  Access codespace logs                                                                                               
                                                                                                                      
    -c, --codespace string    Name of the codespace                                                                   
    -f, --follow              Tail and follow the logs                                                                
    -R, --repo string         Filter codespace selection by repository name (user/repo)                               
        --repo-owner string   Filter codespace selection by repository owner (username or org)                        
                        

Thoughts?

@@ -311,10 +311,6 @@ func buildAliases(cmd *cobra.Command, aliasList []string) string {
return strings.Join(aliasList, " ")
}

if cmd.Parent().HasParent() {
// prepend cmd.Name so unaliased is first
aliasList = append([]string{cmd.Name()}, aliasList...)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removes the atypical/clever prepend bit, but I get it ;-)


func buildAliases(cmd *cobra.Command, aliasList []string) string {
if len(aliasList) == 0 {
return "No Aliases"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't tell from your point number 2 - Removed "No aliases" showing up for commands without aliases if that was just for gh reference or if you did not want that displayed for gh <cmd> [<subcmd>...] --help as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, yes that was making gh reference not show Aliases if there were no aliases like --help. Otherwise it looked like the following:

  ###  gh variable set <variable-name> [flags]                                                                        
                                                                                                                      
  Create or update variables                                                                                          
                                                                                                                      
    -b, --body string          The value for the variable (reads from standard input if not specified)                
    -e, --env environment      Set deployment environment variable                                                    
    -f, --env-file file        Load variable names and values from a dotenv-formatted file                            
    -o, --org organization     Set organization variable                                                              
    -r, --repos repositories   List of repositories that can access an organization variable                          
    -v, --visibility string    Set visibility for an organization variable: {all|private|selected} (default "private")
                                                                                                                      
  Aliases                                                                                                             
                                                                                                                      
  No Aliases                                                                                                          
                                                                                                                      
  ##  gh workflow <command>                                                                                           
                                                                                                                      
  View details about GitHub Actions workflows                                                                         
                                                                                                                      
  Aliases                                                                                                             
                                                                                                                      
  No Aliases                                                                                                          
                                                                                                                      
  ###  gh workflow disable [<workflow-id> | <workflow-name>]                                                          
                                                                                                                      
  Disable a workflow                                                                                                  
                                                                                                                      
  Aliases                                                                                                             
                                                                                                                      
  No Aliases                                                                                                          
                                                                                                                      
  ###  gh workflow enable [<workflow-id> | <workflow-name>]                                                           
                                                                                                                      
  Enable a workflow                                                                                                   
                                                                                                                      
  Aliases                                                                                                             
                                                                                                                      
  No Aliases          

@andyfeller
Copy link
Contributor

@gabemontero : definitely want your thoughts and 👍 before just accepting my own changes and merging 😅

@gabemontero
Copy link
Contributor Author

So running with your commit in the debugger @andyfeller the line https://github.com/cli/cli/pull/8824/files#diff-12d8f41408bbd28c0b811bfd37e246792395d8313d6da8c6b2dbf281b98b923dR308 never gets hit even with running help on say gh workflow

I'm going to rebase onto latest trunk and remove that if check and return of No Aliases as it is misleading.

See if my change still looks OK to you.

Also, I think we are back into fixing #8677 territory no? If so, I'll add the fixes designation in the PR description.

@gabemontero
Copy link
Contributor Author

ok third commit pushed @andyfeller

@gabemontero gabemontero changed the title list the various alias permutations for the command and subcommands list the various alias permutations for the command and subcommands, via '--help' and 'gh reference' May 10, 2024
@gabemontero
Copy link
Contributor Author

also adjusted PR title and description

unless we have more iterating to do once @williammartin sees this, do you all typically squash commits when it is all said and done @andyfeller ?

@andyfeller
Copy link
Contributor

Looks good!

andyfeller@Andys-MBP:cli/cli ‹ggm-issue-8677-tinker›$ ./bin/gh cs --help      
Connect to and manage codespaces

USAGE
  gh codespace [flags]

ALIASES
  gh cs

...
andyfeller@Andys-MBP:cli/cli ‹ggm-issue-8677-tinker›$ ./bin/gh cs list --help
List codespaces of the authenticated user.

Alternatively, organization administrators may list all codespaces billed to the organization.

For more information about output formatting flags, see `gh help formatting`.

USAGE
  gh codespace list [flags]

ALIASES
  gh codespace ls, gh cs ls

...
andyfeller@Andys-MBP:cli/cli ‹ggm-issue-8677-tinker›$ ./bin/gh reference   

   gh reference         

...

  ###  gh codespace list [flags]                                                                                      
                                                                                                                      
  List codespaces                                                                                                     
                                                                                                                      
    -q, --jq expression     Filter JSON output using a jq expression                                                  
        --json fields       Output JSON with the specified fields                                                     
    -L, --limit int         Maximum number of codespaces to list (default 30)                                         
    -o, --org login         The login handle of the organization to list codespaces for (admin-only)                  
    -R, --repo string       Repository name with owner: user/repo                                                     
    -t, --template string   Format JSON output using a Go template; see "gh help formatting"                          
    -u, --user username     The username to list codespaces for (used with --org)                                     
    -w, --web               List codespaces in the web browser, cannot be used with --user or --org                   
                                                                                                                      
  Aliases                                                                                                             
                                                                                                                      
  gh codespace ls, gh cs ls     

@andyfeller
Copy link
Contributor

also adjusted PR title and description

unless we have more iterating to do once @williammartin sees this, do you all typically squash commits when it is all said and done @andyfeller ?

🤔 we allow squashing merging but it isn't a hard and fast "thou must".

@gabemontero
Copy link
Contributor Author

also adjusted PR title and description
unless we have more iterating to do once @williammartin sees this, do you all typically squash commits when it is all said and done @andyfeller ?

🤔 we allow squashing merging but it isn't a hard and fast "thou must".

roger that .... let's sit tight and see what @williammartin says then wrt the format here

thanks @andyfeller

@@ -302,3 +302,28 @@ func dedent(s string) string {
}
return strings.TrimSuffix(buf.String(), "\n")
}

func buildAliases(cmd *cobra.Command, aliasList []string) string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll make our lives easier if we remove the string formatting from here and only build up the list of aliases, then format it with strings.Join like so:

func buildAliasList(cmd *cobra.Command, aliases []string) []string {
	if !cmd.HasParent() {
		return aliases
	}

	parentAliases := append(cmd.Parent().Aliases, cmd.Parent().Name())
	sort.Strings(parentAliases)

	var aliasesWithParentAliases []string
	// e.g aliases = [ls]
	for _, alias := range aliases {
		// e.g parentAliases = [codespaces, cs]
		for _, parentAlias := range parentAliases {
			// e.g. aliasesWithParentAliases = [codespaces list, codespaces ls, cs list, cs ls]
			aliasesWithParentAliases = append(aliasesWithParentAliases, fmt.Sprintf("%s %s", parentAlias, alias))
		}
	}

	return buildAliasList(cmd.Parent(), aliasesWithParentAliases)
}

And at the call site:

strings.Join(buildAliasList(cmd, cmd.Aliases), ", "))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is kind of late here and I might have missed some implementation detail!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you missed anything @williammartin ... your simplifications look good to me wrt

  • gh reference
  • --help when there are no aliases, single aliases, multilple aliases

@williammartin
Copy link
Member

Spoke with Andy in Slack. I don't mind too much about stylistic things because they are easy to iterate on. In this case I would recommend that in gh reference we collapse the Aliases section to a single line, since there is no stylistic formatting applied to the markdown.

Before

image

After

image

@williammartin
Copy link
Member

Secondly, we should make sure this change is also reflected in the generated manpages and website, which it currently isn't. A recent example of this was done here https://github.com/cli/cli/pull/8934/files#diff-33caf7ff0fd1f656c40c32b2a64616cce45fa04e225e201a39cafb689db6a779

@gabemontero
Copy link
Contributor Author

it might be a day or two but I should be able to process @williammartin 's latest items by the end of the week

@gabemontero
Copy link
Contributor Author

updates pushed @williammartin @andyfeller for both the code simplifications and generated man/web content

gabemontero and others added 5 commits May 17, 2024 09:30
this occurs from either utlizing the help function for a specific command/subcommand
combination or when 'gh reference' lists the command tree
This commit adds conditional logic in `gh reference` to only show aliases if
there are aliases to see.  Additionally, this removes the unaliased command
name from being shown under aliases.
@andyfeller
Copy link
Contributor

andyfeller commented May 17, 2024

Manual testing notes

manpages looks good

andyfeller@Andys-MBP:cli/cli ‹ggm-issue-8677-tinker›$ make manpages
go run ./cmd/gen-docs --man-page --doc-path ./share/man/man1/

andyfeller@Andys-MBP:cli/cli ‹ggm-issue-8677-tinker›$ cd share/man/man1 
andyfeller@Andys-MBP:man/man1 ‹ggm-issue-8677-tinker›$ grep -rn -A 5 ALIASES .
./gh-config-list.1:20:.SH ALIASES
./gh-config-list.1-21-.PP
./gh-config-list.1-22-gh config ls
./gh-config-list.1-23-
./gh-config-list.1-24-
./gh-config-list.1-25-.SH SEE ALSO
--
./gh-issue-create.1:71:.SH ALIASES
./gh-issue-create.1-72-.PP
./gh-issue-create.1-73-gh issue new
./gh-issue-create.1-74-
./gh-issue-create.1-75-
./gh-issue-create.1-76-.SH EXAMPLE
--
./gh-workflow-list.1:47:.SH ALIASES
./gh-workflow-list.1-48-.PP
./gh-workflow-list.1-49-gh workflow ls
./gh-workflow-list.1-50-
./gh-workflow-list.1-51-
./gh-workflow-list.1-52-.SH JSON FIELDS
--
./gh-cache-list.1:54:.SH ALIASES
./gh-cache-list.1-55-.PP
./gh-cache-list.1-56-gh cache ls
./gh-cache-list.1-57-
./gh-cache-list.1-58-
./gh-cache-list.1-59-.SH JSON FIELDS
--
./gh-secret-list.1:59:.SH ALIASES
./gh-secret-list.1-60-.PP
./gh-secret-list.1-61-gh secret ls
./gh-secret-list.1-62-
./gh-secret-list.1-63-
./gh-secret-list.1-64-.SH JSON FIELDS
--
./gh-release-create.1:97:.SH ALIASES
./gh-release-create.1-98-.PP
./gh-release-create.1-99-gh release new
./gh-release-create.1-100-
./gh-release-create.1-101-
./gh-release-create.1-102-.SH EXAMPLE
--
./gh-ruleset.1:40:.SH ALIASES
./gh-ruleset.1-41-.PP
./gh-ruleset.1-42-gh rs
./gh-ruleset.1-43-
./gh-ruleset.1-44-
./gh-ruleset.1-45-.SH EXAMPLE
--
./gh-codespace-list.1:56:.SH ALIASES
./gh-codespace-list.1-57-.PP
./gh-codespace-list.1-58-gh codespace ls, gh cs ls
./gh-codespace-list.1-59-
./gh-codespace-list.1-60-
./gh-codespace-list.1-61-.SH JSON FIELDS
--
./gh-alias-list.1:19:.SH ALIASES
./gh-alias-list.1-20-.PP
./gh-alias-list.1-21-gh alias ls
./gh-alias-list.1-22-
./gh-alias-list.1-23-
./gh-alias-list.1-24-.SH SEE ALSO
--
./gh-gist-create.1:44:.SH ALIASES
./gh-gist-create.1-45-.PP
./gh-gist-create.1-46-gh gist new
./gh-gist-create.1-47-
./gh-gist-create.1-48-
./gh-gist-create.1-49-.SH EXAMPLE
--
./gh-label-list.1:63:.SH ALIASES
./gh-label-list.1-64-.PP
./gh-label-list.1-65-gh label ls
./gh-label-list.1-66-
./gh-label-list.1-67-
./gh-label-list.1-68-.SH JSON FIELDS
--
./gh-gist-list.1:28:.SH ALIASES
./gh-gist-list.1-29-.PP
./gh-gist-list.1-30-gh gist ls
./gh-gist-list.1-31-
./gh-gist-list.1-32-
./gh-gist-list.1-33-.SH SEE ALSO
--
./gh-run-list.1:66:.SH ALIASES
./gh-run-list.1-67-.PP
./gh-run-list.1-68-gh run ls
./gh-run-list.1-69-
./gh-run-list.1-70-
./gh-run-list.1-71-.SH JSON FIELDS
--
./gh-release-list.1:50:.SH ALIASES
./gh-release-list.1-51-.PP
./gh-release-list.1-52-gh release ls
./gh-release-list.1-53-
./gh-release-list.1-54-
./gh-release-list.1-55-.SH JSON FIELDS
--
./gh-variable-delete.1:38:.SH ALIASES
./gh-variable-delete.1-39-.PP
./gh-variable-delete.1-40-gh variable remove
./gh-variable-delete.1-41-
./gh-variable-delete.1-42-
./gh-variable-delete.1-43-.SH SEE ALSO
--
./gh-org-list.1:20:.SH ALIASES
./gh-org-list.1-21-.PP
./gh-org-list.1-22-gh org ls
./gh-org-list.1-23-
./gh-org-list.1-24-
./gh-org-list.1-25-.SH EXAMPLE
--
./gh-project-list.1:44:.SH ALIASES
./gh-project-list.1-45-.PP
./gh-project-list.1-46-gh project ls
./gh-project-list.1-47-
./gh-project-list.1-48-
./gh-project-list.1-49-.SH EXAMPLE
--
./gh-variable-list.1:50:.SH ALIASES
./gh-variable-list.1-51-.PP
./gh-variable-list.1-52-gh variable ls
./gh-variable-list.1-53-
./gh-variable-list.1-54-
./gh-variable-list.1-55-.SH JSON FIELDS
--
./gh-repo-create.1:101:.SH ALIASES
./gh-repo-create.1-102-.PP
./gh-repo-create.1-103-gh repo new
./gh-repo-create.1-104-
./gh-repo-create.1-105-
./gh-repo-create.1-106-.SH EXAMPLE
--
./gh-secret-delete.1:47:.SH ALIASES
./gh-secret-delete.1-48-.PP
./gh-secret-delete.1-49-gh secret remove
./gh-secret-delete.1-50-
./gh-secret-delete.1-51-
./gh-secret-delete.1-52-.SH SEE ALSO
--
./gh-ssh-key-list.1:14:.SH ALIASES
./gh-ssh-key-list.1-15-.PP
./gh-ssh-key-list.1-16-gh ssh-key ls
./gh-ssh-key-list.1-17-
./gh-ssh-key-list.1-18-
./gh-ssh-key-list.1-19-.SH SEE ALSO
--
./gh-ruleset-list.1:55:.SH ALIASES
./gh-ruleset-list.1-56-.PP
./gh-ruleset-list.1-57-gh rs ls, gh ruleset ls
./gh-ruleset-list.1-58-
./gh-ruleset-list.1-59-
./gh-ruleset-list.1-60-.SH EXAMPLE
--
./gh-pr-create.1:128:.SH ALIASES
./gh-pr-create.1-129-.PP
./gh-pr-create.1-130-gh pr new
./gh-pr-create.1-131-
./gh-pr-create.1-132-
./gh-pr-create.1-133-.SH EXAMPLE
--
./gh-gpg-key-list.1:14:.SH ALIASES
./gh-gpg-key-list.1-15-.PP
./gh-gpg-key-list.1-16-gh gpg-key ls
./gh-gpg-key-list.1-17-
./gh-gpg-key-list.1-18-
./gh-gpg-key-list.1-19-.SH SEE ALSO
--
./gh-extension.1:66:.SH ALIASES
./gh-extension.1-67-.PP
./gh-extension.1-68-gh extensions, gh ext
./gh-extension.1-69-
./gh-extension.1-70-
./gh-extension.1-71-.SH SEE ALSO
--
./gh-repo-deploy-key-list.1:34:.SH ALIASES
./gh-repo-deploy-key-list.1-35-.PP
./gh-repo-deploy-key-list.1-36-gh repo deploy-key ls
./gh-repo-deploy-key-list.1-37-
./gh-repo-deploy-key-list.1-38-
./gh-repo-deploy-key-list.1-39-.SH JSON FIELDS
--
./gh-codespace.1:68:.SH ALIASES
./gh-codespace.1-69-.PP
./gh-codespace.1-70-gh cs
./gh-codespace.1-71-
./gh-codespace.1-72-
./gh-codespace.1-73-.SH SEE ALSO
--
./gh-pr-list.1:88:.SH ALIASES
./gh-pr-list.1-89-.PP
./gh-pr-list.1-90-gh pr ls
./gh-pr-list.1-91-
./gh-pr-list.1-92-
./gh-pr-list.1-93-.SH JSON FIELDS
--
./gh-issue-list.1:84:.SH ALIASES
./gh-issue-list.1-85-.PP
./gh-issue-list.1-86-gh issue ls
./gh-issue-list.1-87-
./gh-issue-list.1-88-
./gh-issue-list.1-89-.SH JSON FIELDS
--
./gh-extension-list.1:14:.SH ALIASES
./gh-extension-list.1-15-.PP
./gh-extension-list.1-16-gh ext ls, gh extension ls, gh extensions ls
./gh-extension-list.1-17-
./gh-extension-list.1-18-
./gh-extension-list.1-19-.SH SEE ALSO
--
./gh-repo-list.1:70:.SH ALIASES
./gh-repo-list.1-71-.PP
./gh-repo-list.1-72-gh repo ls
./gh-repo-list.1-73-
./gh-repo-list.1-74-
./gh-repo-list.1-75-.SH JSON FIELDS
--
./gh-attestation.1:30:.SH ALIASES
./gh-attestation.1-31-.PP
./gh-attestation.1-32-gh at
./gh-attestation.1-33-
./gh-attestation.1-34-
./gh-attestation.1-35-.SH SEE ALSO

site looks good

andyfeller@Andys-MBP:cli/cli ‹ggm-issue-8677-tinker›$ go run ./cmd/gen-docs --website --doc-path site/manual

Screenshot 2024-05-17 at 10 08 15 AM

--help looks good

andyfeller@Andys-MBP:cli/cli ‹ggm-issue-8677-tinker›$ ./bin/gh codespace list --help
List codespaces of the authenticated user.

Alternatively, organization administrators may list all codespaces billed to the organization.

For more information about output formatting flags, see `gh help formatting`.

USAGE
  gh codespace list [flags]

ALIASES
  gh codespace ls, gh cs ls

FLAGS
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -L, --limit int         Maximum number of codespaces to list (default 30)
  -o, --org login         The login handle of the organization to list codespaces for (admin-only)
  -R, --repo string       Repository name with owner: user/repo
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -u, --user username     The username to list codespaces for (used with --org)
  -w, --web               List codespaces in the web browser, cannot be used with --user or --org

INHERITED FLAGS
  --help   Show help for command

JSON FIELDS
  createdAt, displayName, gitStatus, lastUsedAt, machineName, name, owner,
  repository, state, vscsTarget

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual

andyfeller@Andys-MBP:cli/cli ‹ggm-issue-8677-tinker›$ ./bin/gh codespace --help     
Connect to and manage codespaces

USAGE
  gh codespace [flags]

ALIASES
  gh cs

AVAILABLE COMMANDS
  code:        Open a codespace in Visual Studio Code
  cp:          Copy files between local and remote file systems
  create:      Create a codespace
  delete:      Delete codespaces
  edit:        Edit a codespace
  jupyter:     Open a codespace in JupyterLab
  list:        List codespaces
  logs:        Access codespace logs
  ports:       List ports in a codespace
  rebuild:     Rebuild a codespace
  ssh:         SSH into a codespace
  stop:        Stop a running codespace
  view:        View details about a codespace

INHERITED FLAGS
  --help   Show help for command

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual

Also confirm unaliases commands look good:

andyfeller@Andys-MBP:cli/cli ‹ggm-issue-8677-tinker›$ ./bin/gh api --help      
Makes an authenticated HTTP request to the GitHub API and prints the response.

...

For more information about output formatting flags, see `gh help formatting`.

USAGE
  gh api <endpoint> [flags]

FLAGS
      --cache duration        Cache the response, e.g. "3600s", "60m", "1h"
  -F, --field key=value       Add a typed parameter in key=value format
  -H, --header key:value      Add a HTTP request header in key:value format
      --hostname string       The GitHub hostname for the request (default "github.com")
  -i, --include               Include HTTP response status line and headers in the output
      --input file            The file to use as body for the HTTP request (use "-" to read from standard input)
  -q, --jq string             Query to select values from the response using jq syntax
  -X, --method string         The HTTP method for the request (default "GET")
      --paginate              Make additional HTTP requests to fetch all pages of results
  -p, --preview names         GitHub API preview names to request (without the "-preview" suffix)
  -f, --raw-field key=value   Add a string parameter in key=value format
      --silent                Do not print the response body
      --slurp                 Use with "--paginate" to return an array of all pages of either JSON arrays or objects
  -t, --template string       Format JSON output using a Go template; see "gh help formatting"
      --verbose               Include full HTTP request and response in the output

gh reference looks good

# gh reference

## `gh alias <command>`

Create command shortcuts

### `gh alias delete {<alias> | --all} [flags]`

Delete set aliases

  --all   Delete all aliases

### `gh alias import [<filename> | -] [flags]`

Import aliases from a YAML file

  --clobber   Overwrite existing aliases of the same name

### `gh alias list`

List your aliases

Aliases

gh alias ls

### `gh alias set <alias> <expansion> [flags]`

Create a shortcut for a gh command

      --clobber   Overwrite existing aliases of the same name
  -s, --shell     Declare an alias to be passed through a shell interpreter

## `gh api <endpoint> [flags]`

Make an authenticated GitHub API request

      --cache duration        Cache the response, e.g. "3600s", "60m", "1h"
  -F, --field key=value       Add a typed parameter in key=value format
  -H, --header key:value      Add a HTTP request header in key:value format
      --hostname string       The GitHub hostname for the request (default "github.com")
  -i, --include               Include HTTP response status line and headers in the output
      --input file            The file to use as body for the HTTP request (use "-" to read from standard input)
  -q, --jq string             Query to select values from the response using jq syntax
  -X, --method string         The HTTP method for the request (default "GET")
      --paginate              Make additional HTTP requests to fetch all pages of results
  -p, --preview names         GitHub API preview names to request (without the "-preview" suffix)
  -f, --raw-field key=value   Add a string parameter in key=value format
      --silent                Do not print the response body
      --slurp                 Use with "--paginate" to return an array of all pages of either JSON arrays or objects
  -t, --template string       Format JSON output using a Go template; see "gh help formatting"
      --verbose               Include full HTTP request and response in the output

## `gh attestation [subcommand]`

Work with artifact attestations

Aliases

gh at

### `gh attestation download [<file-path> | oci://<image-uri>] [--owner | --repo] [flags]`

Download an artifact's attestations for offline use

  -d, --digest-alg string       The algorithm used to compute a digest of the artifact: {sha256|sha512} (default "sha256")
  -L, --limit int               Maximum number of attestations to fetch (default 30)
  -o, --owner string            a GitHub organization to scope attestation lookup by
      --predicate-type string   Filter attestations by provided predicate type
  -R, --repo string             Repository name in the format <owner>/<repo>

### `gh attestation verify [<file-path> | oci://<image-uri>] [--owner | --repo] [flags]`

Verify an artifact's integrity using attestations

  -b, --bundle string                Path to bundle on disk, either a single bundle in a JSON file or a JSON lines file with multiple bundles
      --cert-identity string         Enforce that the certificate's subject alternative name matches the provided value exactly
  -i, --cert-identity-regex string   Enforce that the certificate's subject alternative name matches the provided regex
      --cert-oidc-issuer string      Issuer of the OIDC token (default "https://token.actions.githubusercontent.com")
      --custom-trusted-root string   Path to a custom trustedroot.json file to use for verification
      --deny-self-hosted-runners     Fail verification for attestations generated on self-hosted runners
  -d, --digest-alg string            The algorithm used to compute a digest of the artifact: {sha256|sha512} (default "sha256")
      --format string                Output format: {json}
  -q, --jq expression                Filter JSON output using a jq expression
  -L, --limit int                    Maximum number of attestations to fetch (default 30)
      --no-public-good               Only verify attestations signed with GitHub's Sigstore instance
  -o, --owner string                 GitHub organization to scope attestation lookup by
      --predicate-type string        Filter attestations by provided predicate type
  -R, --repo string                  Repository name in the format <owner>/<repo>
  -t, --template string              Format JSON output using a Go template; see "gh help formatting"

## `gh auth <command>`

Authenticate gh and git with GitHub

### `gh auth login [flags]`

Log in to a GitHub account

  -p, --git-protocol string   The protocol to use for git operations on this host: {ssh|https}
  -h, --hostname string       The hostname of the GitHub instance to authenticate with
      --insecure-storage      Save authentication credentials in plain text instead of credential store
  -s, --scopes strings        Additional authentication scopes to request
      --skip-ssh-key          Skip generate/upload SSH key prompt
  -w, --web                   Open a browser to authenticate
      --with-token            Read token from standard input

### `gh auth logout [flags]`

Log out of a GitHub account

  -h, --hostname string   The hostname of the GitHub instance to log out of
  -u, --user string       The account to log out of

### `gh auth refresh [flags]`

Refresh stored authentication credentials

  -h, --hostname string         The GitHub host to use for authentication
      --insecure-storage        Save authentication credentials in plain text instead of credential store
  -r, --remove-scopes strings   Authentication scopes to remove from gh
      --reset-scopes            Reset authentication scopes to the default minimum set of scopes
  -s, --scopes strings          Additional authentication scopes for gh to have

### `gh auth setup-git [flags]`

Setup git with GitHub CLI

  -f, --force --hostname   Force setup even if the host is not known. Must be used in conjunction with --hostname
  -h, --hostname string    The hostname to configure git for

### `gh auth status [flags]`

Display active account and authentication state on each known GitHub host

  -h, --hostname string   Check a specific hostname's auth status
  -t, --show-token        Display the auth token

### `gh auth switch [flags]`

Switch active GitHub account

  -h, --hostname string   The hostname of the GitHub instance to switch account for
  -u, --user string       The account to switch to

### `gh auth token [flags]`

Print the authentication token gh uses for a hostname and account

  -h, --hostname string   The hostname of the GitHub instance authenticated with
  -u, --user string       The account to output the token for

## `gh browse [<number> | <path> | <commit-SHA>] [flags]`

Open the repository in the browser

  -b, --branch string            Select another branch by passing in the branch name
  -c, --commit string[="last"]   Select another commit by passing in the commit SHA, default is the last commit
  -n, --no-browser               Print destination URL instead of opening the browser
  -p, --projects                 Open repository projects
  -r, --releases                 Open repository releases
  -s, --settings                 Open repository settings
  -w, --wiki                     Open repository wiki

## `gh cache <command>`

Manage GitHub Actions caches

### `gh cache delete [<cache-id>| <cache-key> | --all] [flags]`

Delete GitHub Actions caches

  -a, --all   Delete all caches

### `gh cache list [flags]`

List GitHub Actions caches

  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -k, --key string        Filter by cache key prefix
  -L, --limit int         Maximum number of caches to fetch (default 30)
  -O, --order string      Order of caches returned: {asc|desc} (default "desc")
  -r, --ref string        Filter by ref, formatted as refs/heads/<branch name> or refs/pull/<number>/merge
  -S, --sort string       Sort fetched caches: {created_at|last_accessed_at|size_in_bytes} (default "last_accessed_at")
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

Aliases

gh cache ls

## `gh catsup`

Extension catsup

## `gh codespace`

Connect to and manage codespaces

Aliases

gh cs

### `gh codespace code [flags]`

Open a codespace in Visual Studio Code

  -c, --codespace string    Name of the codespace
      --insiders            Use the insiders version of Visual Studio Code
  -R, --repo string         Filter codespace selection by repository name (user/repo)
      --repo-owner string   Filter codespace selection by repository owner (username or org)
  -w, --web                 Use the web version of Visual Studio Code

### `gh codespace cp [-e] [-r] [-- [<scp flags>...]] <sources>... <dest>`

Copy files between local and remote file systems

  -c, --codespace string    Name of the codespace
  -e, --expand              Expand remote file names on remote shell
  -p, --profile string      Name of the SSH profile to use
  -r, --recursive           Recursively copy directories
  -R, --repo string         Filter codespace selection by repository name (user/repo)
      --repo-owner string   Filter codespace selection by repository owner (username or org)

### `gh codespace create [flags]`

Create a codespace

  -b, --branch string               repository branch
      --default-permissions         do not prompt to accept additional permissions requested by the codespace
      --devcontainer-path string    path to the devcontainer.json file to use when creating codespace
  -d, --display-name string         display name for the codespace (48 characters or less)
      --idle-timeout duration       allowed inactivity before codespace is stopped, e.g. "10m", "1h"
  -l, --location string             location: {EastUs|SouthEastAsia|WestEurope|WestUs2} (determined automatically if not provided)
  -m, --machine string              hardware specifications for the VM
  -R, --repo string                 repository name with owner: user/repo
      --retention-period duration   allowed time after shutting down before the codespace is automatically deleted (maximum 30 days), e.g. "1h", "72h"
  -s, --status                      show status of post-create command and dotfiles
  -w, --web                         create codespace from browser, cannot be used with --display-name, --idle-timeout, or --retention-period

### `gh codespace delete [flags]`

Delete codespaces

      --all                 Delete all codespaces
  -c, --codespace string    Name of the codespace
      --days N              Delete codespaces older than N days
  -f, --force               Skip confirmation for codespaces that contain unsaved changes
  -o, --org login           The login handle of the organization (admin-only)
  -R, --repo string         Filter codespace selection by repository name (user/repo)
      --repo-owner string   Filter codespace selection by repository owner (username or org)
  -u, --user username       The username to delete codespaces for (used with --org)

### `gh codespace edit [flags]`

Edit a codespace

  -c, --codespace string      Name of the codespace
  -d, --display-name string   Set the display name
  -m, --machine string        Set hardware specifications for the VM
  -R, --repo string           Filter codespace selection by repository name (user/repo)
      --repo-owner string     Filter codespace selection by repository owner (username or org)

### `gh codespace jupyter [flags]`

Open a codespace in JupyterLab

  -c, --codespace string    Name of the codespace
  -R, --repo string         Filter codespace selection by repository name (user/repo)
      --repo-owner string   Filter codespace selection by repository owner (username or org)

### `gh codespace list [flags]`

List codespaces

  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -L, --limit int         Maximum number of codespaces to list (default 30)
  -o, --org login         The login handle of the organization to list codespaces for (admin-only)
  -R, --repo string       Repository name with owner: user/repo
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -u, --user username     The username to list codespaces for (used with --org)
  -w, --web               List codespaces in the web browser, cannot be used with --user or --org

Aliases

gh codespace ls, gh cs ls

### `gh codespace logs [flags]`

Access codespace logs

  -c, --codespace string    Name of the codespace
  -f, --follow              Tail and follow the logs
  -R, --repo string         Filter codespace selection by repository name (user/repo)
      --repo-owner string   Filter codespace selection by repository owner (username or org)

### `gh codespace ports [flags]`

List ports in a codespace

  -c, --codespace string    Name of the codespace
  -q, --jq expression       Filter JSON output using a jq expression
      --json fields         Output JSON with the specified fields
  -R, --repo string         Filter codespace selection by repository name (user/repo)
      --repo-owner string   Filter codespace selection by repository owner (username or org)
  -t, --template string     Format JSON output using a Go template; see "gh help formatting"

#### `gh codespace ports forward <remote-port>:<local-port>...`

Forward ports

#### `gh codespace ports visibility <port>:{public|private|org}...`

Change the visibility of the forwarded port

### `gh codespace rebuild [flags]`

Rebuild a codespace

  -c, --codespace string    Name of the codespace
      --full                perform a full rebuild
  -R, --repo string         Filter codespace selection by repository name (user/repo)
      --repo-owner string   Filter codespace selection by repository owner (username or org)

### `gh codespace ssh [<flags>...] [-- <ssh-flags>...] [<command>]`

SSH into a codespace

  -c, --codespace string    Name of the codespace
      --config              Write OpenSSH configuration to stdout
  -d, --debug               Log debug data to a file
      --debug-file string   Path of the file log to
      --profile string      Name of the SSH profile to use
  -R, --repo string         Filter codespace selection by repository name (user/repo)
      --repo-owner string   Filter codespace selection by repository owner (username or org)
      --server-port int     SSH server port number (0 => pick unused)

### `gh codespace stop [flags]`

Stop a running codespace

  -c, --codespace string    Name of the codespace
  -o, --org login           The login handle of the organization (admin-only)
  -R, --repo string         Filter codespace selection by repository name (user/repo)
      --repo-owner string   Filter codespace selection by repository owner (username or org)
  -u, --user username       The username to stop codespace for (used with --org)

### `gh codespace view [flags]`

View details about a codespace

  -c, --codespace string    Name of the codespace
  -q, --jq expression       Filter JSON output using a jq expression
      --json fields         Output JSON with the specified fields
  -R, --repo string         Filter codespace selection by repository name (user/repo)
      --repo-owner string   Filter codespace selection by repository owner (username or org)
  -t, --template string     Format JSON output using a Go template; see "gh help formatting"

## `gh completion -s <shell>`

Generate shell completion scripts

  -s, --shell string   Shell type: {bash|zsh|fish|powershell}

## `gh config <command>`

Manage configuration for gh

### `gh config clear-cache`

Clear the cli cache

### `gh config get <key> [flags]`

Print the value of a given configuration key

  -h, --host string   Get per-host setting

### `gh config list [flags]`

Print a list of configuration keys and values

  -h, --host string   Get per-host configuration

Aliases

gh config ls

### `gh config set <key> <value> [flags]`

Update configuration with a value for the given key

  -h, --host string   Set per-host setting

## `gh copilot`

Extension copilot

## `gh copilot-internal`

Extension copilot-internal

## `gh extension`

Manage gh extensions

Aliases

gh extensions, gh ext

### `gh extension browse [flags]`

Enter a UI for browsing, adding, and removing extensions

      --debug           log to /tmp/extBrowse-*
  -s, --single-column   Render TUI with only one column of text

### `gh extension create [<name>] [flags]`

Create a new extension

  --precompiled string   Create a precompiled extension. Possible values: go, other

### `gh extension exec <name> [args]`

Execute an installed extension

### `gh extension install <repository> [flags]`

Install a gh extension from a repository

  --force        force upgrade extension, or ignore if latest already installed
  --pin string   pin extension to a release tag or commit ref

### `gh extension list`

List installed extension commands

Aliases

gh ext ls, gh extension ls, gh extensions ls

### `gh extension remove <name>`

Remove an installed extension

### `gh extension search [<query>] [flags]`

Search extensions to the GitHub CLI

  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
      --license strings   Filter based on license type
  -L, --limit int         Maximum number of extensions to fetch (default 30)
      --order string      Order of repositories returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc")
      --owner strings     Filter on owner
      --sort string       Sort fetched repositories: {forks|help-wanted-issues|stars|updated} (default "best-match")
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -w, --web               Open the search query in the web browser

### `gh extension upgrade {<name> | --all} [flags]`

Upgrade installed extensions

  --all       Upgrade all extensions
  --dry-run   Only display upgrades
  --force     Force upgrade extension

## `gh gist <command>`

Manage gists

### `gh gist clone <gist> [<directory>] [-- <gitflags>...]`

Clone a gist locally

### `gh gist create [<filename>... | -] [flags]`

Create a new gist

  -d, --desc string       A description for this gist
  -f, --filename string   Provide a filename to be used when reading from standard input
  -p, --public            List the gist publicly (default "secret")
  -w, --web               Open the web browser with created gist

Aliases

gh gist new

### `gh gist delete {<id> | <url>}`

Delete a gist

### `gh gist edit {<id> | <url>} [<filename>] [flags]`

Edit one of your gists

  -a, --add string        Add a new file to the gist
  -d, --desc string       New description for the gist
  -f, --filename string   Select a file to edit
  -r, --remove string     Remove a file from the gist

### `gh gist list [flags]`

List your gists

  -L, --limit int   Maximum number of gists to fetch (default 10)
      --public      Show only public gists
      --secret      Show only secret gists

Aliases

gh gist ls

### `gh gist rename {<id> | <url>} <oldFilename> <newFilename>`

Rename a file in a gist

### `gh gist view [<id> | <url>] [flags]`

View a gist

  -f, --filename string   Display a single file from the gist
      --files             List file names from the gist
  -r, --raw               Print raw instead of rendered gist contents
  -w, --web               Open gist in the browser

## `gh gpg-key <command>`

Manage GPG keys

### `gh gpg-key add [<key-file>] [flags]`

Add a GPG key to your GitHub account

  -t, --title string   Title for the new key

### `gh gpg-key delete <key-id> [flags]`

Delete a GPG key from your GitHub account

  -y, --yes   Skip the confirmation prompt

### `gh gpg-key list`

Lists GPG keys in your GitHub account

Aliases

gh gpg-key ls

## `gh issue <command>`

Manage issues

### `gh issue close {<number> | <url>} [flags]`

Close issue

  -c, --comment string   Leave a closing comment
  -r, --reason string    Reason for closing: {completed|not planned}

### `gh issue comment {<number> | <url>} [flags]`

Add a comment to an issue

  -b, --body text        The comment body text
  -F, --body-file file   Read body text from file (use "-" to read from standard input)
      --edit-last        Edit the last comment of the same author
  -e, --editor           Skip prompts and open the text editor to write the body in
  -w, --web              Open the web browser to write the comment

### `gh issue create [flags]`

Create a new issue

  -a, --assignee login   Assign people by their login. Use "@me" to self-assign.
  -b, --body string      Supply a body. Will prompt for one otherwise.
  -F, --body-file file   Read body text from file (use "-" to read from standard input)
  -l, --label name       Add labels by name
  -m, --milestone name   Add the issue to a milestone by name
  -p, --project name     Add the issue to projects by name
      --recover string   Recover input from a failed run of create
  -T, --template name    Template name to use as starting body text
  -t, --title string     Supply a title. Will prompt for one otherwise.
  -w, --web              Open the browser to create an issue

Aliases

gh issue new

### `gh issue delete {<number> | <url>} [flags]`

Delete issue

  --yes   confirm deletion without prompting

### `gh issue develop {<number> | <url>} [flags]`

Manage linked branches for an issue

  -b, --base string          Name of the base branch you want to make your new branch from
      --branch-repo string   Name or URL of the repository where you want to create your new branch
  -c, --checkout             Checkout the branch after creating it
  -l, --list                 List linked branches for the issue
  -n, --name string          Name of the branch to create

### `gh issue edit {<numbers> | <urls>} [flags]`

Edit issues

      --add-assignee login      Add assigned users by their login. Use "@me" to assign yourself.
      --add-label name          Add labels by name
      --add-project name        Add the issue to projects by name
  -b, --body string             Set the new body.
  -F, --body-file file          Read body text from file (use "-" to read from standard input)
  -m, --milestone name          Edit the milestone the issue belongs to by name
      --remove-assignee login   Remove assigned users by their login. Use "@me" to unassign yourself.
      --remove-label name       Remove labels by name
      --remove-project name     Remove the issue from projects by name
  -t, --title string            Set the new title.

### `gh issue list [flags]`

List issues in a repository

      --app string         Filter by GitHub App author
  -a, --assignee string    Filter by assignee
  -A, --author string      Filter by author
  -q, --jq expression      Filter JSON output using a jq expression
      --json fields        Output JSON with the specified fields
  -l, --label strings      Filter by label
  -L, --limit int          Maximum number of issues to fetch (default 30)
      --mention string     Filter by mention
  -m, --milestone string   Filter by milestone number or title
  -S, --search query       Search issues with query
  -s, --state string       Filter by state: {open|closed|all} (default "open")
  -t, --template string    Format JSON output using a Go template; see "gh help formatting"
  -w, --web                List issues in the web browser

Aliases

gh issue ls

### `gh issue lock {<number> | <url>} [flags]`

Lock issue conversation

  -r, --reason string   Optional reason for locking conversation (off_topic, resolved, spam, too_heated).

### `gh issue pin {<number> | <url>}`

Pin a issue

### `gh issue reopen {<number> | <url>} [flags]`

Reopen issue

  -c, --comment string   Add a reopening comment

### `gh issue status [flags]`

Show status of relevant issues

  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

### `gh issue transfer {<number> | <url>} <destination-repo>`

Transfer issue to another repository

### `gh issue unlock {<number> | <url>}`

Unlock issue conversation

### `gh issue unpin {<number> | <url>}`

Unpin a issue

### `gh issue view {<number> | <url>} [flags]`

View an issue

  -c, --comments          View issue comments
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -w, --web               Open an issue in the browser

## `gh kraken`

Extension kraken

## `gh label <command>`

Manage labels

### `gh label clone <source-repository> [flags]`

Clones labels from one repository to another

  -f, --force   Overwrite labels in the destination repository

### `gh label create <name> [flags]`

Create a new label

  -c, --color string         Color of the label
  -d, --description string   Description of the label
  -f, --force                Update the label color and description if label already exists

### `gh label delete <name> [flags]`

Delete a label from a repository

  --yes   Confirm deletion without prompting

### `gh label edit <name> [flags]`

Edit a label

  -c, --color string         Color of the label
  -d, --description string   Description of the label
  -n, --name string          New name of the label

### `gh label list [flags]`

List labels in a repository

  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -L, --limit int         Maximum number of labels to fetch (default 30)
      --order string      Order of labels returned: {asc|desc} (default "asc")
  -S, --search string     Search label names and descriptions
      --sort string       Sort fetched labels: {created|name} (default "created")
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -w, --web               List labels in the web browser

Aliases

gh label ls

## `gh montage`

Extension montage

## `gh org <command>`

Manage organizations

### `gh org list [flags]`

List organizations for the authenticated user.

  -L, --limit int   Maximum number of organizations to list (default 30)

Aliases

gh org ls

## `gh pr <command>`

Manage pull requests

### `gh pr checkout {<number> | <url> | <branch>} [flags]`

Check out a pull request in git

  -b, --branch string        Local branch name to use (default [the name of the head branch])
      --detach               Checkout PR with a detached HEAD
  -f, --force                Reset the existing local branch to the latest state of the pull request
      --recurse-submodules   Update all submodules after checkout

### `gh pr checks [<number> | <url> | <branch>] [flags]`

Show CI status for a single pull request

      --fail-fast          Exit watch mode on first check failure
  -i, --interval --watch   Refresh interval in seconds when using --watch flag (default 10)
  -q, --jq expression      Filter JSON output using a jq expression
      --json fields        Output JSON with the specified fields
      --required           Only show checks that are required
  -t, --template string    Format JSON output using a Go template; see "gh help formatting"
      --watch              Watch checks until they finish
  -w, --web                Open the web browser to show details about checks

### `gh pr close {<number> | <url> | <branch>} [flags]`

Close a pull request

  -c, --comment string   Leave a closing comment
  -d, --delete-branch    Delete the local and remote branch after close

### `gh pr comment [<number> | <url> | <branch>] [flags]`

Add a comment to a pull request

  -b, --body text        The comment body text
  -F, --body-file file   Read body text from file (use "-" to read from standard input)
      --edit-last        Edit the last comment of the same author
  -e, --editor           Skip prompts and open the text editor to write the body in
  -w, --web              Open the web browser to write the comment

### `gh pr create [flags]`

Create a pull request

  -a, --assignee login       Assign people by their login. Use "@me" to self-assign.
  -B, --base branch          The branch into which you want your code merged
  -b, --body string          Body for the pull request
  -F, --body-file file       Read body text from file (use "-" to read from standard input)
  -d, --draft                Mark pull request as a draft
      --dry-run              Print details instead of creating the PR. May still push git changes.
  -f, --fill                 Use commit info for title and body
      --fill-first           Use first commit info for title and body
      --fill-verbose         Use commits msg+body for description
  -H, --head branch          The branch that contains commits for your pull request (default [current branch])
  -l, --label name           Add labels by name
  -m, --milestone name       Add the pull request to a milestone by name
      --no-maintainer-edit   Disable maintainer's ability to modify pull request
  -p, --project name         Add the pull request to projects by name
      --recover string       Recover input from a failed run of create
  -r, --reviewer handle      Request reviews from people or teams by their handle
  -T, --template file        Template file to use as starting body text
  -t, --title string         Title for the pull request
  -w, --web                  Open the web browser to create a pull request

Aliases

gh pr new

### `gh pr diff [<number> | <url> | <branch>] [flags]`

View changes in a pull request

      --color string   Use color in diff output: {always|never|auto} (default "auto")
      --name-only      Display only names of changed files
      --patch          Display diff in patch format
  -w, --web            Open the pull request diff in the browser

### `gh pr edit [<number> | <url> | <branch>] [flags]`

Edit a pull request

      --add-assignee login      Add assigned users by their login. Use "@me" to assign yourself.
      --add-label name          Add labels by name
      --add-project name        Add the pull request to projects by name
      --add-reviewer login      Add reviewers by their login.
  -B, --base branch             Change the base branch for this pull request
  -b, --body string             Set the new body.
  -F, --body-file file          Read body text from file (use "-" to read from standard input)
  -m, --milestone name          Edit the milestone the pull request belongs to by name
      --remove-assignee login   Remove assigned users by their login. Use "@me" to unassign yourself.
      --remove-label name       Remove labels by name
      --remove-project name     Remove the pull request from projects by name
      --remove-reviewer login   Remove reviewers by their login.
  -t, --title string            Set the new title.

### `gh pr list [flags]`

List pull requests in a repository

      --app string        Filter by GitHub App author
  -a, --assignee string   Filter by assignee
  -A, --author string     Filter by author
  -B, --base string       Filter by base branch
  -d, --draft             Filter by draft state
  -H, --head string       Filter by head branch
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -l, --label strings     Filter by label
  -L, --limit int         Maximum number of items to fetch (default 30)
  -S, --search query      Search pull requests with query
  -s, --state string      Filter by state: {open|closed|merged|all} (default "open")
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -w, --web               List pull requests in the web browser

Aliases

gh pr ls

### `gh pr lock {<number> | <url>} [flags]`

Lock pull request conversation

  -r, --reason string   Optional reason for locking conversation (off_topic, resolved, spam, too_heated).

### `gh pr merge [<number> | <url> | <branch>] [flags]`

Merge a pull request

      --admin                   Use administrator privileges to merge a pull request that does not meet requirements
  -A, --author-email text       Email text for merge commit author
      --auto                    Automatically merge only after necessary requirements are met
  -b, --body text               Body text for the merge commit
  -F, --body-file file          Read body text from file (use "-" to read from standard input)
  -d, --delete-branch           Delete the local and remote branch after merge
      --disable-auto            Disable auto-merge for this pull request
      --match-head-commit SHA   Commit SHA that the pull request head must match to allow merge
  -m, --merge                   Merge the commits with the base branch
  -r, --rebase                  Rebase the commits onto the base branch
  -s, --squash                  Squash the commits into one commit and merge it into the base branch
  -t, --subject text            Subject text for the merge commit

### `gh pr ready [<number> | <url> | <branch>] [flags]`

Mark a pull request as ready for review

  --undo   Convert a pull request to "draft"

### `gh pr reopen {<number> | <url> | <branch>} [flags]`

Reopen a pull request

  -c, --comment string   Add a reopening comment

### `gh pr review [<number> | <url> | <branch>] [flags]`

Add a review to a pull request

  -a, --approve           Approve pull request
  -b, --body string       Specify the body of a review
  -F, --body-file file    Read body text from file (use "-" to read from standard input)
  -c, --comment           Comment on a pull request
  -r, --request-changes   Request changes on a pull request

### `gh pr status [flags]`

Show status of relevant pull requests

  -c, --conflict-status   Display the merge conflict status of each pull request
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

### `gh pr unlock {<number> | <url>}`

Unlock pull request conversation

### `gh pr view [<number> | <url> | <branch>] [flags]`

View a pull request

  -c, --comments          View pull request comments
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -w, --web               Open a pull request in the browser

## `gh project <command>`

Work with GitHub Projects.

### `gh project close [<number>] [flags]`

Close a project

      --format string     Output format: {json}
  -q, --jq expression     Filter JSON output using a jq expression
      --owner string      Login of the owner. Use "@me" for the current user.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
      --undo              Reopen a closed project

### `gh project copy [<number>] [flags]`

Copy a project

      --drafts                Include draft issues when copying
      --format string         Output format: {json}
  -q, --jq expression         Filter JSON output using a jq expression
      --source-owner string   Login of the source owner. Use "@me" for the current user.
      --target-owner string   Login of the target owner. Use "@me" for the current user.
  -t, --template string       Format JSON output using a Go template; see "gh help formatting"
      --title string          Title for the new project

### `gh project create [flags]`

Create a project

      --format string     Output format: {json}
  -q, --jq expression     Filter JSON output using a jq expression
      --owner string      Login of the owner. Use "@me" for the current user.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
      --title string      Title for the project

### `gh project delete [<number>] [flags]`

Delete a project

      --format string     Output format: {json}
  -q, --jq expression     Filter JSON output using a jq expression
      --owner string      Login of the owner. Use "@me" for the current user.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

### `gh project edit [<number>] [flags]`

Edit a project

  -d, --description string   New description of the project
      --format string        Output format: {json}
  -q, --jq expression        Filter JSON output using a jq expression
      --owner string         Login of the owner. Use "@me" for the current user.
      --readme string        New readme for the project
  -t, --template string      Format JSON output using a Go template; see "gh help formatting"
      --title string         New title for the project
      --visibility string    Change project visibility: {PUBLIC|PRIVATE}

### `gh project field-create [<number>] [flags]`

Create a field in a project

      --data-type string                DataType of the new field.: {TEXT|SINGLE_SELECT|DATE|NUMBER}
      --format string                   Output format: {json}
  -q, --jq expression                   Filter JSON output using a jq expression
      --name string                     Name of the new field
      --owner string                    Login of the owner. Use "@me" for the current user.
      --single-select-options strings   Options for SINGLE_SELECT data type
  -t, --template string                 Format JSON output using a Go template; see "gh help formatting"

### `gh project field-delete [flags]`

Delete a field in a project

      --format string     Output format: {json}
      --id string         ID of the field to delete
  -q, --jq expression     Filter JSON output using a jq expression
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

### `gh project field-list number [flags]`

List the fields in a project

      --format string     Output format: {json}
  -q, --jq expression     Filter JSON output using a jq expression
  -L, --limit int         Maximum number of fields to fetch (default 30)
      --owner string      Login of the owner. Use "@me" for the current user.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

### `gh project item-add [<number>] [flags]`

Add a pull request or an issue to a project

      --format string     Output format: {json}
  -q, --jq expression     Filter JSON output using a jq expression
      --owner string      Login of the owner. Use "@me" for the current user.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
      --url string        URL of the issue or pull request to add to the project

### `gh project item-archive [<number>] [flags]`

Archive an item in a project

      --format string     Output format: {json}
      --id string         ID of the item to archive
  -q, --jq expression     Filter JSON output using a jq expression
      --owner string      Login of the owner. Use "@me" for the current user.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
      --undo              Unarchive an item

### `gh project item-create [<number>] [flags]`

Create a draft issue item in a project

      --body string       Body for the draft issue
      --format string     Output format: {json}
  -q, --jq expression     Filter JSON output using a jq expression
      --owner string      Login of the owner. Use "@me" for the current user.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
      --title string      Title for the draft issue

### `gh project item-delete [<number>] [flags]`

Delete an item from a project by ID

      --format string     Output format: {json}
      --id string         ID of the item to delete
  -q, --jq expression     Filter JSON output using a jq expression
      --owner string      Login of the owner. Use "@me" for the current user.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

### `gh project item-edit [flags]`

Edit an item in a project

      --body string                      Body of the draft issue item
      --clear                            Remove field value
      --date string                      Date value for the field (YYYY-MM-DD)
      --field-id string                  ID of the field to update
      --format string                    Output format: {json}
      --id string                        ID of the item to edit
      --iteration-id string              ID of the iteration value to set on the field
  -q, --jq expression                    Filter JSON output using a jq expression
      --number float32                   Number value for the field
      --project-id string                ID of the project to which the field belongs to
      --single-select-option-id string   ID of the single select option value to set on the field
  -t, --template string                  Format JSON output using a Go template; see "gh help formatting"
      --text string                      Text value for the field
      --title string                     Title of the draft issue item

### `gh project item-list [<number>] [flags]`

List the items in a project

      --format string     Output format: {json}
  -q, --jq expression     Filter JSON output using a jq expression
  -L, --limit int         Maximum number of items to fetch (default 30)
      --owner string      Login of the owner. Use "@me" for the current user.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

### `gh project link [<number>] [flag] [flags]`

Link a project to a repository or a team

      --owner string   Login of the owner. Use "@me" for the current user.
  -R, --repo string    The repository to be linked to this project
  -T, --team string    The team to be linked to this project

### `gh project list [flags]`

List the projects for an owner

      --closed            Include closed projects
      --format string     Output format: {json}
  -q, --jq expression     Filter JSON output using a jq expression
  -L, --limit int         Maximum number of projects to fetch (default 30)
      --owner string      Login of the owner
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -w, --web               Open projects list in the browser

Aliases

gh project ls

### `gh project mark-template [<number>] [flags]`

Mark a project as a template

      --format string     Output format: {json}
  -q, --jq expression     Filter JSON output using a jq expression
      --owner string      Login of the org owner.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
      --undo              Unmark the project as a template.

### `gh project unlink [<number>] [flag] [flags]`

Unlink a project from a repository or a team

      --owner string   Login of the owner. Use "@me" for the current user.
  -R, --repo string    The repository to be unlinked from this project
  -T, --team string    The team to be unlinked from this project

### `gh project view [<number>] [flags]`

View a project

      --format string     Output format: {json}
  -q, --jq expression     Filter JSON output using a jq expression
      --owner string      Login of the owner. Use "@me" for the current user.
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -w, --web               Open a project in the browser

## `gh publicize`

Extension publicize

## `gh quoth`

Extension quoth

## `gh release <command>`

Manage releases

### `gh release create [<tag>] [<files>...]`

Create a new release

      --discussion-category string   Start a discussion in the specified category
  -d, --draft                        Save the release as a draft instead of publishing it
      --generate-notes               Automatically generate title and notes for the release
      --latest                       Mark this release as "Latest" (default [automatic based on date and version]). --latest=false to explicitly NOT set as latest
  -n, --notes string                 Release notes
  -F, --notes-file file              Read release notes from file (use "-" to read from standard input)
      --notes-from-tag               Automatically generate notes from annotated tag
      --notes-start-tag string       Tag to use as the starting point for generating release notes
  -p, --prerelease                   Mark the release as a prerelease
      --target branch                Target branch or full commit SHA (default [main branch])
  -t, --title string                 Release title
      --verify-tag                   Abort in case the git tag doesn't already exist in the remote repository

Aliases

gh release new

### `gh release delete <tag> [flags]`

Delete a release

      --cleanup-tag   Delete the specified tag in addition to its release
  -y, --yes           Skip the confirmation prompt

### `gh release delete-asset <tag> <asset-name> [flags]`

Delete an asset from a release

  -y, --yes   Skip the confirmation prompt

### `gh release download [<tag>] [flags]`

Download release assets

  -A, --archive format        Download the source code archive in the specified format (zip or tar.gz)
      --clobber               Overwrite existing files of the same name
  -D, --dir directory         The directory to download files into (default ".")
  -O, --output file           The file to write a single asset to (use "-" to write to standard output)
  -p, --pattern stringArray   Download only assets that match a glob pattern
      --skip-existing         Skip downloading when files of the same name exist

### `gh release edit <tag>`

Edit a release

      --discussion-category string   Start a discussion in the specified category when publishing a draft
      --draft                        Save the release as a draft instead of publishing it
      --latest                       Explicitly mark the release as "Latest"
  -n, --notes string                 Release notes
  -F, --notes-file file              Read release notes from file (use "-" to read from standard input)
      --prerelease                   Mark the release as a prerelease
      --tag string                   The name of the tag
      --target branch                Target branch or full commit SHA (default [main branch])
  -t, --title string                 Release title
      --verify-tag                   Abort in case the git tag doesn't already exist in the remote repository

### `gh release list [flags]`

List releases in a repository

      --exclude-drafts         Exclude draft releases
      --exclude-pre-releases   Exclude pre-releases
  -q, --jq expression          Filter JSON output using a jq expression
      --json fields            Output JSON with the specified fields
  -L, --limit int              Maximum number of items to fetch (default 30)
  -O, --order string           Order of releases returned: {asc|desc} (default "desc")
  -t, --template string        Format JSON output using a Go template; see "gh help formatting"

Aliases

gh release ls

### `gh release upload <tag> <files>... [flags]`

Upload assets to a release

  --clobber   Overwrite existing assets of the same name

### `gh release view [<tag>] [flags]`

View information about a release

  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -w, --web               Open the release in the browser

## `gh repo <command>`

Manage repositories

### `gh repo archive [<repository>] [flags]`

Archive a repository

  -y, --yes   Skip the confirmation prompt

### `gh repo clone <repository> [<directory>] [-- <gitflags>...]`

Clone a repository locally

  -u, --upstream-remote-name string   Upstream remote name when cloning a fork (default "upstream")

### `gh repo create [<name>] [flags]`

Create a new repository

      --add-readme             Add a README file to the new repository
  -c, --clone                  Clone the new repository to the current directory
  -d, --description string     Description of the repository
      --disable-issues         Disable issues in the new repository
      --disable-wiki           Disable wiki in the new repository
  -g, --gitignore string       Specify a gitignore template for the repository
  -h, --homepage URL           Repository home page URL
      --include-all-branches   Include all branches from template repository
      --internal               Make the new repository internal
  -l, --license string         Specify an Open Source License for the repository
      --private                Make the new repository private
      --public                 Make the new repository public
      --push                   Push local commits to the new repository
  -r, --remote string          Specify remote name for the new repository
  -s, --source string          Specify path to local repository to use as source
  -t, --team name              The name of the organization team to be granted access
  -p, --template repository    Make the new repository based on a template repository

Aliases

gh repo new

### `gh repo delete [<repository>] [flags]`

Delete a repository

  --yes   confirm deletion without prompting

### `gh repo deploy-key <command>`

Manage deploy keys in a repository

#### `gh repo deploy-key add <key-file> [flags]`

Add a deploy key to a GitHub repository

  -w, --allow-write    Allow write access for the key
  -t, --title string   Title of the new key

#### `gh repo deploy-key delete <key-id>`

Delete a deploy key from a GitHub repository

#### `gh repo deploy-key list [flags]`

List deploy keys in a GitHub repository

  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

Aliases

gh repo deploy-key ls

### `gh repo edit [<repository>] [flags]`

Edit repository settings

      --add-topic strings        Add repository topic
      --allow-forking            Allow forking of an organization repository
      --allow-update-branch      Allow a pull request head branch that is behind its base branch to be updated
      --default-branch name      Set the default branch name for the repository
      --delete-branch-on-merge   Delete head branch when pull requests are merged
  -d, --description string       Description of the repository
      --enable-auto-merge        Enable auto-merge functionality
      --enable-discussions       Enable discussions in the repository
      --enable-issues            Enable issues in the repository
      --enable-merge-commit      Enable merging pull requests via merge commit
      --enable-projects          Enable projects in the repository
      --enable-rebase-merge      Enable merging pull requests via rebase
      --enable-squash-merge      Enable merging pull requests via squashed commit
      --enable-wiki              Enable wiki in the repository
  -h, --homepage URL             Repository home page URL
      --remove-topic strings     Remove repository topic
      --template                 Make the repository available as a template repository
      --visibility string        Change the visibility of the repository to {public,private,internal}

### `gh repo fork [<repository>] [-- <gitflags>...] [flags]`

Create a fork of a repository

  --clone                 Clone the fork
  --default-branch-only   Only include the default branch in the fork
  --fork-name string      Rename the forked repository
  --org string            Create the fork in an organization
  --remote                Add a git remote for the fork
  --remote-name string    Specify the name for the new remote (default "origin")

### `gh repo list [<owner>] [flags]`

List repositories owned by user or organization

      --archived            Show only archived repositories
      --fork                Show only forks
  -q, --jq expression       Filter JSON output using a jq expression
      --json fields         Output JSON with the specified fields
  -l, --language string     Filter by primary coding language
  -L, --limit int           Maximum number of repositories to list (default 30)
      --no-archived         Omit archived repositories
      --source              Show only non-forks
  -t, --template string     Format JSON output using a Go template; see "gh help formatting"
      --topic strings       Filter by topic
      --visibility string   Filter by repository visibility: {public|private|internal}

Aliases

gh repo ls

### `gh repo rename [<new-name>] [flags]`

Rename a repository

  -y, --yes   Skip the confirmation prompt

### `gh repo set-default [<repository>] [flags]`

Configure default repository for this directory

  -u, --unset   unset the current default repository
  -v, --view    view the current default repository

### `gh repo sync [<destination-repository>] [flags]`

Sync a repository

  -b, --branch string   Branch to sync (default [default branch])
      --force           Hard reset the branch of the destination repository to match the source repository
  -s, --source string   Source repository

### `gh repo unarchive [<repository>] [flags]`

Unarchive a repository

  -y, --yes   Skip the confirmation prompt

### `gh repo view [<repository>] [flags]`

View a repository

  -b, --branch string     View a specific branch of the repository
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -w, --web               Open a repository in the browser

## `gh repo-export`

Extension repo-export

## `gh ruleset <command>`

View info about repo rulesets

Aliases

gh rs

### `gh ruleset check [<branch>] [flags]`

View rules that would apply to a given branch

      --default   Check rules on default branch
  -w, --web       Open the branch rules page in a web browser

### `gh ruleset list [flags]`

List rulesets for a repository or organization

  -L, --limit int    Maximum number of rulesets to list (default 30)
  -o, --org string   List organization-wide rulesets for the provided organization
  -p, --parents      Whether to include rulesets configured at higher levels that also apply (default true)
  -w, --web          Open the list of rulesets in the web browser

Aliases

gh rs ls, gh ruleset ls

### `gh ruleset view [<ruleset-id>] [flags]`

View information about a ruleset

  -o, --org string   Organization name if the provided ID is an organization-level ruleset
  -p, --parents      Whether to include rulesets configured at higher levels that also apply (default true)
  -w, --web          Open the ruleset in the browser

## `gh run <command>`

View details about workflow runs

### `gh run cancel [<run-id>]`

Cancel a workflow run

### `gh run delete [<run-id>]`

Delete a workflow run

### `gh run download [<run-id>] [flags]`

Download artifacts generated by a workflow run

  -D, --dir string            The directory to download artifacts into (default ".")
  -n, --name stringArray      Download artifacts that match any of the given names
  -p, --pattern stringArray   Download artifacts that match a glob pattern

### `gh run list [flags]`

List recent workflow runs

  -b, --branch string     Filter runs by branch
  -c, --commit SHA        Filter runs by the SHA of the commit
      --created date      Filter runs by the date it was created
  -e, --event event       Filter runs by which event triggered the run
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -L, --limit int         Maximum number of runs to fetch (default 20)
  -s, --status string     Filter runs by status: {queued|completed|in_progress|requested|waiting|action_required|cancelled|failure|neutral|skipped|stale|startup_failure|success|timed_out}
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -u, --user string       Filter runs by user who triggered the run
  -w, --workflow string   Filter runs by workflow

Aliases

gh run ls

### `gh run rerun [<run-id>] [flags]`

Rerun a run

  -d, --debug        Rerun with debug logging
      --failed       Rerun only failed jobs, including dependencies
  -j, --job string   Rerun a specific job ID from a run, including dependencies

### `gh run view [<run-id>] [flags]`

View a summary of a workflow run

  -a, --attempt uint      The attempt number of the workflow run
      --exit-status       Exit with non-zero status if run failed
  -j, --job string        View a specific job ID from a run
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
      --log               View full log for either a run or specific job
      --log-failed        View the log for any failed steps in a run or specific job
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -v, --verbose           Show job steps
  -w, --web               Open run in the browser

### `gh run watch <run-id> [flags]`

Watch a run until it completes, showing its progress

      --exit-status    Exit with non-zero status if run fails
  -i, --interval int   Refresh interval in seconds (default 3)

## `gh search <command>`

Search for repositories, issues, and pull requests

### `gh search code <query> [flags]`

Search within code

      --extension string   Filter on file extension
      --filename string    Filter on filename
  -q, --jq expression      Filter JSON output using a jq expression
      --json fields        Output JSON with the specified fields
      --language string    Filter results by language
  -L, --limit int          Maximum number of code results to fetch (default 30)
      --match strings      Restrict search to file contents or file path: {file|path}
      --owner strings      Filter on owner
  -R, --repo strings       Filter on repository
      --size string        Filter on size range, in kilobytes
  -t, --template string    Format JSON output using a Go template; see "gh help formatting"
  -w, --web                Open the search query in the web browser

### `gh search commits [<query>] [flags]`

Search for commits

      --author string            Filter by author
      --author-date date         Filter based on authored date
      --author-email string      Filter on author email
      --author-name string       Filter on author name
      --committer string         Filter by committer
      --committer-date date      Filter based on committed date
      --committer-email string   Filter on committer email
      --committer-name string    Filter on committer name
      --hash string              Filter by commit hash
  -q, --jq expression            Filter JSON output using a jq expression
      --json fields              Output JSON with the specified fields
  -L, --limit int                Maximum number of commits to fetch (default 30)
      --merge                    Filter on merge commits
      --order string             Order of commits returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc")
      --owner strings            Filter on repository owner
      --parent string            Filter by parent hash
  -R, --repo strings             Filter on repository
      --sort string              Sort fetched commits: {author-date|committer-date} (default "best-match")
  -t, --template string          Format JSON output using a Go template; see "gh help formatting"
      --tree string              Filter by tree hash
      --visibility strings       Filter based on repository visibility: {public|private|internal}
  -w, --web                      Open the search query in the web browser

### `gh search issues [<query>] [flags]`

Search for issues

      --app string             Filter by GitHub App author
      --archived               Filter based on the repository archived state {true|false}
      --assignee string        Filter by assignee
      --author string          Filter by author
      --closed date            Filter on closed at date
      --commenter user         Filter based on comments by user
      --comments number        Filter on number of comments
      --created date           Filter based on created at date
      --include-prs            Include pull requests in results
      --interactions number    Filter on number of reactions and comments
      --involves user          Filter based on involvement of user
  -q, --jq expression          Filter JSON output using a jq expression
      --json fields            Output JSON with the specified fields
      --label strings          Filter on label
      --language string        Filter based on the coding language
  -L, --limit int              Maximum number of results to fetch (default 30)
      --locked                 Filter on locked conversation status
      --match strings          Restrict search to specific field of issue: {title|body|comments}
      --mentions user          Filter based on user mentions
      --milestone title        Filter by milestone title
      --no-assignee            Filter on missing assignee
      --no-label               Filter on missing label
      --no-milestone           Filter on missing milestone
      --no-project             Filter on missing project
      --order string           Order of results returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc")
      --owner strings          Filter on repository owner
      --project number         Filter on project board number
      --reactions number       Filter on number of reactions
  -R, --repo strings           Filter on repository
      --sort string            Sort fetched results: {comments|created|interactions|reactions|reactions-+1|reactions--1|reactions-heart|reactions-smile|reactions-tada|reactions-thinking_face|updated} (default "best-match")
      --state string           Filter based on state: {open|closed}
      --team-mentions string   Filter based on team mentions
  -t, --template string        Format JSON output using a Go template; see "gh help formatting"
      --updated date           Filter on last updated at date
      --visibility strings     Filter based on repository visibility: {public|private|internal}
  -w, --web                    Open the search query in the web browser

### `gh search prs [<query>] [flags]`

Search for pull requests

      --app string              Filter by GitHub App author
      --archived                Filter based on the repository archived state {true|false}
      --assignee string         Filter by assignee
      --author string           Filter by author
  -B, --base string             Filter on base branch name
      --checks string           Filter based on status of the checks: {pending|success|failure}
      --closed date             Filter on closed at date
      --commenter user          Filter based on comments by user
      --comments number         Filter on number of comments
      --created date            Filter based on created at date
      --draft                   Filter based on draft state
  -H, --head string             Filter on head branch name
      --interactions number     Filter on number of reactions and comments
      --involves user           Filter based on involvement of user
  -q, --jq expression           Filter JSON output using a jq expression
      --json fields             Output JSON with the specified fields
      --label strings           Filter on label
      --language string         Filter based on the coding language
  -L, --limit int               Maximum number of results to fetch (default 30)
      --locked                  Filter on locked conversation status
      --match strings           Restrict search to specific field of issue: {title|body|comments}
      --mentions user           Filter based on user mentions
      --merged                  Filter based on merged state
      --merged-at date          Filter on merged at date
      --milestone title         Filter by milestone title
      --no-assignee             Filter on missing assignee
      --no-label                Filter on missing label
      --no-milestone            Filter on missing milestone
      --no-project              Filter on missing project
      --order string            Order of results returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc")
      --owner strings           Filter on repository owner
      --project number          Filter on project board number
      --reactions number        Filter on number of reactions
  -R, --repo strings            Filter on repository
      --review string           Filter based on review status: {none|required|approved|changes_requested}
      --review-requested user   Filter on user or team requested to review
      --reviewed-by user        Filter on user who reviewed
      --sort string             Sort fetched results: {comments|reactions|reactions-+1|reactions--1|reactions-smile|reactions-thinking_face|reactions-heart|reactions-tada|interactions|created|updated} (default "best-match")
      --state string            Filter based on state: {open|closed}
      --team-mentions string    Filter based on team mentions
  -t, --template string         Format JSON output using a Go template; see "gh help formatting"
      --updated date            Filter on last updated at date
      --visibility strings      Filter based on repository visibility: {public|private|internal}
  -w, --web                     Open the search query in the web browser

### `gh search repos [<query>] [flags]`

Search for repositories

      --archived                    Filter based on the repository archived state {true|false}
      --created date                Filter based on created at date
      --followers number            Filter based on number of followers
      --forks number                Filter on number of forks
      --good-first-issues number    Filter on number of issues with the 'good first issue' label
      --help-wanted-issues number   Filter on number of issues with the 'help wanted' label
      --include-forks string        Include forks in fetched repositories: {false|true|only}
  -q, --jq expression               Filter JSON output using a jq expression
      --json fields                 Output JSON with the specified fields
      --language string             Filter based on the coding language
      --license strings             Filter based on license type
  -L, --limit int                   Maximum number of repositories to fetch (default 30)
      --match strings               Restrict search to specific field of repository: {name|description|readme}
      --number-topics number        Filter on number of topics
      --order string                Order of repositories returned, ignored unless '--sort' flag is specified: {asc|desc} (default "desc")
      --owner strings               Filter on owner
      --size string                 Filter on a size range, in kilobytes
      --sort string                 Sort fetched repositories: {forks|help-wanted-issues|stars|updated} (default "best-match")
      --stars number                Filter on number of stars
  -t, --template string             Format JSON output using a Go template; see "gh help formatting"
      --topic strings               Filter on topic
      --updated date                Filter on last updated at date
      --visibility strings          Filter based on visibility: {public|private|internal}
  -w, --web                         Open the search query in the web browser

## `gh secret <command>`

Manage GitHub secrets

### `gh secret delete <secret-name> [flags]`

Delete secrets

  -a, --app string   Delete a secret for a specific application: {actions|codespaces|dependabot}
  -e, --env string   Delete a secret for an environment
  -o, --org string   Delete a secret for an organization
  -u, --user         Delete a secret for your user

Aliases

gh secret remove

### `gh secret list [flags]`

List secrets

  -a, --app string        List secrets for a specific application: {actions|codespaces|dependabot}
  -e, --env string        List secrets for an environment
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -o, --org string        List secrets for an organization
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
  -u, --user              List a secret for your user

Aliases

gh secret ls

### `gh secret set <secret-name> [flags]`

Create or update secrets

  -a, --app string           Set the application for a secret: {actions|codespaces|dependabot}
  -b, --body string          The value for the secret (reads from standard input if not specified)
  -e, --env environment      Set deployment environment secret
  -f, --env-file file        Load secret names and values from a dotenv-formatted file
      --no-store             Print the encrypted, base64-encoded value instead of storing it on GitHub
  -o, --org organization     Set organization secret
  -r, --repos repositories   List of repositories that can access an organization or user secret
  -u, --user                 Set a secret for your user
  -v, --visibility string    Set visibility for an organization secret: {all|private|selected} (default "private")

## `gh slack`

Extension slack

## `gh ssh-key <command>`

Manage SSH keys

### `gh ssh-key add [<key-file>] [flags]`

Add an SSH key to your GitHub account

  -t, --title string   Title for the new key
      --type string    Type of the ssh key: {authentication|signing} (default "authentication")

### `gh ssh-key delete <id> [flags]`

Delete an SSH key from your GitHub account

  -y, --yes   Skip the confirmation prompt

### `gh ssh-key list`

Lists SSH keys in your GitHub account

Aliases

gh ssh-key ls

## `gh status [flags]`

Print information about relevant issues, pull requests, and notifications across repositories

  -e, --exclude strings   Comma separated list of repos to exclude in owner/name format
  -o, --org string        Report status within an organization

## `gh variable <command>`

Manage GitHub Actions variables

### `gh variable delete <variable-name> [flags]`

Delete variables

  -e, --env string   Delete a variable for an environment
  -o, --org string   Delete a variable for an organization

Aliases

gh variable remove

### `gh variable list [flags]`

List variables

  -e, --env string        List variables for an environment
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -o, --org string        List variables for an organization
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

Aliases

gh variable ls

### `gh variable set <variable-name> [flags]`

Create or update variables

  -b, --body string          The value for the variable (reads from standard input if not specified)
  -e, --env environment      Set deployment environment variable
  -f, --env-file file        Load variable names and values from a dotenv-formatted file
  -o, --org organization     Set organization variable
  -r, --repos repositories   List of repositories that can access an organization variable
  -v, --visibility string    Set visibility for an organization variable: {all|private|selected} (default "private")

## `gh workflow <command>`

View details about GitHub Actions workflows

### `gh workflow disable [<workflow-id> | <workflow-name>]`

Disable a workflow

### `gh workflow enable [<workflow-id> | <workflow-name>]`

Enable a workflow

### `gh workflow list [flags]`

List workflows

  -a, --all               Include disabled workflows
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -L, --limit int         Maximum number of workflows to fetch (default 50)
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"

Aliases

gh workflow ls

### `gh workflow run [<workflow-id> | <workflow-name>] [flags]`

Run a workflow by creating a workflow_dispatch event

  -F, --field key=value       Add a string parameter in key=value format, respecting @ syntax (see "gh help api").
      --json                  Read workflow inputs as JSON via STDIN
  -f, --raw-field key=value   Add a string parameter in key=value format
  -r, --ref string            The branch or tag name which contains the version of the workflow file you'd like to run

### `gh workflow view [<workflow-id> | <workflow-name> | <filename>] [flags]`

View the summary of a workflow

  -r, --ref string   The branch or tag name which contains the version of the workflow file you'd like to view
  -w, --web          Open workflow in the browser
  -y, --yaml         View the workflow yaml file

Copy link
Contributor

@andyfeller andyfeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge thanks, @gabemontero, for your contribution and patience! 😸

@andyfeller andyfeller enabled auto-merge May 17, 2024 14:22
@andyfeller andyfeller merged commit f9722d8 into cli:trunk May 17, 2024
9 checks passed
@gabemontero
Copy link
Contributor Author

Huge thanks, @gabemontero, for your contribution and patience! 😸

likewise thanks @andyfeller @williammartin for the attention and patience :-)

it was nice to dust off my golang cli skills

@gabemontero gabemontero deleted the ggm-issue-8677-tinker branch May 17, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external pull request originating outside of the CLI core team
Projects
No open projects
The GitHub CLI
  
Needs review 🤔
Development

Successfully merging this pull request may close these issues.

Add command aliases to gh reference
4 participants