Gistr - View, save and pull files from Github's Gists.
npm install gistrindex.css or something else saved, which you always include for your projects, but it is a hassle to find and fetch all those various files, as they have probably been scattered among various different projects and gists.
npm install -g gistr
gist add ... [<-b (1 gist, n files)>] [<-d="" (Gist description)>] [<-v (Verbose logging)>]
gist add myfile1.txt myfile2.txt --bundle -d="Gist description" -v
gist add-dir [<-d="" (Gist description)>] [<-v (Verbose logging)>]
gist add-dir "path/to/folder"
gist add-dir folder -d="Folder full of files"
gist list
gist find
gist find gulpfile
gist find "math library"
gist show
Gist #'s can be found by calling gist list.
gist show 5
gist show 4 --tofile (Creates a file named gist-.txt to the cwd)
gist pull <[-v (Verbose logging)]>
gist pull 3 (Pulls the gist and writes the files into cwd)
gist pull 2 -d="somefolder" (Pulls the gist and writes the files into cwd/somefolder/)
gist export-db [<-f (Export to file)>] <[-v (Verbose logging)]>
access-token has to be set, as the database file could contain your Github access-token. Having the access-token being set as a requirement guarantees that the gist is made under your Github profile as a secret gist.
gist export-db (Locates the database-file and gists it)
gist export-db -f
gist import-db <--file="path/to/db-export.gs"> <[-v (Verbose logging)]>
gist import-db <--id="yourdbexportgistid"> <[-v (Verbose logging)]>
gist import-db -f (Assumes a file named gistr-db-export.gs exists in the cwd)
gist import-db --id="somegistid"
gist import-db -f="path/to/some/db.file"
gist purge-db
General
gistr = gstr = gist
gist -h = gist --help = gist help
gist -v = gist --version = gist version
gist add = gist create = gist creategist
gist add-dir = gist add-folder = gist add-directory
gist list = gist gists
gist find = gist search
gist show = gist details
gist pull = gist get
gist add-token = gist save-token = gist set-token
gist remove-token = gist delete-token = gist unset-token
gist show-token = gist display-token = gist view-token
gist import-db = gist get-db
gist purge-db = gist remove-db = gist delete-db
When creating gists:
Bundle multiple files into a single gist
-b = --bundle
Gist description
-d="" = --desc="" = --description=""
Verbose logging
-v = --verbose
When showing gist details:
Output gist details to file (defaults to terminal output)
--tofile
When pulling gists:
To output pulled gists to some other directory than the current working directory
-d="" = --dir="" = --directory=""
When exporting database:
-f="" = --tofile=""
When importing database:
-f="" = --file=""
`
Authentication
Optionally, or if 60 anonymous gists per hour is not enough for you, you can use an access-token based authentication with gistr.
Simply generate a new access-token for your github account by following the instructions here: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
And use command gist add-token --token="yourtokenhere" to let gistr use it for gisting.
The only permission or scope you need to grant for the access-token is the gist` one, obviously.