published on

Snippet 0.1.0

GitLab snippets are useful, but hard to use effectivally as often that means that the content supposed to be a snippet needs to be copied from the location to the GitLab.com snippets interface.

This means you’d need a session there and browse to the right page, check the default settings, past the form and submit. I found that at the moment I really wanted to make a snippet this was a hurdle and sometimes just gave up.

To remedy this, I’ve created snippet. A CLI tool that posts whatever is piped into it, as snippet. The output consists of the URL on which the snippet now is reachable. Simple.

$ snippet -h
Usage of snippet:
  -internal
    	Set the visibilty level to internal
  -private
    	Set the visibilty level to private
  -token string
    	Token if not using the ~/.gitlab-token file
  -version
    	Print version and exit

$ cat CHANGELOG.md | snippet
https://gitlab.com/snippets/1688948

The requirement for this to work is that you have an access token which is exposed either as contents of ~/.gitlab-token or passed in with the -token flag.

Installing requires go and is done through go install gitlab.com/zj/snippet!