The agparse-based CLI became quite large and unreadable.
typer offers automatic documentation, see docs.md
typer offers autocompletion which is faster (based on my very subjective feeling)
In my experience, the autocompletion Is now reasonably usable without to long wait times
typer offers a better formatted CLI experience
Further inclusions
Prompts are now handled via typer.promp, i.e., reprompted if the answer is unclear
If rich is installed, printing is visually more pleasing, e.g.,
seml --help:
without
rich
seml collection status
without
rich
Since not everyone might like the new printing style, it is optional and printing defaults to the old printing if rich is not installed. To install rich with seml: pip install seml[pretty].
Concerns
The CLI changed slightly, for instance seml collection delete -s pending staged is now seml collection delete -s "pending staged" or seml collection delete -s pending -s staged.
We now have more code since I explicitly wrapped each function, alternatively we could also adapt a short hand notation as before we directly pass all locals().
Having two different visuals for printing could be confusing?
Are we sure that all parameters are translated correctly?
rich slows down the initial start time by ~200ms, without rich the CLI completion performs better (maybe avoid importing rich if we simply autocomplete?) This is now implemented
Reimplementation of the CLI with
typer
Rationale
agparse
-based CLI became quite large and unreadable.typer
offers automatic documentation, seedocs.md
typer
offers autocompletion which is faster (based on my very subjective feeling)typer
offers a better formatted CLI experienceFurther inclusions
Prompts are now handled via
typer.promp
, i.e., reprompted if the answer is unclearIf
rich
is installed, printing is visually more pleasing, e.g.,seml --help
:rich
seml collection status
rich
Since not everyone might like the new printing style, it is optional and printing defaults to the old printing if
rich
is not installed. To installrich
withseml
:pip install seml[pretty]
.Concerns
seml collection delete -s pending staged
is nowseml collection delete -s "pending staged"
orseml collection delete -s pending -s staged
.locals()
.rich
slows down the initial start time by ~200ms, withoutrich
the CLI completion performs better (maybe avoid importing rich if we simply autocomplete?) This is now implemented