{"id":37200179,"url":"https://github.com/danielecook/gg","last_synced_at":"2026-01-14T23:02:09.453Z","repository":{"id":55582081,"uuid":"221760953","full_name":"danielecook/gg","owner":"danielecook","description":"Github Gists from the command line. On MAC OSX, it (will be) an Alfred Workflow!","archived":false,"fork":false,"pushed_at":"2020-12-20T19:06:01.000Z","size":810,"stargazers_count":12,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T12:35:39.488Z","etag":null,"topics":["gists","github","snippet-manager","snippets"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielecook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-14T18:23:08.000Z","updated_at":"2024-01-14T00:00:36.000Z","dependencies_parsed_at":"2022-08-15T03:40:11.720Z","dependency_job_id":null,"html_url":"https://github.com/danielecook/gg","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/danielecook/gg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielecook%2Fgg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielecook%2Fgg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielecook%2Fgg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielecook%2Fgg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielecook","download_url":"https://codeload.github.com/danielecook/gg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielecook%2Fgg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28437916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gists","github","snippet-manager","snippets"],"created_at":"2026-01-14T23:02:07.936Z","updated_at":"2026-01-14T23:02:09.317Z","avatar_url":"https://github.com/danielecook.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gg\n\nA CLI for your [Gists](gist.github.com). It syncs your gists locally, making them searchable and quickly accessible.\n\n# Installation\n\nDownload the [latest release](https://github.com/danielecook/gg/releases/latest) for your system.\n\n```shell\n# Move the binary to a location on your $PATH and rename to gg\nmv gg_linux /usr/local/bin/gg\nchmod +x /usr/local/bin/gg_linux\n# gg should now work\ngg\n```\n\n# Features\n\n* Syntax highlighting in terminal\n* Create, edit, and delete gists from the command line\n* Edit gists in a text editor (e.g. sublime)\n* Organize gists using tags (`#hashtag` syntax)\n* Full text search\n* Filter and sort by tag, language, owner, public/private, starred, search term\n* `gg` includes starred gists by other users\n* Summarize gists by tag, language, or owner\n\n\u003c!--# Demo--\u003e\n# Usage\n\n## Getting Started\n\n1. [Create a new authentication token](https://github.com/settings/tokens). Under permissions select 'gist'\n2. Run `gg sync --token \u003cauthentication_token\u003e`.\n\n## Query Gists\n\n`gg ls` can be used to search and filter your gist library. Results are output in a table. For convenience, the `ls` command is run implicitly when `gg` is invoked as long as the term being passed is not also a command.\n\nFor example:\n\n```bash\ngg # Lists recent gists\ngg ls # equivelent to above\n\ngg genomics # Searches gists for the term 'genomics'\ngg ls genomics # equivelent to above\n\ngg -l 100 # lists last 100 gists.\ngg ls -l 100 # lists the last 100 gists\n\ngg help # shows help\ngg sync # syncs gists\n```\n\nThe `gg` command list is:\n\n* `#` - any integer number.\n* `help`, `h`, `--help`, `-h`\n* `sync`\n* `set-editor` \n* `logout`\n* `new`\n* `edit`\n* `web`, `w`\n* `open`, `o`\n* `rm`\n* `ls`, `list`\n* `search`\n* `starred`\n* `tag`, `tags`\n* `language`, `languages`\n* `owner`\n* `__run_alfred`, `debug`\n\nYou can still search on these terms by using `ls` explicitly:\n\n```shell\ngg sync # runs the sync command\ngg ls sync # searches for the term 'sync'\n```\n\n![Gist List](https://github.com/danielecook/gg/blob/media/gist_list.png?raw=true)\n\n## Retrieve Gists\n\n```bash\ngg open 5 # Outputs a single gist\ngg o 5 # 'o' is a shortcut for open.\n\n# To be even quicker, gg will open a gist when the first argument is an integer.\ngg 5 # equivelent to `gg o 5` or `gg open 5`\n\n# Output multiple gists\ngg 5 8 22\n\n# You can pipe the contents to be evaluated; They will not be syntax-highlighted\ngg 5 | sh\n```\n\n![Gist Retrieval](https://github.com/danielecook/gg/blob/media/syntax.png?raw=true)\n\n## Summarize gists\n\nGists can be summarized by tag, owner, and language.\n\n```bash\ngg tags # Summarize by tag\ngg tags fastq # Query gists tagged with 'fastq'\ngg tags fastq elegans # Query gists tagged with 'fastq' and containing the word 'elegans'\ngg owner # List owners and count\ngg language # Table languages and count\n```\n\n![summary output](https://github.com/danielecook/gg/blob/media/summary.png?raw=true)\n\n## Creating new gists\n\n#### Files\n\nThe following will create a new gist that includes both `analysis.R` and `setup.sh`\n\n```bash\ngg new --description \"analysis scripts\" analysis.R setup.sh \n```\n\n#### stdin\n\nYou can also pipe input into `gg` to create a new gist, and set gists to `--private`\n\n```bash\ncat analysis_results.tsv | gg new --description \"experiment results\" --private\n```\n\n#### Clipboard\n\nYou can create a new gist from your clipboard\n\n```bash\ngg new --clipboard --description \"A new gist\" --filename \"analysis.sh\"\n```\n\n## Edit Gists\n\nUse `gg edit` to edit gists.\n\n```bash\ngg edit 12 # Open gist in text file for editing.\n```\n\nEditing a gist opens a text document with the following header:\n\n```\n# GIST FORM: Edit Metadata below\n# ==============================\n# description: tmux shortcuts \u0026 cheatsheet\n# starred: T\n# public: T\n# ==============================\n```\n\nYou can modify the description, starred (T=true; F=false), and public (T=true; F=false) in this header.\n\nFollowing the header you will see a special separator line that looks like this:\n\n```\nmyscript.sh----------------------------------------------------------------------------::\u003e\u003e\u003e\n```\n\nBecause gists can have multiple files, they are represented in a single file by breaking them up using a  specialized line. The line **must** begin with the filename, followed by dashes `---`, and finally end with `::\u003e\u003e\u003e`. A gist with two files looks like this:\n\n```markdown\n# GIST FORM: Edit Metadata below\n# ==============================\n# description: analysis.R\n# starred: T\n# public: T\n# ==============================\nREADME.md-----------------------------------------------------------------------------::\u003e\u003e\u003e\nI used R to analyze my data!\n\nCheck out analysis.R to see how I did it.\nanalysis.R----------------------------------------------------------------------------::\u003e\u003e\u003e\n# My R script\nprint(1 + 1)\n```\n\nSupported editors:\n\n* Sublime Text (`subl`)\n* Nano\n\n## Remove Gists\n\nUse `gg rm` to delete gists.\n\n```bash\ngg rm 12\ngg rm 12 134 47 # Remove multiple gists\n```\n\n# Contributing\n\nFeel free to open a PR or suggest changes! Relatively new to Go, so technique suggestions are especially welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielecook%2Fgg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielecook%2Fgg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielecook%2Fgg/lists"}