GH-CONFIG-SET(1)

๐Ÿ’… gh-config-set(1) โ€” the GitHub CLI manual, bestie edition โœจ

okay so this is gh-config-set, and yes it lives in the GitHub CLI manual (v2.102.0 energy, hi ๐Ÿ‘‹). it's the glow-up page for setting one specific config key to one specific value. tiny command, huge main character energy. let's get into it ๐ŸŽ€


๐ŸŒธ NAME ๐ŸŒธ

gh-config-set โ€” update configuration with a value for the given key ๐Ÿ’–

like, you pick a key, you pick a value, and the config gets updated. that's the whole vibe check and it ate.

โœจ SYNOPSIS โœจ

gh config set <key> <value> [flags]

literally just <key> then <value> then whatever flags you're feeling. periodt ๐Ÿซถ

๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -h, --host <string> โ€” set this as a per-host setting ๐Ÿ‘‘ so instead of changing the whole config globally, you're like "no bestie, this one's just for this host." very targeted, very intentional.

๐Ÿ”ฅ EXIT CODES ๐Ÿ”ฅ

the numbers that tell you how it went, no cap:

  • 0: Successful execution โ€” slay ๐Ÿ’… it worked
  • 1: Error โ€” something went sideways ๐Ÿ˜ญ
  • 2: Command canceled โ€” you (or something) hit the brakes ๐Ÿ™ˆ
  • 4: Authentication required โ€” the vibes need credentials ๐Ÿ”
โญ NOTE: specific commands may have additional exit codes. refer to the command's help for more information โ€” iykyk, always check the specific command's help before you spiral ๐Ÿงš

๐Ÿฆ‹ EXAMPLE ๐Ÿฆ‹

okay these are the actual examples, copy-paste safe, character for character:

$ 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

look at that range ๐Ÿ˜ฎโ€๐Ÿ’จ setting your editor to plain vim, setting it to "code --wait" (quotes matter, don't @ me), picking git_protocol as ssh but only for github.com, pointing api_host at api-gateway.example.com but only for example.com, and turning prompt off. iconic behavior honestly ๐ŸŒˆ

๐ŸŒธ SEE ALSO ๐ŸŒธ

  • gh-config(1) โ€” go read the parent page, it's giving family reunion ๐Ÿซถ

and that's the tea ๐Ÿ“ โ€” this page brought to you by GitHub CLI v2.102.0, dated Oct 2026. go forth and set responsibly, bestie ๐Ÿ’œโœจ

๐Ÿ“ฆ where this page comes from