Registry / testing / click-plugins

click-plugins

JSON →
library1.1.1.2pypypi✓ verified 23d ago

click-plugins is an extension module for the Click library, designed to enable registering CLI commands via setuptools entry-points. The project's official PyPI package is currently marked as inactive, with version 1.1.1.2 being the final release. While a 2.0 release exists on GitHub, it restructured the project to support vendoring and no longer directly supports building a `pip` package, effectively making the PyPI offering abandoned.

pip install click-plugins
INSTALL
IMPORT
SIG · CLICK-PLUGINS
C
click-plugins
testingpythonv1.1.1.2
Install
1.7s avg
Import
73ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.1.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.074s · 18.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.072s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

with_plugins
from click_plugins import with_plugins
This decorator is the primary mechanism for adding plugin support to a Click group.

This quickstart demonstrates how to use `with_plugins` to enable a Click group to discover commands via setuptools entry-points. The `ep_group` parameter specifies the entry-point group to look for. For this example to be fully functional, you would typically define entry points in your `setup.py` or `pyproject.toml` under a section like `[options.entry_points]`, e.g., `click_commands = my_package.my_plugins:my_command_function`.

import click from click_plugins import with_plugins import os # Example of a 'plugin' that would be discovered via entry points # In your setup.py/pyproject.toml, you'd define: # [options.entry_points] # click_commands = click_plugins_example.plugins:hello_plugin @click.group() def plugins(): "A group for plugin commands." pass @plugins.command() def hello_plugin(): click.echo("Hello from a plugin!") @with_plugins(ep_group='click_commands') @click.group() def cli(): "A CLI with plugin support." pass # To make the quickstart runnable without a full setup.py, # we'll simulate the entry point discovery by directly adding it. # In a real scenario, this wouldn't be necessary. cli.add_command(plugins) if __name__ == '__main__': # In a real environment, you'd run `cli()` directly. # For this quickstart, we're demonstrating the integration. # For testing, ensure 'plugins' command is added. cli()
Debug
Known issues
breakingThe PyPI package `click-plugins` is no longer actively maintained. Version 1.1.1.2 is the final release available via `pip install`.
fix
Consider migrating to alternatives or vendoring the necessary code. If you must use `click-plugins`, pin your dependency to `click-plugins==1.1.1.2`.
affects: 1.1.1.2 and later (on PyPI)
breakingGitHub release 2.0 is *not* a continuation of the PyPI package. It restructured the project for vendoring and explicitly states it 'no longer directly supports building a `pip` package'.
fix
Do not attempt to install version 2.0 via `pip` or expect it to be a drop-in replacement for earlier PyPI versions. It's intended for direct inclusion in other projects.
affects: 2.0
gotchaVersion 1.1 contained a mismatch between its stated version and `click_plugins.__version__`. It was superseded by 1.1.1.
fix
Avoid using version 1.1; use 1.1.1 or 1.1.1.2 instead.
affects: 1.1
gotchaThe primary mechanism for discovering commands relies on setuptools entry points. Misconfiguration of `setup.py` or `pyproject.toml` can lead to commands not being discovered.
fix
Carefully review your `pyproject.toml` (or `setup.py`) to ensure the `[options.entry_points]` section correctly defines your plugin groups (e.g., `click_commands = ...`) and points to the correct functions.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'click_plugins'
The `click-plugins` PyPI package is no longer actively maintained. The recommended approach for version 2.0 and above is to 'vendor' the `click_plugins.py` file directly into your project, rather than installing it as a standard package via `pip`.
fix
For `click-plugins` version 2.0+, download the `click_plugins.py` file from the official GitHub repository and place it directly into your project. Adjust any import statements from `from click_plugins import ...` to reflect its new location (e.g., `from .your_module_path.click_plugins import ...`). If attempting to use the older 1.x PyPI version, ensure it's correctly installed with `pip install click-plugins` in your active environment.
Warning: could not load plugin. See <CLI> <command/group> --help
`click-plugins` encountered an error when attempting to load a command or group registered via setuptools entry points. This mechanism prevents the entire CLI from crashing by replacing the problematic plugin with a `BrokenCommand` that provides a warning.
fix
Execute the CLI command or group that issued the warning and observe the full traceback printed to the console. This traceback will pinpoint the specific error (e.g., `ImportError`, `AttributeError`, syntax error) within the plugin's code or its dependencies. Debug and correct the underlying issue in the plugin or its `setup.py` entry point configuration.
AttributeError: module 'click' has no attribute 'get_os_args'
This error, or similar `AttributeError`s (e.g., `no attribute 'get_terminal_size'`, `'_expand_args'`, `'hidden'`), typically indicates a version incompatibility between the `click-plugins` library (or a plugin using it) and a newer version of the underlying `Click` library, where certain internal attributes or functions have been removed or renamed.
fix
Update `click-plugins` to its latest available version (if a compatible PyPI update exists, which is unlikely given its status) or, if vendoring, ensure your `click_plugins.py` file is from the latest `click-contrib/click-plugins` GitHub repository. Alternatively, if updating is not an option or causes other conflicts, consider pinning your `Click` library to an older version known to be compatible with your `click-plugins` installation (e.g., `pip install 'click<8.1'`).
ImportError: cannot import name '_unicodefun' from 'click'
This `ImportError` signifies that a module, often a dependency of your application (not necessarily `click-plugins` itself, but something that `click-plugins` interacts with), is attempting to import a private helper function (`_unicodefun`) that has been removed or refactored in a newer version of the `Click` library (specifically, `Click` 8.1.0 and later).
fix
Update all libraries in your project that depend on `Click` to their latest compatible versions. If the problem persists, or if you have a specific dependency that is not yet compatible with newer `Click` versions, you may need to explicitly pin the `Click` library to an older, compatible version, such as `pip install --upgrade click==8.0.2`.
Upgrade
Version history
1.1.1.2latest on PyPI · released Jun 25, 2025
Audit
Dependencies
clickrequiredCore dependency for CLI application building, which this library extends.
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
click-plugins — pip install click-plugins · libregistry