How do you use Comonicon.jl?

Create a new package. Then in the root put your options in a file called Comonicon.toml

name = "my-cli"

[install]
export_path=true
completion=true
quiet=false
compile="min"
optimize=2

In deps/build.jl put

using Comonicon, MyPackage
Comonicon.install(MyPackage)

Then in src/MyPackage.jl

module ContainerCLI

using Comonicon, Pkg.TOML, SimpleContainerGenerator, Logging

@main function my_cli(x::String)
   print("Hello from my cli $x")
end

end # module
2 Likes