tagctl
2 min read
Tagctl is a command line program which can add or remove tags to files. The tags can either be in the name or under user.xdg.tags in the extended attributes.

Usage
Usage: tagctl [OPTIONS] [FILES]...

OptionDescription
-t, --tag <tag>Tag to add/remove to selected files. %p uses the parent directory name, %y uses the modified year, %m uses modified month, %d uses modified day, and %w uses modified weekday
-d, --delimiter <delimiter>Separator for multiple tags (default: ,)
-i, --inputAccepts input from stdin
-x, --xattrAdds/removes tags via xattr under user.xdg.tags
-r, --removeRemoves tag instead of adding
-R, --remove_allRemoves all tags
-v, --verboseIncreases verbosity of output
-g, --generate_autocomplete <generate_autocomplete>The shell to generate auto-completion for bash, elvish, fish, zsh


Examples
Add tag example to current directory using file names:
shell
tagctl -t example "$(ls)"
ls | tagctl --input --tag example

Remove tag example from current directory using file names:
shell
tagctl -r --tag=example "$(ls)"
ls | tagctl --remove -it example

Add tag example to current directory using extended attributes:
shell
tagctl -xt example "$(ls)"
ls | tagctl --xattr --input --tag example

Remove tag example from current directory using extended attributes:
shell
tagctl -xr --tag=example "$(ls)"
ls | tagctl --xattr --remove -it example

Add tag example to two sets of inputs using file names:
shell
find /home/user/Documents | tagctl -it "example" "$(ls)"