Lykso's Tagging System
I threw most of this together in a single 24 hour period, so it's sloppy. Specifically, there's a lot of code duplication throughout. Pulling that duplicated code out into their own modules would help simplify things and reduce line count.
None of this has been tested yet, but the broad strokes of what I'm trying to achieve here have been captured.
What is it?
It allows adding, removing, and retrieving tags to files and directories as extended attributes using comma-delimited strings. It also allows adding and retrieving long-form notes as extended attributes. Finally, it allows searching for paths by their tags.
lyts tag your,tags,here /some/path
lyts untag your,tags,here /some/path
lyts notes /some/path
lyts show notes /some/path
lyts show tags /some/path
Using the SQLite cache is the fastest way to query for paths:
lyts cache search your,tags,here /some/path/prefix
This cache can be manually updated:
lyts cache scan /some/path/prefix
The cache can monitor a path for changes and update itself:
lyts cache watch /some/path/prefix
The cache must be created before it can be used:
lyts cache create
At the time of writing, attempts to use the cache before creating it result in this tool crashing.
Consider the current version a rough draft.