go-gists

command module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README ΒΆ

go-gists

Manage GitHub Gists from the terminal β€” fast, colorful, production-ready.

logo

  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
 β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—     β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•
 β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
 β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β•šβ•β•β•β•β–ˆβ–ˆβ•‘
 β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•     β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
  β•šβ•β•β•β•β•β•  β•šβ•β•β•β•β•β•       β•šβ•β•β•β•β•β• β•šβ•β•β•šβ•β•β•β•β•β•β•   β•šβ•β•   β•šβ•β•β•β•β•β•β•

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

Config file format

[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

Buy Me a Coffee

Donate via Ko-fi

Support me on Patreon

Documentation ΒΆ

Overview ΒΆ

go-gists β€” manage GitHub Gists from the terminal.

Author : Hadi Cahyadi Email : cumulus13@gmail.com Homepage: github.com/cumulus13/go-gists

Directories ΒΆ

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL