I am looking to use git-annex as a library/tool to bring syncing to another application. Is there any documentation or open examples of doing something like this?
I think there are two approaches to doing this.
Use the git-annex command line interface from your program. You can use the --json switch to enable machine-parsable output of many git-annex commands. If something needs work to be more suitable to be used as "plumbing" in this way, we can improve it to meet your needs.
Use the git-annex Haskell code as a library for your program. The git-annex assistant is a great example of how far you can take this. It has the benefit that by accessing git-annex's internals, you can sometimes do things more efficiently than by using the CLI. Much of git-annex's code is already well modularized and suitable for use as a library in this way. The build system doesn't currently spit out git-annex libraries, but it would not be hard to make it do so. Of course this would entail writing at least some of your program in Haskell.
I am also interested in using git-annex as a Haskell library, would you accept a patch to the .cabal file then?
There are a couple of problems with using the haskell code as a library that would need to be addressed: