LinuxCommandLibrary

gh-gist

manage code snippets and shareable files

TLDR

Create a gist

$ gh gist create [file]
copy
Create public gist
$ gh gist create -p [file]
copy
Create from stdin
$ echo "[content]" | gh gist create
copy
List gists
$ gh gist list
copy
View a gist
$ gh gist view [gist_id]
copy
Edit a gist
$ gh gist edit [gist_id]
copy
Delete a gist
$ gh gist delete [gist_id]
copy
Clone a gist
$ gh gist clone [gist_id]
copy

SYNOPSIS

gh gist command [options]

DESCRIPTION

gh gist manages GitHub Gists, a simple way to share code snippets, notes, and small files. Gists can be public or secret, with secret gists hidden from search but accessible via URL.
Each gist supports multiple files and full version history through git. They can be cloned like regular repositories, making them useful for sharing configuration files, scripts, or documentation. Gists support syntax highlighting and can be embedded in websites.
The CLI provides full lifecycle management from creation through editing and deletion, with support for reading content from stdin for scripting workflows.

PARAMETERS

-p, --public

Make gist public.
-d, --desc text
Gist description.
-f, --filename name
Set filename.

SUBCOMMANDS

create

Create a gist.
list
List gists.
view
View a gist.
edit
Edit a gist.
delete
Delete a gist.
clone
Clone a gist.
rename
Rename gist file.

SEE ALSO

gh(1), gist(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community