GH-CONFIG-SET(1) GitHub CLI manual GH-CONFIG-SET(1)

# [NAME](#NAME)

gh-config-set - Update configuration with a value for the given key

# [SYNOPSIS](#SYNOPSIS)

**gh config set &lt;key&gt; &lt;value&gt; \[flags]**

# [OPTIONS](#OPTIONS)

[**-h**, **--host** **&lt;string&gt;**](#h)

Set per-host setting

# [EXIT CODES](#EXIT_CODES)

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.

# [EXAMPLE](#EXAMPLE)

```
$ gh config set editor vim
$ gh config set editor "code --wait"
$ gh config set git_protocol ssh --host github.com
$ gh config set api_host api-gateway.example.com --host example.com
$ gh config set prompt disabled
```

# [SEE ALSO](#SEE_ALSO)

[**gh-config(1)**](/man/os/gh/gh-config.1)

Oct 2026

---

Document: gh-config-set(1) from gh 2.103.3-r1 (Chainguard OS)
Source: https://github.com/cli/cli
