The CLI generator Comonicon has been announced for a while and has been tagged 0.12.10 version recently. The interface has been stabilized for a while, thus I’m thinking to release its first 1.0 version. I’d like to see if there is any more feedback in terms of the APIs before I do so.
Bash auto-completion has been added recently.
now supports autocompeting types, such as
FileName etc. or customize the autocomplete codegen by overloading the corresponding API for your own type, e.g
-- can be used to separate the arguments if it’s turned on.
The old Comonicon version uses a cache file to store the CLI compile results
to accelerate the startup time. We removed this feature/workaround in later versions
because this is more a Julia compiler issue and it only works when the application
is mainly CLI code, so there is no apparent speedup for practical cases. One should
always consider using a proper project module to let Julia compiler itself cache the result.
now Comonicon support custom CLI error exception handling, via
CommandError exception types, and shorthand function
to help users hide Julia stacktrace and print out help info when error. Or handling exit and exit code
without actually exit the entire process. This makes it possible to reuse the CLI code directly in other packages without worrying about unexpected
exit in the CLI.
Previously we treat the first sentence of the markdown paragraph as the brief description,
we now making this more explicit by requiring one to use an
Introduction section to
explicitly describe the long description, e.g
""" command <args> description of the command. # Intro asdmwds dasklsam xasdklqm dasdm, qwdjiolkasjdsa dasklmdas weqwlkjmdas kljnsadlksad qwlkdnasd dasklmdlqwoi, dasdasklmd qw,asd. dasdjklnmldqw. # Args - `arg1`: argument 1. - `arg2`: argument 2. - `arg3`: argument 3. - `arg4`: argument 4. """
Comonicon has reworked it is built on top of the PackageCompiler 2.0 now, and will use Scratch space to manage each CLI’s environment TOML file and their system images. This will help the installed CLI get managed and correctly garbage collected by Julia’s
CASTED_COMMANDS constant to create plugin package of a CLI application. We now support the dash convention of plugins, e.g
git-remote will be the plugin of
git, this can be turned on via