LinuxCommandLibrary

gist

Create and manage GitHub Gists from the command line

TLDR

Create a gist from file

$ gist [file]
copy
Create public gist
$ gist -p [file]
copy
Create from stdin
$ echo "[content]" | gist
copy
Create with description
$ gist -d "[description]" [file]
copy
List your gists
$ gist -l
copy
Update existing gist
$ gist -u [gist_id] [file]
copy
Copy URL to clipboard
$ gist -c [file]
copy
Open in browser
$ gist -o [file]
copy

SYNOPSIS

gist [options] [files...]

DESCRIPTION

gist creates and manages GitHub Gists from the command line. Gists provide a lightweight way to share code snippets, notes, and small files without creating a full repository. Each gist supports multiple files, syntax highlighting, version control, forking, and commenting.
The tool requires authentication through a GitHub personal access token. Gists are private by default unless created with the -p flag. It integrates with the system clipboard and browser for streamlined workflows.

PARAMETERS

-p, --public

Make public (default private).
-d, --description text
Gist description.
-l, --list [user]
List gists.
-u, --update id
Update existing gist.
-c, --copy
Copy URL to clipboard.
-o, --open
Open in browser.
-f, --filename name
Set filename.

CONFIGURATION

~/.gist

Stores the GitHub personal access token for authentication.
GITHUB_TOKEN
Environment variable alternative for authentication token.

SEE ALSO

gh-gist(1), gh(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community