March 03, 2021
Illustration by my buddy Loor Nicolas
You are saving Github Gists often but you spend too much time on their UI.
Let’s do it from our CLI!
sudo apt install gist
gist
and user:email
permissions:Set a name for your token like gist.
Check gist and user:email permissions.
~/.gist
. The umask
ensures that the file is only accessible from your user account:(umask 0077 && echo MY_SECRET_TOKEN > ~/.gist)
cat ~/.gist
Note that in Ubuntu/Debian the
gist
command is renamed togist-paste
to avoid conflicts, if you are using a different system like MacOS just replacegist-paste
forgist
in the next snippet.
echo "hello gist" >> gist.txt
gist-paste gist.txt
# Returns URL of newly created gist https://gist.github.com/eb36806673aca3c63686078d584e2a2e
Written by Jon Portella.