{"id":13682880,"url":"https://github.com/cuducos/getgist","last_synced_at":"2025-04-28T10:27:09.741Z","repository":{"id":27321001,"uuid":"30795372","full_name":"cuducos/getgist","owner":"cuducos","description":"🖥️ Easily download any file from a GitHub Gist, with one single command.","archived":false,"fork":false,"pushed_at":"2022-03-09T13:48:38.000Z","size":213,"stargazers_count":111,"open_issues_count":4,"forks_count":13,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-28T10:26:56.157Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/GetGist/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuducos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["cuducos"]}},"created_at":"2015-02-14T11:58:55.000Z","updated_at":"2025-01-28T17:44:28.000Z","dependencies_parsed_at":"2022-08-27T22:31:38.886Z","dependency_job_id":null,"html_url":"https://github.com/cuducos/getgist","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuducos%2Fgetgist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuducos%2Fgetgist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuducos%2Fgetgist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuducos%2Fgetgist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuducos","download_url":"https://codeload.github.com/cuducos/getgist/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251293961,"owners_count":21566177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hacktoberfest"],"created_at":"2024-08-02T13:01:54.844Z","updated_at":"2025-04-28T10:27:09.708Z","avatar_url":"https://github.com/cuducos.png","language":"Python","funding_links":["https://github.com/sponsors/cuducos"],"categories":["Python"],"sub_categories":[],"readme":"[![Travis CI](https://img.shields.io/travis/cuducos/getgist.svg?style=flat)](https://travis-ci.org/cuducos/getgist) [![Coveralls](https://img.shields.io/coveralls/cuducos/getgist.svg?style=flat)](https://coveralls.io/github/cuducos/getgist) [![PyPI Version](https://img.shields.io/pypi/v/getgist.svg?style=flat)](https://pypi.python.org/pypi/getgist) [![Python Version](https://img.shields.io/pypi/pyversions/getgist.svg?style=flat)](https://pypi.python.org/pypi/getgist)\n\n# GetGist\n\nEasily download any file from a [GitHub Gist](http://gist.github.com), with _one single command_.\n\n## Why?\n\nBecause of reasons I do not have a *dotfiles* repository. I prefer to store my `init.vim`, `.gitconfig`, `.bashrc` etc. as [Gists](http://gist.github.com/).\n\nI wrote this CLI so I could update my *dotfiles* with one single command: `getmy vim.init`, for example — and it's done.\n\n## Install\n\n```console\n$ pip install getgist\n```\n\n_GetGist_ works with Python 3.6+.\n\nTo **update** it just run `$ pip install --upgrade getgist`.\n\n## Usage\n\n### Getting Gists from GitHub\n\nJust run `getgist \u003cusername\u003e \u003cfilename\u003e`. For example:\n\n```console\n$ getgist cuducos .vimrc\n  Fetching https://api.github.com/users/cuducos/gists\n  Reading https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/666d7d01a0058e4fd898ff752db66160f10a60bb/.vimrc\n  Saving .vimrc\n  Done!\n```\n\n_GetGist_ asks you what to do when a local file (with the same name) exists. If you decide not to delete your local copy of the file, it will be renamed with extensions such as `.bkp`, `.bkp1`, `.bkp2` etc.\n\n### Updating Gists at GitHub\n\nJust run `putgist \u003cusername\u003e \u003cfilename\u003e` to update the remote Gist with the contents of the local file. It requires an OAuth token (see [Using OAuth authentication](#using-oauth-authentication) below). For example:\n\n```console\n$ putgist cuducos .vimrc\n  User cuducos authenticated\n  Fetching https://api.github.com/gists\n  Sending contents of .vimrc to https://api.github.com/gists/409fac6ac23bf515f495\n  Done!\n  The URL to this Gist is: https://gist.github.com/cuducos/409fac6ac23bf515f495\n```\n\n_GetGist_ asks you what to do when it finds the different files with the same name in different Gists.\n\n### Listing Gist files from GitHub\n\nJust run `lsgists \u003cusername\u003e`. For example:\n\n```console\n$ lsgists cuducos\n  Gist           File               URL\n  -------------  ------------------ -------------------------\n  First Gist     file.md            https://gist.github.com/…\n  My Gist #2     another_file.md    https://gist.github.com/…\n  My Gist #2     README.md          https://gist.github.com/…\n```\n\nSecret Gists (when user is authenticated) are listed with `[Secret Gist]` tag next to their names.\n\n## Using OAuth authentication\n\n### Why?\n\nAdd your [personal access token](https://github.com/settings/tokens) as as environment variable to allow:\n\n1. downloading private gists\n2. updating existing gists\n3. listing private gists\n\n### How?\n\n1. Get a personal access token with permission to manage your gists from [GitHub settings](https://github.com/settings/tokens)\n2. Set an environment variable called `GETGIST_TOKEN` with your personal access token\n\nThis [article](https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-set-environment-variables-in-linux/) might help you create an environment variable in a Unix-based operational system with Bash, but feel free to search alternatives for other systems and shells.\n\n### Example\n\n```console\n$ export GETGIST_TOKEN=whatever1234\n$ getgist cuducos .vimrc\n  User cuducos authenticated\n  Fetching https://api.github.com/gists\n  Reading https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/666d7d01a0058e4fd898ff752db66160f10a60bb/.vimrc\n  Saving .vimrc\n  Done!\n  The URL to this Gist is: https://gist.github.com/cuducos/409fac6ac23bf515f495\n```\n\nThis will work even if the file you are trying to download is a private gist (surely the user name has to match the `GETGIST_TOKEN` account).\n\n## Setting a default user\n\n### Why?\n\nSet a default user to avoid typing your GitHub user name all the time.\n\n### How?\n\n1. Set an environment variable called `GETGIST_USER` with your GitHub user name\n2. Use the shortcut `getmy \u003cfilename\u003e`, `putmy \u003cfilename\u003e` or `mygists`\n\n### Example\n\n```console\n$ export GETGIST_USER=cuducos\n$ getmy .vimrc\n  Fetching https://api.github.com/users/cuducos/gists\n  Reading https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/666d7d01a0058e4fd898ff752db66160f10a60bb/.vimrc\n  Saving .vimrc\n  Done!\n  The URL to this Gist is: https://gist.github.com/cuducos/409fac6ac23bf515f495\n```\n\n## Contributing\n\nWe use [Poetry](https://python-poetry.org) to manage our development environment:\n\n1. `poetry install` will get you a virtualenv with all the dependencies for you\n1. `poetry shell` will activate this virtualenv\n1. `exit` deactivates this virtualenv\n\nFeel free to [report an issue](http://github.com/cuducos/getgist/issues), [open a pull request](http://github.com/cuducos/getgist/pulls), or [drop a line](http://twitter.com/cuducos).\n\nDon't forget to format your code with [Black](https://github.com/ambv/black), and to write and run tests:\n\n```console\n$ tox\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuducos%2Fgetgist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuducos%2Fgetgist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuducos%2Fgetgist/lists"}