Skip to content

v5.0.0b2

Pre-release
Pre-release

Choose a tag to compare

@BrianPugh BrianPugh released this 11 Sep 00:12

Changes since v5.0.0b1. All v4 features up to 4.25.2 have been merged into this release. This is hopefully the final beta release before v5.0.0 proper.

Breaking

  • Dropped Python 3.10 support (Python 3.10 EoL is Oct 31, 2026) #889

Features

  • Dynamic per-parameter shell completion #917
    • A Parameter.completer callable receives a CompletionContext and returns context-aware suggestions, so completions can depend on values only known at runtime (git branches, running containers, rows from a database). Works in bash/zsh/fish.
    • def complete_user(ctx):
          return load_users()  # e.g. {"alice": "admin", "bob": "member"} -> {value: description}
      
      @app.command
      def promote(user: Annotated[str, Parameter(completer=complete_user)]): ...
  • Parameter.metavar and type-derived value placeholders #919
    • Keyword-only parameters now show a value placeholder in the help panel (e.g. --config PATH), separating a value's shape from a positional parameter's display identifier.
    • Set Parameter.metavar to override the placeholder, or turn it off via the formatter. Closes #885.
    • def main(config: Annotated[Path, Parameter(metavar="FILE")]): ...  # shows "--config FILE"
  • Themeable help colors #916
    • Every color in the help output is now a bare cyclopts.* Rich named style, so you can recolor any part of the help page by supplying your own theme; your overrides win over the built-in defaults.
    • This includes the panel border (cyclopts.border), the usage line (cyclopts.usage), parameter/command names (cyclopts.name), and the metadata annotation styles ([default], [choices], [required], ...).
  • Per-group help panel styling via Group.theme #916
    • A Group can now carry its own theme (a dict or Rich Theme) to style just that group's panel independently of the rest of the help page.
    • danger = Group("Danger Zone", theme={"cyclopts.border": "red", "cyclopts.name": "bright_red"})
  • App.interactive_shell() improvements #941
    • New intro banner (supports Rich markup; None uses the default banner, "" prints nothing).
    • New history option (True for a default history-file location, or a path) backed by readline.
    • New remap_flags so bare help/version words at the root map to their long flags.
    • quit words and registered commands are handled more robustly, with registered commands and meta commands taking precedence over quit words.
    • readline is now imported lazily.

Full Changelog: v5.0.0b1...v5.0.0b2