GH-GIST-EDIT(1) GitHub CLI manual GH-GIST-EDIT(1)

# [NAME](#NAME)

gh-gist-edit - Edit one of your gists

# [SYNOPSIS](#SYNOPSIS)

**gh gist edit {&lt;id&gt; | &lt;url&gt;} \[&lt;filename&gt;] \[flags]**

# [OPTIONS](#OPTIONS)

[**-a**, **--add** **&lt;string&gt;**](#a)

Add a new file to the gist

[**-d**, **--desc** **&lt;string&gt;**](#d)

New description for the gist

[**-f**, **--filename** **&lt;string&gt;**](#f)

Select a file to edit

[**-r**, **--remove** **&lt;string&gt;**](#r)

Remove a file from the gist

# [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)

```
# Select a gist to edit interactively
$ gh gist edit
# Edit a gist file in the default editor
$ gh gist edit 1234567890abcdef1234567890abcdef
# Edit a specific file in the gist
$ gh gist edit 1234567890abcdef1234567890abcdef --filename hello.py
# Replace a gist file with content from a local file
$ gh gist edit 1234567890abcdef1234567890abcdef --filename hello.py hello.py
# Add a new file to the gist
$ gh gist edit 1234567890abcdef1234567890abcdef --add newfile.py
# Change the description of the gist
$ gh gist edit 1234567890abcdef1234567890abcdef --desc "new description"
# Remove a file from the gist
$ gh gist edit 1234567890abcdef1234567890abcdef --remove hello.py
```

# [SEE ALSO](#SEE_ALSO)

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

Oct 2026

---

Document: gh-gist-edit(1) from gh 2.102.1-r0 (Chainguard OS)
Source: https://github.com/cli/cli
