Simple Text Archiving and Retrieving in Go
Branch: master
Clone or download
Richard Mavis
Richard Mavis Change the one-line output.
Now, it doesn't use a tab character to separate the value from the tags.
Latest commit 7d5c546 Dec 28, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Change the one-line output. Dec 28, 2018
Makefile Add a feature for listing bare values. Dec 22, 2018
action-code.go Move the default ActionCode. Dec 27, 2018
args.go Move the default ActionCode. Dec 27, 2018
cli-options.md Some general cleanup, mostly whitespace. Dec 26, 2018
compile.rb Fixed a discrepancy between the Makefile and the compile script. Dec 26, 2018
config.go Revise internal handling of Config and ActionCode structs. Dec 26, 2018
create.go Revise internal handling of Config and ActionCode structs. Dec 26, 2018
delete.go Update some documentation. Dec 28, 2018
edit.go Update some documentation. Dec 28, 2018
error.go Revise internal handling of Config and ActionCode structs. Dec 26, 2018
file.go Update some documentation. Dec 28, 2018
go-STAR Add the `-v` flag for dumping values. Dec 22, 2018
help.go Some general cleanup, mostly whitespace. Dec 26, 2018
init.go Revise internal handling of Config and ActionCode structs. Dec 26, 2018
pipes.go Some general cleanup, mostly whitespace. Dec 26, 2018
print.go Change the one-line output. Dec 28, 2018
readme.md Update the readme. Dec 24, 2018
record.go Some general cleanup, mostly whitespace. Dec 26, 2018
search.go Update some documentation. Dec 28, 2018
select.go Revise and simplify the process of updating a store file after editin… Dec 27, 2018
sort.go Revise internal handling of Config and ActionCode structs. Dec 26, 2018
start.go Some general cleanup, mostly whitespace. Dec 26, 2018
todo.org
update.go Update some documentation. Dec 28, 2018

readme.md

STAR: Simple Text Archiving and Retrieving

star is a simple tool for saving and retrieving bits of text. You could use it to save bookmarks, hard-to-remember commands, complex emoticons, stuff like that.

Usage

I use star for all sorts of things.

$ star music listen
1) https://www.youtube.com/watch?v=Aloryfd5ipw
   analord, aphex twin, listen, music, music, afx
2) http://modernarecords.com/releases
   label, listen, music, contemporary classical
3) https://soundcloud.com/terryurban/sets/fka-biggie
   listen, music, terry urban, fka biggie
4) http://prefuse73.bandcamp.com/album/travels-in-constants-vol-25
   music, prefuse 73, temporary residence, travels in constants, listen

$ star book readme
1) http://www.squeakland.org/resources/books/readingList.jsp
   alan kay, books, readme, syllabus
2) http://www.gigamonkeys.com/book/
   Practical Common Lisp, readme, lisp
3) https://tachyonpublications.com/product/central-station/
   books, readme, scifi
4) https://en.wikipedia.org/wiki/The_World_as_Will_and_Representation
   books, philosophy, readme, schopenhauer
5) http://www.goodreads.com/book/show/18877915-the-lonely-astronaut-on-christmas-eve
   blink-182, readme, space

$ star emoticon
1) ¯\_(ツ)_/¯
   emoticon, shrug
2) (╯°□°)╯︵ ┻━┻
   emoticon, fliptable
3) ⊙︿⊙
   bugeye, emoticon
4) (╯︵╰,)
   emoticon, sadcry
5) (* ̄з ̄)
   emoticon, kissing

Never let your friends down again!

$ star unix tar
1) tar -czvf DIR
   unix, tar, zip
2) tar -tzvf DIR.tar.gz
   unix, tar, list
3) tar -xzvf DIR.tar.gz
   unix, tar, unzip

That's the "Retrieving" part of star. Depending on your config (or command line flags) you can then pipe the string on the numbered line(s) to a script and do whatever you'd like with it.

The "Archiving" part is done like this:

$ star -n value tag tag tag

So this:

$ star -n "tar -czvf DIR" unix tar zip

will create a new record in the store file. star stores records in a plain text file, by default at ~/.config/star/store but that's configurable via the config file at ~/.config/star/config.yaml.

You can edit records via a temp file in your $EDITOR:

$ star -e unix tar
1) tar -czvf DIR
   unix, tar, zip
2) tar -tzvf DIR.tar.gz
   unix, tar, list
3) tar -xzvf DIR.tar.gz
   unix, tar, unzip
Edit these records: 1 3

Deleting records is also easy:

$ star -x todo
1) shave
   todo, today
2) shower
   todo, today
3) wash dishes
   todo, today
Delete these records: all

So essentially star saves, interfaces with, and acts on text snippets that it stores in a plain text file.

Installation

This version of star is written in Go. In bin/ there are compiled executables for every combination of [linux darwin windows] and [amd64 386] in the format star_[os]-[arch]. So to install you could just download the executable you need, put it somewhere useful, and create a symlink somewhere in your $PATH:

$ cd wherever/you/keep/programs
$ curl -O https://github.com/rmavis/go-STAR/raw/master/bin/star_[os]-[arch]
$ ln -s [executable] /usr/local/bin/star

Or you can clone the repo and build it yourself. If you have a working Go setup, it's very easy:

$ cd $GOPATH/src/where/ever
$ git clone https://github.com/rmavis/go-STAR.git
$ go get gopkg.in/yaml.v2  # This is star's only dependency.
$ go install

There's also a version written in Ruby, if you're into that. They're similar but I recommend this one---it's faster and has better viewing/output options.