Package: getgist
GetGistEasily download any file from aGitHub Gist, withone single command.Why?Because of reasons I do not have adotfilesrepository. I prefer to store myinit.vim,.gitconfig,.bashrcetc. asGists.I wrote this CLI so I could update mydotfileswith one single command:getmy vim.init, for example — and it's done.Install$pipinstallgetgistGetGistworks with Python 3.6+.Toupdateit just run$ pip install --upgrade getgist.UsageGetting Gists from GitHubJust rungetgist <username> <filename>. For example:$getgistcuducos.vimrcFetching https://api.github.com/users/cuducos/gistsReading https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/666d7d01a0058e4fd898ff752db66160f10a60bb/.vimrcSaving .vimrcDone!GetGistasks 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,.bkp2etc.Updating Gists at GitHubJust runputgist <username> <filename>to update the remote Gist with the contents of the local file. It requires an OAuth token (seeUsing OAuth authenticationbelow). For example:$putgistcuducos.vimrcUser cuducos authenticatedFetching https://api.github.com/gistsSending contents of .vimrc to https://api.github.com/gists/409fac6ac23bf515f495Done!The URL to this Gist is: https://gist.github.com/cuducos/409fac6ac23bf515f495GetGistasks you what to do when it finds the different files with the same name in different Gists.Listing Gist files from GitHubJust runlsgists <username>. For example:$lsgistscuducosGist           File               URL-------------  ------------------ -------------------------First Gist     file.md            https://gist.github.com/…My Gist #2     another_file.md    https://gist.github.com/…My Gist #2     README.md          https://gist.github.com/…Secret Gists (when user is authenticated) are listed with[Secret Gist]tag next to their names.Using OAuth authenticationWhy?Add yourpersonal access tokenas as environment variable to allow:downloading private gistsupdating existing gistslisting private gistsHow?Get a personal access token with permission to manage your gists fromGitHub settingsSet an environment variable calledGETGIST_TOKENwith your personal access tokenThisarticlemight 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.Example$exportGETGIST_TOKEN=whatever1234$getgistcuducos.vimrcUser cuducos authenticatedFetching https://api.github.com/gistsReading https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/666d7d01a0058e4fd898ff752db66160f10a60bb/.vimrcSaving .vimrcDone!The URL to this Gist is: https://gist.github.com/cuducos/409fac6ac23bf515f495This will work even if the file you are trying to download is a private gist (surely the user name has to match theGETGIST_TOKENaccount).Setting a default userWhy?Set a default user to avoid typing your GitHub user name all the time.How?Set an environment variable calledGETGIST_USERwith your GitHub user nameUse the shortcutgetmy <filename>,putmy <filename>ormygistsExample$exportGETGIST_USER=cuducos$getmy.vimrcFetching https://api.github.com/users/cuducos/gistsReading https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/666d7d01a0058e4fd898ff752db66160f10a60bb/.vimrcSaving .vimrcDone!The URL to this Gist is: https://gist.github.com/cuducos/409fac6ac23bf515f495ContributingWe usePoetryto manage our development environment:poetry installwill get you a virtualenv with all the dependencies for youpoetry shellwill activate this virtualenvexitdeactivates this virtualenvFeel free toreport an issue,open a pull request, ordrop a line.Don't forget to format your code withBlack, and to write and run tests:$tox