Finder tags reside in metadata, specifically, extended attributes (xattr's).
The 'xattr' command is usable from a Terminal window, or a scripted shell command, such as in a Run Shell Script action in Automator.
You can read a summary of xattr's builtin help by pasting this into a Terminal window:
xattr -h
The man page can be read with: man xattr
The 'ls' command is capable of listing all the xattr's on a file or dir. It uses the -l@
options. It has more options, such as the one for a recursive listing.
I suspect you'd need to capture the output in a file (redirect stdout), do that for both directories of interest, then diff them.
One possible obstacle to this is that xattr can only output the contents of the xattr's in hex, so deciphering that in a sensible way could be formidable.
EDIT
I just remembered that the 'rsync' command can copy xattr's, which suggests it can also identify files that have different xattrs. The -n
option tells rsync to do a dry run. You'll probably need to read its man page to figure out the full set of options that tell it to do the right kind of dry run, with xattr's, comparing files & dirs.