I looked into importing this into xfsprogs, and from a quick look it could be simplified a lot by using code from libxfs or maybe even by merging it into xfs_db and using the infrastructure there. But xfsprogs is licensed under GPLv2 and will stay that way as it shares a lot of code with the kernel. Are you willing to relicense the tool under GPLv2 or later?