-
Notifications
You must be signed in to change notification settings - Fork 129
cmd2 4.0 discussion #1538
Copy link
Copy link
Open
Labels
Milestone
Description
Now that cmd2 3.0.0 is out, it's time to start discussing what we would like to see in the 4.0.0 release for cmd2.
Features @kmvanbrunt and I have discussed for 4.x include:
- Remove explicit dependency on Python's built-in
cmdmodule, but retain backwards compatibility (PR Remove dependency on Python's built-in cmd module #1539) - Replace dependency on
twinefor publishing PyPI package with one onuv publish(Use uv for publishing to PyPI instead of twine #1548) - Replace use of
invokewith use ofmake, primarily used for cleanup at this point (Add clean target to Makefile that runs what is in invoke clean #1549) - Migrate documentation to Zensical which is essentially MkDocs 2.0, but implemented in Rust and much faster (PR Migrate documentation to use Zensical instead of MkDocs #1557)
- Remove dependency on Python's built-in
readlinemodule and replace it with a dependency on prompt-toolkit which is a pure Python replacement for GNU Readline (PR Migrate from using readline to prompt-toolkit #1553)- Support adding a bottom toolbar to display real-time status via
prompt-toolkit(PR Migrate from using readline to prompt-toolkit #1553) - Add
prompt-toolkitsyntax highlighting of text entered by users, at least for command names (PR Migrate from using readline to prompt-toolkit #1553) - Add support for
prompt-toolkitInput Validation - I looked into this and honestly if we add support for more advanced input validation, I would prefer to add a dependency onpydanticand go that route. But that is more than I want to bite off for the 4.0 release ofcmd2. - Add auto-suggestions using
prompt-toolkitsimilar to fish-shell where it will show a recommended completion grayed-out per user request in Add auto suggestion feature #1545 (PR Migrate from using readline to prompt-toolkit #1553)
- Support adding a bottom toolbar to display real-time status via
- Handle
prompt-toolkitcompletion edge cases related to adding quotes (PR Refactor completion API #1575) - Consider implementing syntax that is essentially compatible with Typer for defining command arguments based on type hints. A user documented how to do this in Discussion A plugin for Typer command define within cmd2 #1530.
- For this I envision something like a
@cmd2.typerdecorator that will auto-generate anargparse.ArgumentParserbased on argument annotations - We won't be tackling this in the 4.0.0 release unless someone else wants to do the work
- For this I envision something like a
- Remove the transcript testing feature set (PR Remove the Transcript Testing feature #1583)
- Investigate migrating type-checking from
mypyto ty now thattyis in beta- Will revisit this in the future after releasing 4.0.0. This isn't a backwards incompatible change for anyone and I'd like to wait for this library to mature a little more before migrating to it
- Replace restrictive type hints (e.g.
list) with broader ones likeSequenceorIterable(PR Use more generic types where possible for input parameters #1584) - Ensure examples all work
- Change async alert methods to rely on a queue (PR Refactored async alerts. #1586)
- Remove the
default_to_shellflag since it can result in unintended execution which can be dangerous (PR Removed default_to_shell. #1590) - Restore concatenating all lines of a multi-line command into one for the up-arrow history (PR Switch to using prompt-toolkit's multiline filtering. #1589)
- Fix
Cmd2Lexercoloring of command names used on continued lines in multiline commands (PR Fixed multiline command highlighting in Cmd2Lexer #1591) - Ensure documentation and CHANGELOG are fully up to date
Moving to prompt-toolkit and no longer depending on cmd will be a large paradigm shift for cmd2. But this will open doors for easier and more consistent cross-platform support as well as being able to provide some more advanced features that we cannot now.
Reactions are currently unavailable