Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
GH-ALIAS-SET(1) 		GitHub CLI manual		 GH-ALIAS-SET(1)

NAME
     gh-alias-set - Create a shortcut for a gh command

SYNOPSIS
     gh alias set <alias> <expansion> [flags]

DESCRIPTION
     Define a word that will expand to a full gh command when invoked.

     The  expansion may specify additional arguments and flags. If the expansion
     includes positional placeholders such as $1, extra  arguments  that  follow
     the  alias  will be inserted appropriately. Otherwise, extra arguments will
     be appended to the expanded command.

     Use - as expansion argument to read the expansion string from standard  in-
     put. This is useful to avoid quoting issues when defining expansions.

     If  the expansion starts with ! or if --shell was given, the expansion is a
     shell expression that will be evaluated through the sh interpreter when the
     alias is invoked. This allows for chaining multiple commands via piping and
     redirection.

OPTIONS
     --clobber
	    Overwrite existing aliases of the same name

     -s, --shell
	    Declare an alias to be passed through a shell interpreter

EXIT CODES
     0: Successful execution

     1: Error

     2: Command canceled

     4: Authentication required

     NOTE: Specific commands may have additional exit codes. Refer to  the  com-
     mand's help for more information.

EXAMPLE
     # Note: Command Prompt on Windows requires using double quotes for arguments
     $ gh alias set pv 'pr view'
     $ gh pv -w 123  #=> gh pr view -w 123

     $ gh alias set bugs 'issue list --label=bugs'
     $ gh bugs

     $ gh alias set homework 'issue list --assignee @me'
     $ gh homework

     $ gh alias set 'issue mine' 'issue list --mention @me'
     $ gh issue mine

     $ gh alias set epicsBy 'issue list --author="$1" --label="epic"'
     $ gh epicsBy vilmibm  #=> gh issue list --author="vilmibm" --label="epic"

     $ gh alias set --shell igrep 'gh issue list --label="$1" | grep "$2"'
     $ gh igrep epic foo  #=> gh issue list --label="epic" | grep "foo"

SEE ALSO
     gh-alias(1)

				    Aug 2026			 GH-ALIAS-SET(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=gh-alias-set&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help