gst

painless gist creator
git clone git://edryd.org/gst
Log | Files | Refs | LICENSE

README.md (3077B)


      1 # gst \- painless gist creator
      2 
      3 Easy way to create GitHub Gists through the command line. Simply give it the
      4 files to upload and gst will return the URL to the new gist.
      5 
      6 ## Options
      7 
      8 #### -e *ID*
      9 
     10 Edit previously created gist specified with *ID*
     11 
     12 #### -d *DESCRIPTION*
     13 
     14 Set gist description
     15 
     16 #### -D *FILE*
     17 
     18 Delete *FILE* from gist being edited
     19 
     20 #### -f *FILENAME*
     21 
     22 Set file name when reading from `stdin`
     23 
     24 #### -g *URL*
     25 
     26 Change the GitHub API URL (default: https://api.github.com/gists)
     27 
     28 #### -p
     29 
     30 Make gist private
     31 
     32 #### -P
     33 
     34 Make gist public (default)
     35 
     36 #### -u *USER[:PASSWORD]*
     37 
     38 Change the GitHub account the gist will be posted under. A password can
     39 given as well with a separating colon, a prompt is provided if not.
     40 
     41 #### -U
     42 
     43 Post gist anonymously (default)
     44 
     45 #### -h
     46 
     47 Print help and exit
     48 
     49 #### -v
     50 
     51 Print version info and exit
     52 
     53 ## Usage
     54 
     55 Create a new gist of `file.txt`:
     56 
     57 ```
     58 $ gst file.txt
     59 https://gist.github.com/<new-id>
     60 ```
     61 
     62 There is also support for multiple files in a single gist:
     63 
     64 ```
     65 $ gst README.md Makefile prog.c
     66 https://gist.github.com/<new-id>
     67 ```
     68 
     69 Specify the gist's description:
     70 
     71 ```
     72 $ gst -d 'a cool shell script' script.sh
     73 https://gist.github.com/<new-id>
     74 ```
     75 
     76 The gist's URL can be piped to other programs, for example to your clipboard to
     77 be pasted elsewhere:
     78 
     79 ```
     80 $ gst file.txt | xsel -bi
     81 ```
     82 
     83 You can also create a new gist from `stdin`. The file name needs to be supplied
     84 however:
     85 
     86 ```
     87 $ cmd-which-errors | gst -f log.txt
     88 https://gist.github.com/<new-id>
     89 ```
     90 
     91 The new gist can be posted under a GitHub user, a prompt will ask for your
     92 password:
     93 
     94 ```
     95 $ gst -u your-name good-proj.rs
     96 GitHub password:
     97 https://gist.github.com/<new-id>
     98 ```
     99 
    100 To skip the prompt your password can be supplied after a colon with the
    101 username:
    102 
    103 ```
    104 $ gst -u your-name:password plugin/func.vim doc/func.txt
    105 https://gist.github.com/<new-id>
    106 ```
    107 
    108 New gists can be private when created under a user:
    109 
    110 ```
    111 $ gst -p -u name personal.info
    112 https://gist.github.com/<new-id>
    113 ```
    114 
    115 You can also edit a previously created gist under your account, such as adding
    116 a new file or updating the description:
    117 
    118 ```
    119 $ gst -e <id> -u name -d "new description" additional-file.txt
    120 https://gist.github.com/<id>
    121 ```
    122 
    123 It is even possible to delete files, although it should be noted the gist still
    124 exists even if you delete all the files within it due to the limitations of the
    125 API:
    126 
    127 ```
    128 $ gst -e <id> -u name -D old.py
    129 https://gist.github.com/<id>
    130 ```
    131 
    132 ## Installation
    133 
    134 The only dependency needed to build gst is cURL. gst be compiled with a simple
    135 `make` and `sudo make install` will install the executable and man page.
    136 
    137 ## Customization
    138 
    139 gst can be customized by editing the custom `config.h` and (re)compiling the
    140 source code. This keeps it fast, secure and simple. All customization can be
    141 done through the command line interface however, so basic aliases could also be
    142 utilized to change default options.
    143 
    144 ## Author
    145 
    146 Ed van Bruggen <ed@edryd.org>
    147 
    148 ## See Also
    149 
    150 See project page at <https://edryd.org/projects/gst.html>
    151 
    152 View source code at <https://git.edryd.org/gst>
    153 
    154 ## License
    155 
    156 zlib License