gh-alias-import(1)

gh-alias-import1

Import aliases from a yaml file

Usage

gh alias import [{<filename> | -}] [flags]

Overview

Import aliases from the contents of a YAML file.

Aliases should be defined as a map in YAML, where the keys represent aliases and the values represent the corresponding expansions. An example file should look like the following:

bugs: issue list --label=bug
igrep: '!gh issue list --label="$1" | grep "$2"'
features: |-
    issue list
    --label=enhancement

Use - to read aliases (in YAML format) from standard input.

The output from gh alias list can be used to produce a YAML file containing your aliases, which you can use to import them from one machine to another. Run gh help alias list to learn more.

Options

--clobber

Overwrite existing aliases of the same name

Exit status

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

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

Examples

# Import aliases from a file
$ gh alias import aliases.yml
# Import aliases from standard input
$ gh alias import -

Releases

2 releases since Debian 13 (Trixie); the text changed 1 time.

  1. 13
  2. Arch

From github-cli 2.102.1-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.