I wrote an Automator script to analyze PDFs for the company Support staff. The script calls /usr/bin/swift for execution. It requires importing Foundation and PDFKit.
I shutter to force them to install Xcode as it consumes so much file space.
Is it possible to just linstall Swift (and I’ve seen links saying this is possible) and then to install PDFKit?
You may be able to do what you want by installing the Command Line Tools package from Apple. PDFKit itself is a framework included with the system, so I think your tools should be able to use automatically, though I've never tried.
You don't have to get it into the App Store, you are allowed to distribute apps outside of the App Store. Developer ID signing is a next-next-finish process, nothing complicated.
It's harder to compromise an app than a script or a cli tool. With proper MDM setup, non-developers probably wouldn't even be able to run a random script without any signature.