This repository contains a REPL to query and set UTIs and URL schemes information using the Launch Services API.
If you want to read the article that explains the code here is the link:
https://rderik.com/blog/managing-uti-and-url-schemes-via-launch-services-api-from-swift/