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.
Author: Peter Sanchez (https://petersanchez.com)
hg clone https://hg.code.netlandish.com/~petersanchez/tago
tagobinary 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 "~/.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
~/.tago/tago.db but you can specify the
--database flag to specify a
Once initialized you can begin tagging files.
Here's some simple examples:
tago tag file.doc tag1 tag2 "longer tag with spaces" tag4
tago tag --index file.doc tag1 tag2
tago tag --index --desc="Some description of file" file.doc tag1 tag2
tago tag --tags='tag1 tag2 "tag with spaces" tag4' file1.doc file2.doc file3.doc
tago files tag1 tag2
tago search 'some terms here'
tago search --ctype=text --tags="backup" 'content search terms here'
You can specify content type for the
search command. There are
also a few shortcuts you can use:
tago files --ctype=pdf tag1
tago files --ctype="application/pdf" tag1
The 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
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
included with Mercurial.
The mailing list where you submit your patches is
~email@example.com. You can also view the
archives on the web here:
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 = ~firstname.lastname@example.org [patchbomb] flagtemplate = "tago" [diff] git = 1
We have more information on the topic here:
All documentation, libraries, and sample code are Copyright 2020 Peter Sanchez <email@example.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.