Home / Alt manpages / gh-config-list(1)

  • gh-config-list(1)
  • User command
  • linux

Audit GitHub CLI Settings with gh config list

Before you change a single GitHub CLI setting, gh config list shows you every value that command is actually using right now. It is read-only: it prints configuration and does not alter it, and it can also compare those values against settings for one GitHub host. These examples were checked with GitHub CLI 2.87.3, released in February 2026.

Allow about five minutes. You need a shell and the gh package. Authentication is not required to list local settings. The output can include choices that affect future commands, so treat it as configuration data rather than something to paste into a public issue without review.

1. Confirm the installed command

Check which executable will run and record its version. This is an ordinary, unprivileged check:

$ command -v gh
/usr/bin/gh
$ gh --version
gh version 2.87.3 (2026-02-23)
https://github.com/cli/cli/releases/tag/v2.87.3

The path and release date are host-specific. A different version may support a different set of configuration keys, so keep the version beside any diagnostic capture.

Checkpoint

If command -v gh prints nothing, stop here and install GitHub CLI through your normal package-management process. Do not work around a missing command by downloading an unreviewed binary into the current directory.

2. List the ordinary configuration

Run gh config list without options:

$ gh config list
git_protocol=https
editor=
prompt=enabled
prefer_editor_prompt=disabled
pager=
http_unix_socket=
browser=
color_labels=disabled
accessible_colors=disabled
accessible_prompter=disabled
spinner=enabled

Each non-empty line has a configuration key followed by = and its value. An empty value is still a setting state, not a missing line. In this example, the editor, pager, browser and Unix socket are unset, while Git operations use HTTPS and prompts are enabled.

Your list can differ. GitHub CLI may add settings in later releases, and the command only reports keys that apply to the installed version and its current configuration. Do not assume an omitted key has the same meaning as an explicitly disabled key.

3. Read the output without changing it

Use the list to answer operational questions. For example, git_protocol=ssh would mean that gh prefers SSH for clone and push operations. A configured editor or browser can affect commands that open an editor or URL. The setting is not the same as a repository's remote URL, and listing it does not test whether the selected program is installed.

Keep the output intact when collecting diagnostics, including blank values. A simple capture avoids changing state:

$ gh config list > /tmp/gh-config-list.txt
$ wc -l /tmp/gh-config-list.txt
11 /tmp/gh-config-list.txt

The line count above is only the result from the installed 2.87.3 setup shown earlier. Use sed -n '1,20p' /tmp/gh-config-list.txt to review the capture. The file is temporary and may contain information about local preferences, so remove it when the diagnostic is finished:

$ rm -- /tmp/gh-config-list.txt

That removal is irreversible. Skip it until you have retained the output where your incident process requires it, and do not place a configuration capture in a shared directory.

4. Compare settings for one host

Pass the hostname to --host when you need per-host configuration:

$ gh config list --host github.com
git_protocol=https
editor=
prompt=enabled
prefer_editor_prompt=disabled
pager=
http_unix_socket=
browser=
color_labels=disabled
accessible_colors=disabled
accessible_prompter=disabled
spinner=enabled

Replace github.com with the hostname of the GitHub Enterprise Server instance you are investigating, for example github.example.com. Do not include https://, a repository path or OWNER/REPO. The option selects per-host configuration; it does not authenticate to that host or check network reachability.

Checkpoint

Compare the two command outputs, not just one key. If a host-specific value is absent, do not infer that the host is unreachable. It may simply be inheriting the ordinary setting or using a default. Use the exact hostname that the failing gh command targets.

5. Check a setting before making a separate change

For a single value, gh config get is more focused, but keep the list command as the audit record. For example:

$ gh config get git_protocol
https

This is another read-only check. If you later decide that a value must change, use gh config set deliberately and capture the old output first. That is outside this guide because it changes future clone and push behaviour. There is no need for sudo: GitHub CLI user configuration belongs to the invoking user's configuration directory, and elevated privileges can inspect a different user's settings.

6. Avoid the common traps

Do not treat the list as an authentication report. It shows configuration keys and values, while credentials are managed separately by GitHub CLI's authentication mechanisms. Use gh auth status when the question is whether an account is authenticated, and keep access tokens out of diagnostic files and terminal recordings.

Do not confuse --host here with a repository selector. It is a string naming the GitHub host. A malformed hostname may produce an empty or default-looking list, which is still a reason to recheck the spelling rather than a reason to edit configuration.

Finally, do not use an empty editor, pager or browser value as proof that the related feature is broken. An empty value can mean that GitHub CLI will fall back to another environment or system default. Inspect the relevant command and environment separately before changing a setting.

Done means

  • Version recorded. You noted the installed gh version.
  • Settings listed. You ran gh config list and preserved the exact key-value output when needed.
  • Host scoped correctly. You used --host HOSTNAME only for a real GitHub hostname.
  • Concerns separated. You distinguished configuration inspection from authentication and network checks.
  • Nothing changed. No configuration, credential, repository or system change was made.