pypi / click
click
What changed in click 8, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
9 breaking1 security3 deprecations4 new APIs and options10 behavior and defaults38 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initclick 865 changes
Breaking changes 9
Supported Windows versions enable ANSI terminal styles by default, removing the Colorama dependency.
Preserves 256-color index 0 and validates color arguments, raising ValueError for invalid colors.
Preserves 256-color index 0 and validates color arguments, raising ValueError for invalid colors.
CompositeParamType is now generic and has abstract methods.
Usage output now includes the prefix and program name when called without arguments.
The number-range base is now generic and has abstract methods.
Parameter is now an abstract base class and cannot be instantiated directly.
Parameter.name is now typed as str instead of str | None.
ParamType is now a generic abstract base class parameterized by its converted value type.
Security 1
Commands are split into argv lists and run without shell=True, reducing shell execution risks.
Deprecations 3
Deprecated because it mutates process-global state and is not thread-safe; use a temporary directory with absolute paths.
Moved to a private underscore-prefixed name; the old name remains with a DeprecationWarning until Click 9.0.
make_default_short_help is now marked as private API, signaling it should not be relied on by applications.
New APIs and options 4
Argument accepts help text, and help output adds a Positional arguments section when available.
Takes an optional second type parameter describing the accepted input value, defaulting to Any.
Built-in shell completion now supports Windows PowerShell 5.1+ and pwsh 7+.
A file-like API was added for accessing an output pager.
Behavior and default changes 10
Returns help option names in declaration order.
Help option metadata now exposes the reserved _click_default_help name.
Accepts os.PathLike filename values in addition to strings.
Now returns the type produced by type, value_proc, or a matching default instead of Any.
ANSI handling now strips the full CSI escape-sequence grammar.
Output is flushed after each write, allowing generators to stream incrementally to the pager.
Default capture no longer exposes the original file descriptor, preventing CLI dup2 calls from mutating host stdout.
Explicit defaults now win over auto-derived sibling defaults using source-aware arbitration.
Parameters with expose_value=False now have an empty-string name instead of None.
ParameterSource is now an IntEnum with members ordered from most to least explicit, enabling comparisons of explicit parameter sources.
Fixes and other changes 38
The automatic help option now uses _click_default_help, allowing a parameter named help without breaking parsing.
Strips ANSI color and style codes from prompts when the output stream does not support them.
Windows temporary pager files use the output stream encoding with errors=replace, allowing encodable stdout text to reach the pager.
On Windows, again yields a text stream and honors the color argument for the temporary-file backend.
Pager write errors on Windows are no longer masked by a cleanup PermissionError.
The temporary-file pager backend now forwards parameters from PAGER to the pager command.
Feature-switch metadata now resolves default=True to the flag_value received at call time.
Avoids a BytesWarning under python -bb when checking allow_dash values against the dash convention.
Applies remaining steps when the bar finishes so show_pos displays the final total.
Strips ANSI color and style codes from prompts when the output stream does not support them.
Raw mode detection now parses option tokens.
Optional arguments no longer produce double square brackets when their type already brackets the metavar.
Deprecated commands and options with empty or missing help text no longer show a stray leading space before the deprecation label.
Newlines and tabs in option help text are escaped so multi-line help preserves the original completion format.
Groups configured with invoke_without_command=True mark their subcommand as optional in usage help.
package_name can resolve a top-level import name when it does not match the installed distribution name.
Shell completion of Choice Enum values now produces a valid completion result.
Empty byte-string handling in echo is fixed.
The closed file error with echo_via_pager is fixed.
get_parameter_source() is available during eager callbacks and type conversion again.
Zsh completion scripts now parse correctly on Windows.
Deprecated option labels now have correct spacing and localization matching the command label.
Error hints now choose non-shadowed help options and show all surviving names.
Non-Windows prompts now support proper backspace, line editing, and line wrapping.
Debugger calls in isolation now interact with the real terminal instead of captured I/O streams.
Redirected streams expose the original file descriptor, preventing crashes for faulthandler, subprocess, and other C-level consumers.
For boolean flags, default=True remains the literal value True instead of being replaced by flag_value.
Sentinel.UNSET values are treated as absent, allowing the next default source to provide the value.
Custom show_default strings are now displayed in prompts, matching existing help text behavior.
Options with is_flag=False can use flag_value without requiring an explicit value.
Callable flag_value values are no longer instantiated when used as defaults through default=True.
Sentinel.UNSET values are returned as None when resolving defaults.
Sentinel.UNSET default values are replaced by None when passed through Context.invoke().
Pager arguments are no longer discarded because subprocess.Popen is used correctly.
Sentinel.UNSET values appear as None when callbacks look up other parameters through the context.
Rendering is fixed when prompt or confirm parameter prompt_suffix is empty.
Sentinel.UNSET conversion no longer happens too early, preventing incorrect behavior for multiple parameters sharing a name.
Parsing skips type_cast_value calls when Sentinel.UNSET is encountered.