A simple cli snippet manager
snipster is a command line snippet manager allowing you to view, edit, create and copy snippets from your command line. It follows the Unix philosophy of "do one thing and do it well".
Installation | Setup | Usage | Troubleshooting Credits
snipster is available on PyPI. This is the easiest way to install it. All dependencies will be installed automatically.
pip3 install snipster-py
When you first start up snipster, you should run
snipster source
This will create a .snipster
directory in your home folder (if it does not already exist) and create an empty snippet list.
snipster source
snipster list
snipster list [-t <tag>... | -l <language>... | -k <keyword>... ]...
snipster (-c|-e|-o) [-f] <snippet-id>
snipster -h | --help
snipster -v | --version
You can filter by tag (-t
), keyword in the title (-k
) and language (-l
). If the filters result in only one match, the match will be displayed directly (instead of a list with only one entry).
When you create a snippet, an empty file will be created in ~/.snipster
and opened in your $EDITOR
. For this snippet to be read as valid, it needs to have yaml frontmatter and the actual snippet code needs to be marked as such. You do not need to have any attributes in the front matter but they are heavily encouraged. Valid attributes are tags
, lang
, title
.
An id is not necessary. It will be automatically assigned by snipster when you source again.
In order for (changes to) a snippet to be recognized you need to snipster source
after saving.
Bug reports and feature requests are very much appreciated. Please contact me on Twitter (@SolviAu) or open an issue here.
This project was heavily inspired by cheat, a command line cheat sheet viewer/creator
sophieau.github.io β Twitter @SolviAu β Β© 2018, MIT Licence