.nh .TH "glab" "1" "Sep 2026" "Auto generated by spf13/cobra" "" .SH NAME glab-alias-set - Set an alias for a longer command. .SH SYNOPSIS \fBglab alias set '\&' [flags]\fP .SH DESCRIPTION Declare a word as an alias for a longer command. .PP Use quotation marks when you define a command, as shown in the examples. .PP Your expansion can include arguments and flags. If your expansion includes positional placeholders such as \fB$1\fR or \fB$2\fR, any extra arguments that follow the invocation of the alias are inserted into those placeholders. .PP To run an alias through \fBsh\fR, a shell converter, specify the \fB--shell\fR flag. With shell conversion, you can compose commands with \fB|\fR or redirect with \fB>\fR\&. Shell aliases have these caveats: .IP \(bu 2 Extra arguments that follow the alias are not passed to the expansion. To accept arguments, use \fB$1\fR, \fB$2\fR, and so on. .IP \(bu 2 To accept all arguments, use \fB$@\fR\&. .PP On Windows, shell aliases run through \fBsh\fR as installed by Git for Windows. If you installed Git in another way on Windows, shell aliases might not work. .SH OPTIONS \fB-s\fP, \fB--shell\fP[=false] Declare an alias to be passed through a shell interpreter. .SH OPTIONS INHERITED FROM PARENT COMMANDS \fB-h\fP, \fB--help\fP[=false] Show help for this command. .SH EXAMPLE .EX # Define an alias for "mr view" glab alias set mrv 'mr view' # Run the alias; it expands to "glab mr view -w 123" glab mrv -w 123 # Define an alias with a positional placeholder glab alias set createissue 'issue create --title "$1"' # Run the alias with an argument and an extra flag glab createissue "My Issue" --description "Something is broken." # Define a shell alias that pipes glab output to grep glab alias set --shell igrep 'glab issue list --assignee="$1" | grep $2' # Run the shell alias with two arguments glab igrep user foo .EE .SH SEE ALSO \fBglab-alias(1)\fP