8 releases
0.3.2 | Jun 22, 2021 |
---|---|
0.3.1 | Jun 22, 2021 |
0.2.1 | May 30, 2021 |
0.1.2 | May 27, 2021 |
#51 in #snippets
14KB
275 lines
Text snippets on the command line. Quickly create topics and store snippets for easy recall and reuse.
Installation
> cargo install snip
Example
> snip put rust
// rust topic created
> snip rust docs https://docs.rs/
< Entry inserted in to rust
> snip put rust main https://www.rust-lang.org/
< Entry inserted in to rust
> snip show rust
< main: https://www.rust-lang.org/
< docs: https://docs.rs/
> snip show rust docs
< https://docs.rs/
> snip get rust docs
// docs value copied to your clipboard use with ctrl-v
Commands
Create
Create a topic
> snip put <topic_name>
Create a topic snippet
> snip put <topic_name> <snippet_key> <snippet_value>
Get
Get a specific snippet from a topic (copied in to your clipboard)
> snip get <topic_name> <snippet_key>
Open
Open a specific snippet from a topic in the default browser
> snip open <topic_name> <snippet_key>
Note: This will only work for snippets that are shaped like a URL If this is run on a non-URL shaped snippet the program with panic and exit
Echo
Print all snippets for all topics
> snip echo all
Print all snippets for a specific topic
> snip echo <topic_name>
Print a specific snippet from a specific topic
> snip echo <topic_name> <snippet_key>
Delete
Delete a topic and all its snippets
> snip del <topic_name>
Delete a specific snippet from a topic
> snip del <topic_name> <snippet_key>
Nuke all the topics and their contents (delete everything)
> snip nuke
Export
Export your .snip file (create .zip at location for transport)
> snip export <path e.g. ~/Desktop>
Note:
This would create a snip.zip file on your Desktop that you can later import
Dependencies
~7–20MB
~269K SLoC