glab(1)

πŸ’… glab(1) β€” the glab alias set page, bestie

πŸŽ€ NAME πŸŽ€

glab-alias-set β€” Set an alias for a longer command.

✨ SYNOPSIS ✨

glab alias set  '' [flags]

🌸 DESCRIPTION 🌸

Okay so here's the vibe: you can declare a word as an alias for a longer command.

Use quotation marks when you define a command, as shown in the examples.

Your expansion can include arguments and flags. If your expansion includes positional placeholders such as $1 or $2, any extra arguments that follow the invocation of the alias are inserted into those placeholders.

To run an alias through sh, a shell converter, specify the --shell flag. With shell conversion, you can compose commands with | or redirect with >. Shell aliases have these caveats:

  • Extra arguments that follow the alias are not passed to the expansion. To accept arguments, use $1, $2, and so on.
  • To accept all arguments, use $@.

On Windows, shell aliases run through sh as installed by Git for Windows. If you installed Git in another way on Windows, shell aliases might not work.

πŸ’– OPTIONS πŸ’–

  • -s, --shell[=false] β€” Declare an alias to be passed through a shell interpreter.

πŸ‘‘ OPTIONS INHERITED FROM PARENT COMMANDS πŸ‘‘

  • -h, --help[=false] β€” Show help for this command.

πŸ”₯ EXAMPLE πŸ”₯

# 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

πŸ¦‹ SEE ALSO πŸ¦‹

glab-alias(1) β€” that's the other page to check, bestie.


mwah πŸ’‹ β€” this page was auto generated by spf13/cobra in Nov 2026, and it's living under the glab(1) manual name. byeee 🫢

πŸ“¦ where this page comes from