go-gists
Manage GitHub Gists from the terminal β fast, colorful, production-ready.
βββββββ βββββββ βββββββ ββββββββββββββββββββββββββββ
ββββββββ βββββββββ ββββββββ ββββββββββββββββββββββββββββ
βββ βββββββ βββ βββ βββββββββββββββ βββ ββββββββ
βββ ββββββ βββ βββ ββββββββββββββ βββ ββββββββ
ββββββββββββββββββ ββββββββββββββββββββ βββ ββββββββ
βββββββ βββββββ βββββββ βββββββββββ βββ ββββββββ
Features
- Create a new public or private gist from any local file
- Update an existing gist's content and/or description
- List all your gists in a rich, colored table β then copy an ID or URL to clipboard with one keypress
- Delete one or more gists (with confirmation prompt)
- View metadata for any gist by ID
- Auth management β save, show, or clear your GitHub token in a local config file
- Full pagination support (lists all gists, not just the first page)
- Token resolved from environment variable (
GITHUB_TOKEN) or config file (~/.config/go-gists/go-gists.ini)
- Shell autocompletion via
go-gists completion bash|zsh|fish|powershell
Installation
From source
git clone https://github.com/cumulus13/go-gists/go-gists.git
cd go-gists
go build -o go-gists .
sudo mv go-gists /usr/local/bin/
Pre-built binary
Download from the Releases page.
Authentication
go-gists needs a GitHub personal access token with the gist scope.
Option 1 β Environment variable (recommended for CI/CD):
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
Option 2 β Config file (recommended for interactive use):
go-gists auth set ghp_xxxxxxxxxxxxxxxxxxxx
This saves the token to ~/.config/go-gists/go-gists.ini (Linux/macOS) or
%APPDATA%\go-gists\go-gists.ini (Windows).
Check which token is active:
go-gists auth show
Remove a stored token:
go-gists auth clear
Usage
Create a gist
# Public gist (default)
go-gists create ./script.py "My awesome Python script"
# Private gist
go-gists create ./notes.md "Private meeting notes" --private
# or shorthand
go-gists create ./notes.md "Private notes" -p
Update a gist
# Update file content only
go-gists update <gist-id> ./script.py
# Update content and change description
go-gists update <gist-id> ./script.py --description "Updated script v2"
List all gists
go-gists list
Renders a paginated table with index, ID, description, and URL. After the
table you are prompted to type a number β press Enter to skip, or type
the row number to copy its ID to your clipboard.
# Copy the URL instead of the ID
go-gists list --url
# Non-interactive / scripting mode (no prompt)
go-gists list --no-interactive
View a single gist
go-gists view <gist-id>
Delete gists
# Single gist (prompted for confirmation)
go-gists delete <gist-id>
# Multiple gists at once
go-gists delete <id1> <id2> <id3>
# Skip confirmation
go-gists delete <gist-id> --yes
Shell autocompletion
# Bash
go-gists completion bash >> ~/.bashrc
# Zsh
go-gists completion zsh >> ~/.zshrc
# Fish
go-gists completion fish > ~/.config/fish/completions/go-gists.fish
[auth]
token = ghp_xxxxxxxxxxxxxxxxxxxx
Location:
- Linux / macOS:
~/.config/go-gists/go-gists.ini
- XDG override:
$XDG_CONFIG_HOME/go-gists/go-gists.ini
- Windows:
%APPDATA%\go-gists\go-gists.ini
Project structure
go-gists/
βββ main.go # Entry point
βββ cmd/
β βββ root.go # Root command + banner
β βββ auth.go # auth set/show/clear
β βββ create.go # create command
β βββ update.go # update command
β βββ list.go # list command
β βββ delete.go # delete command
β βββ view.go # view command
βββ internal/
β βββ config/
β β βββ config.go # Token resolution & persistence
β βββ display/
β β βββ display.go # Colors, table, prompt helpers
β β βββ term_unix.go # Terminal width (Unix)
β β βββ term_windows.go # Terminal width (Windows stub)
β βββ gist/
β βββ gist.go # GitHub Gist API client
βββ vendor/ # Vendored dependencies
Dependencies
| Package |
Purpose |
github.com/spf13/cobra |
CLI framework |
github.com/google/go-github/v60 |
GitHub API client |
golang.org/x/oauth2 |
GitHub token authentication |
github.com/fatih/color |
Terminal colors |
github.com/jedib0t/go-pretty/v6 |
Rich table rendering |
github.com/atotto/clipboard |
Clipboard copy |
gopkg.in/ini.v1 |
INI config file |
License
MIT Β© Hadi Cahyadi
π€ Author
Hadi Cahyadi


Support me on Patreon