/gifc

Github Gists from command line

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Gists From Command-line

made-with-python PyPI - Python Version contributions welcome Maintenance License: GPL v3

Welcome to the README of gifc.

NAME

gi-f-c : Gists from command-line

ABOUT

This is a nifty little tool written in Python to work with GitHub Gists from command line.

Dependencies

USAGE

  1. chmod +x gifc
  2. Make a gist_config.yml file and enter your secure token and user_id as -

TOKEN: xxxxx
USER_ID: yyyyy

  1. Use it from cli as ./gifc <options> <flags>
  2. Or add it to PATH to call it as gifc <options> <flags>

NOTE
Currently there is no way it can access your gist_config.yml file if you take the script inside bin. This feature will be added later on. So right now use it like Step 2

MANUAL

./gifc -h

Example usage

Get a list of gists

./gifc get 5

Create a gist

  • Create interactively from an editor like nano, vim or gedit
    • ./gifc create create.md -d "How to create a gist from cli" -i nano
  • Directly enter contents from cli
    • ./gifc create create.md -d "How to create a gist from cli" -m '''If you want to create a gist from an existing file then you do the following- `./gifc -c create.md -e "How to create a gist from cli" -i file.md`'''
  • Take the contents from a file
    • ./gifc create create.md -d "How to create a gist from cli" -f file.md

Update a gist

  • Change description

    • ./gifc update ffd2f4a482684f56bf33c8726cc6ae63 -cd "New description"
      You can get the gist id from the get method from earlier
  • Edit contents of a file interactively in an editor like nano, vim or gedit

    • ./gifc update ffd2f4a482684f56bf33c8726cc6ae63 -f file_to_update.md
  • Do both

    • ./gifc -u ffd2f4a482684f56bf33c8726cc6ae63 -f file_to_update.md -cd "New description"

Delete file(s) from a gist

./gifc remove ffd2f4a482684f56bf33c8726cc6ae63 -r file1.md script.py readme.txt
You can get the gist id from the get method from earlier

Delete the whole gist

./gifc delete ffd2f4a482684f56bf33c8726cc6ae63
You can get the gist id from the get method from earlier