Tooling for Julia command-line scripts

IonCLI is the real world experimental example for building CLI applications (and I think there are a few other CLIs made by others on GitHub too), but it’s currently a bit out of date due to recent changes in Comonicon and I haven’t got time to update it. But this repo should give you a more concrete example of setting up CI for system image and applications (for PC.jl v1 at the moment since I haven’t updated it yet)

there are also simpler examples in the example folder, e.g a fake Pkg CLI interface you can run the FakePkg.comonicon_install with -h in terminal to see the help msg about what it does.

I think recently this CLI app is also using it for binaries: GitHub - KwatMDPhD/Clean.jl: Command-line program for cleaning 🛀

Yes this is possible with the new PackageCompiler v2 I think if multiple entries are defined. And this is related to a feature that I hope to have in the future about CLI plugins, which is a nice thing rust-clap supports.

However I think a big difference from conventional CLI apps built with C/rust/ is when you build your CLI with a system image or applications Julia has a much larger runtime and the runtime actually overlaps between binary applications how to share the runtime is not clear to me yet. Or it would be nice to revive StaticCompiler.jl or whatever is equivalent to get smaller binaries so that copying the runtime libraries is more acceptable. And large runtime also hits latency, I think currently even with system image the startup time of a CLI app is still much slower than rust or C or even go, and similar or slower than python

2 Likes