tago is a command line utility to tag and index files. The idea is to be able to search your indexed files and also organize your files around tags.
Version: 0.1.0
Project Links: Issues - Mailing List - Contributing
Author: Peter Sanchez (https://petersanchez.com)
hg clone https://hg.code.netlandish.com/~petersanchez/tagocd tagomake alltago binary to wherever you want.The commands are pretty easy and the help for each sub-command will explain how to use them.
$ tago
Tag and index your system files.
Usage:
tago [command]
Available Commands:
clear Clear tag assignments for files and tags
db Database operation commands
delete Delete files or tags from the database.
files List files for the given tag(s).
help Help about any command
merge Merge old-tag into new-tag; old-tag will be deleted.
search Search files for the given term(s).
stats List all tags used in the database.
tag Tag a file
tags List all tags belonging to a file
Flags:
-d, --database string Path to SQLite3 database file. (default "~/.config/tago/tago.db")
-f, --fullpath Use full path for all files (disabled relative path display)
-h, --help help for tago
-v, --version version for tago
Use "tago [command] --help" for more information about a command.
The first thing you need to do is initialize your database:
tago db init
This will create your sqlite database. By default it will go to
~/.config/tago/tago.db but you can specify the --database flag to specify a
different location.
Once initialized you can begin tagging files.
Here's some simple examples:
tago tag file.doc tag1 tag2 "longer tag with spaces" tag4tago tag --index file.doc tag1 tag2tago tag --index --desc="Some description of file" file.doc tag1 tag2tago tag --tags='tag1 tag2 "tag with spaces" tag4' file1.doc file2.doc file3.doctago files tag1 tag2tago search 'some terms here'tago search --ctype=text --tags="backup" 'content search terms here'You can specify content type for the files and search command. There are
also a few shortcuts you can use:
tago files --ctype=pdf tag1tago files --ctype="application/pdf" tag1The following content type shortcuts are provided:
Mainly this is a tool that I wish I had and has been in the back of my mind for some time. Also I started learning Go and wanted a project to help me learn the language.
There are many different use cases but here are a few examples of what I currently, or plan to, use it for.
Currently all functionality works as expected however there may be some UI
changes coming. Mainly around the search and files command. Not sure it
makes sense to keep them separate but in the event I do change something there
I will keep current commands working until at least a legit version 1 release.
The goal is to index contents and metadata for an array of files so that it's searchable to easily find files based on a file type + query + tags.
These are the file types I want to index:
* MS Word and LibreOffice Writer docs are currently supported.
You can see the full list of tasks on the issue tracker.
I'm aware there are other similar applications out there but I couldn't find any that completely scratched my itch. Especially written in Go. However, there is one notable application that is pretty awesome, and that's TMSU.
We accept patches submitted via hg email which is the patchbomb extension
included with Mercurial.
The mailing list where you submit your patches is
~petersanchez/public-inbox@lists.code.netlandish.com. You can also view the
archives on the web here:
https://lists.code.netlandish.com/~petersanchez/public-inbox
To quickly setup your clone of tago to submit to the mailing
list just edit your .hg/hgrc file and add the following:
[email]
to = ~petersanchez/public-inbox@lists.code.netlandish.com
[patchbomb]
flagtemplate = {separate(' ', 'tago', flags)}
[diff]
git = 1
We have more information on the topic here:
All documentation, libraries, and sample code are Copyright 2020 Peter Sanchez <pjs@petersanchez.com>. The library and sample code are made available to you under the terms of the BSD license which is contained in the included file, LICENSE.