Skip to main content

GistBin

Github Gist client allowing for quick uploads via commandline!

Currently only *nix OSes are supported

Installing

Via pip:

pip3 install gistbin

Manually:

git clone https://github.com/chand1012/gistbin.git
cd gistbin
pip install .

Using

Authentication

Because Gistbin uses the GitHub API, authentication is required. This requires a Github Personal Access Token, instructions of where to find and how to generate can be found here. To authenticate, simply run gistbin --login after installing and enter the prompted information. Here is an example:

octocat@octoserv:~$ gistbin --login
Enter GitHub username: octocat
Enter GitHub access token: ****************
Keyfile saved.
octocat@octoserv:~$ 

The key file is saved at $HOME/.gistbin/auth.json.

Usage

To use, simply pipe the file you want to upload into Gistbin like so:

octocat@octoserv:~$ cat hello_world.rb | gistbin
https://gist.github.com/octocat/6cad326836d38bd3a7ae

By default, the gist that you upload is given a random name and a .txt extension with a blank description. You can edit this later on the gist's webpage, or you can also pass the --name and --desc to add a name and description respectively. You can also use the shortcut parameters, -n and -d.

octocat@octoserv:~$ cat test.cs | gistbin -n "test.cs"
https://gist.github.com/octocat/1305321

If you don't want others to see your gist, and you just want it for your eyes only, you can pass --private or -p.

octocat@octoserv:~$ cat private.txt | gistbin -n "private.txt" -p
https://gist.github.com/octocat/thisissecret

If you want to get the raw url for the uploaded file, such as if you want to then download the file immediately onto another machine, you can pass the -r or --raw argument.

octocat@octoserv:~$ cat git-author-rewrite.sh | gistbin -n "git-author-rewrite.sh" -r
https://gist.githubusercontent.com/octocat/0831f3fbd83ac4d46451/raw/c197afe3e9ea2e4218f9fccbc0f36d2b8fd3c1e3/git-author-rewrite.sh

You can also get the instructions for all of these commands with the help flag:

octocat@octoserv:~$ gistbin -h
usage: gistbin [-h] [-n NAME] [-v] [-d DESC] [--login] [-p] [-r]

A commandline tool for GitHub Gists.

optional arguments:
  -h, --help            show this help message and exit
  -n NAME, --name NAME  Gives your gist a name. Input as a string. Default is
                        random.
  -v, --verbose         Enables verbose output.
  -d DESC, --desc DESC  Gives your gist a description. Input as a string.
  --login               Login to GitHub Gists.
  -p, --private         Sets your Gist to private so only those with the link
                        can see.
  -r, --raw             Makes Gistbin return the raw URL instead of the HTML
                        URL of the file.

Gistbin doesn't just work with cat you can pipe any terminal output (that ends) into it! For example, if you wanted to list all the files in a directory, you could use ls -1 | gistbin -n "filelist.txt". If you wanted to get all the logs from yesterday from the journal, you could run journalctl --since yesterday | gistbin -n "yesterday-today-journal.log". The possibilities are endless!

Roadmap

  • Windows Support.
  • Multi-file uploads.
  • Some more stuff probably.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gistbin-0.2.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gistbin-0.2.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file gistbin-0.2.0.tar.gz.

File metadata

  • Download URL: gistbin-0.2.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for gistbin-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e64b648a6c982f2091be11ce022e6affad1beffc32bd9d67d33e5f7df9309007
MD5 c4aa57790d3a7dae7e9d130c630e843b
BLAKE2b-256 9a422ca85a50897bc8775c4fe6a0349b5ddc531d5b3dcfc892f7432c57228a90

See more details on using hashes here.

File details

Details for the file gistbin-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gistbin-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for gistbin-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cea7ab51e1fa37fcc247be2c7a9adf7515daf127d135af267e847698c984c706
MD5 ec706b2e17819db81226f0f434c3ef25
BLAKE2b-256 3f2193f8c4a442b0c5e3b14ad6ff24d6ce3cd49754c13be4f3e4c14a78925e1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page