LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

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 the gist public (default is secret).
-d, --desc text
Gist description.
-f, --filename name
Provide a filename for content read from standard input.
-w, --web
Open the gist in a web browser after creating or viewing.
-r, --raw
Print raw, non-rendered content when viewing.

SUBCOMMANDS

create

Create a new gist from files or stdin.
list
List your gists.
view
View a gist's contents.
edit
Edit one of your gists.
delete
Delete a gist.
clone
Clone a gist locally via git.
rename
Rename a file in a gist.

SEE ALSO

gh(1), gist(1), git(1)

Copied to clipboard
Kai