Forrest logo
back to the gh tool

gh-alias:tldr:6780d

gh-alias: Display the subcommand help.
$ gh alias
try on your machine

The gh alias command is used to manage and configure custom command aliases in GitHub CLI (gh).

Aliases are shortcuts or alternative names for frequently used GitHub CLI commands. They help to simplify and speed up the usage of CLI commands by allowing users to create their own custom commands or aliases.

When you run gh alias without any additional parameters, it lists all the existing aliases that you have set up. The command is useful for checking the current aliases you have defined.

Some additional options that can be used with gh alias are:

  • gh alias set <name> <command>: This creates a new alias <name> for the specified <command>. For example, gh alias set ll "pr list --limit 5" would create an alias ll for the command pr list --limit 5. Now, whenever you run gh ll, it will execute pr list --limit 5.

  • gh alias delete <name>: This removes the specified alias <name> from your configuration. For instance, gh alias delete ll will remove the ll alias we created earlier.

  • gh alias reset: This resets all the custom aliases to their default values.

The gh alias command allows you to set up and manage your own customized command shortcuts, making it easier and more efficient to interact with GitHub CLI.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gh tool