Tool to help you stash (and rediscover!) those temporary files you just need to
put somewhere for a while... Also gives you per-stash shell history if your
shell respects the $HISTFILE
environment variable, so can be used as a
context-switching aid.
Has a few OSX/macOS-specific features, but the rest should work just fine on Linux.
Clean-room, improved reimplementation of a tool I implemented while working at
$a_previous_employer
.
$ git clone ...
$ cp tt/tt.sh /usr/local/bin/tt
$ tt help
$ tt command [:bucket_id]
Most tasks assume that you want to work on the current bucket if you don't supply a bucket ID.
If you do need to specify a bucket ID, prefix it with a colon, as above.
$ tt new 'some random crap'
What just happened here?
$HOME/tt
was created if it didn't exist already (edit the source to change this; PRs for config files accepted :-])- a SHA256 hash of (title+date+otherdata) was calculated; this is the bucket ID
$TTID
is set to the bucket ID$HOME/tt/$TTID
was created$HISTFILE
is set to a file inside the bucket- a subshell (
$SHELL
) is spawned - (macOS/OSX only) the bucket directory has the comment field set to the bucket title
$ tt home
/your/home/tt/4ced50
$ echo $TTID
4ced50
And if on macOS/OSX, the bucket is discoverable with Spotlight, eg. via commandline:
$ mdfind 'kMDItemFinderComment == foo'
/my_home/tt/4ced50
Exit your shell as per normal when you're done.
$ tt tag :bucket_id foo bar baz
$ tt tags
bar
baz
foo
$ tt ls
DATE ID DONE TITLE
2017-05-11 4ced50 N foo
$ tt shell :4ced50
$ tt done :4ced50
Note the change in the DONE column:
$ tt ls
DATE ID DONE TITLE
2017-05-11 4ced50 Y foo
$ tt keep :4ced50
$ tt finder
$ tt gc
4ced50/.history
4ced50/.tt_date
4ced50/.tt_done
4ced50/.tt_title
4ced50
I added this feature because I make a lot of short-term Go gadgets in buckets when learning/exploring things.
First, set a global Go module prefix for tt
to use:
echo github.com/jsleeio/tt > "$HOME/tt/newgo-prefix"
Now try creating
$ tt newgo widget-unsticker
go: creating new go.mod: module github.com/jsleeio/tt/ff2019/widget-unsticker
I will keep refining this. I'm particularly interested in improving integration with macOS/OSX Finder and Spotlight.
PRs welcomed.
Probably wouldn't be difficult?
Create a subdirectory in a bucket and store tags in there as empty files? Also if running on macOS/OSX, apply matching native file tagging so the tags can be used with Finder/Spotlight.