{"id":3925,"library":"click-help-colors","title":"Click Help Colors","description":"click-help-colors is a Python library that provides colorization for help messages in Click, a popular library for creating command-line interfaces. It allows users to customize the colors of headers, options, and custom elements within their CLI's help output, enhancing readability and user experience. The current version is 0.9.4. Its release cadence is irregular, with updates typically driven by compatibility requirements with new Click versions or feature enhancements.","status":"active","version":"0.9.4","language":"en","source_language":"en","source_url":"https://github.com/click-contrib/click-help-colors","tags":["click","cli","help","colors","formatter"],"install":[{"cmd":"pip install click-help-colors","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core dependency; click-help-colors extends Click's functionality for help message formatting.","package":"click","optional":false}],"imports":[{"symbol":"HelpColorsGroup","correct":"from click_help_colors import HelpColorsGroup"},{"symbol":"HelpColorsCommand","correct":"from click_help_colors import HelpColorsCommand"}],"quickstart":{"code":"import click\nfrom click_help_colors import HelpColorsGroup, HelpColorsCommand\n\n@click.group(\n    cls=HelpColorsGroup,\n    help_headers_color='yellow',\n    help_options_color='green',\n    help_options_custom_colors={'command2': 'red'}\n)\ndef cli():\n    \"\"\"A command line interface with colored help.\n\n    This is a demonstration of click-help-colors.\n    \"\"\"\n    pass\n\n@cli.command(\n    cls=HelpColorsCommand,\n    help_headers_color=None,\n    help_options_color=None,\n    help_options_custom_colors={'--count': 'cyan'}\n)\n@click.option('--count', default=1, help='Number of greetings.')\n@click.option('--name', default='World', help='The person to greet.')\ndef command1(count, name):\n    \"\"\"Greets the given NAME for a total of COUNT times.\"\"\"\n    for x in range(count):\n        click.echo(f\"Hello {name}!\")\n\n@cli.command()\ndef command2():\n    \"\"\"Another command with default colors.\"\"\"\n    click.echo('This is command 2')\n\nif __name__ == '__main__':\n    cli()","lang":"python","description":"This quickstart demonstrates how to apply colored help messages to both a Click group and a subcommand using `HelpColorsGroup` and `HelpColorsCommand`. It sets global header and option colors for the group, and then overrides or adds custom option colors for `command1`."},"warnings":[{"fix":"Upgrade `click-help-colors` to 0.9.0 or higher: `pip install --upgrade click-help-colors`.","message":"Older versions of `click-help-colors` were incompatible with Click 8.0. Ensure you are using `click-help-colors` version 0.9.0 or newer for full compatibility with Click 8.x and above.","severity":"breaking","affected_versions":"<0.9.0"},{"fix":"Ensure your project uses Python 3.6 or a more recent version.","message":"Click 8.0 dropped support for Python 2 and Python 3.5. If you are using `click-help-colors` with Click 8.0+, your project must be running on Python 3.6 or newer.","severity":"gotcha","affected_versions":"Click >= 8.0"},{"fix":"Double-check that the keys in `help_options_custom_colors` precisely match the option strings defined in your Click commands.","message":"Custom help option colors (`help_options_custom_colors`) need to be specified carefully. Keys in this dictionary should exactly match the option string (e.g., '--my-option' or '-m') for the color to apply correctly.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}