Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

tss, a tool to manage files with filename tags



Hi all. I thought I should present what I've been working on for the past weeks.

This is my first time developing anything half-serious in zsh. I'd love some thoughts on it or even a code review if anybody feels like it.

I took this project as an exercise and aimed to write as clean and robust code as I could, offer decent completion (though I admit I only understand the most simple features of the system), and have automated testing for the core features.

The code: https://github.com/nahoj/tss
git clone https://github.com/nahoj/tss.git

## What it does

tss is a tool to tag and find files with tags à la TagSpaces (a graphical tool), i.e., tags in file names such as "IMG-2653[vacation alps].jpg".

As you can guess, one can perfectly manage such files without any specialized tool, which was part of the appeal of this tagging system to me. But after a couple of years of tagging my files half in TagSpaces, half by hand, I thought a dedicated CLI tool would be handy after all.

$ ls
IMG-2653.jpg
$ tss add 'vacation alps' IMG-2653.jpg
$ tss files -t 'alps' *
IMG-2653[vacation alps].jpg
$ cp "IMG-2653[vacation alps].jpg" "IMG-2653_copy[vacation alps copy].jpg"
$ tss files -t 'alps' -T 'copy' *  # or --tags 'alps' --not-tags 'copy'
IMG-2653[vacation alps].jpg

### Glob patterns

$ tss remove 'v* a*' "IMG-2653_copy[vacation alps copy].jpg"
$ find | tss filter -t '(alps|pyrenees)'
./IMG-2653[vacation alps].jpg

### Completion

$ tss query -t tag1 <tab>           # Files with tag1
$ tss query -t tag1 path/ -t <tab> # Tags found on files that have tag1 in path/
$ tss add tag1 <tab>                # Files that don't have tag1

Best,

--
Johan




Messages sorted by: Reverse Date, Date, Thread, Author