---
title: "click-didyoumean | pypx"
description: "Enables git-like *did-you-mean* feature in click"
canonical_url: "https://pypx.app/packages/click-didyoumean"
meta:
  "og:description": "Enables git-like *did-you-mean* feature in click"
  "og:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_click-didyoumean%2Cversion_0.3.1%2Csummary_~RW5hYmxlcyBnaXQtbGlrZSAqZGlkLXlvdS1tZWFuKiBmZWF0dXJlIGluIGNsaWNr%2Clicense_MIT%2BLicense%2Cp_Ii9wYWNrYWdlcy9jbGljay1kaWR5b3VtZWFuIg%2Cs_tAhKI345IACz6Rn1.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "click-didyoumean 0.3.1"
  "twitter:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_click-didyoumean%2Cversion_0.3.1%2Csummary_~RW5hYmxlcyBnaXQtbGlrZSAqZGlkLXlvdS1tZWFuKiBmZWF0dXJlIGluIGNsaWNr%2Clicense_MIT%2BLicense%2Cp_Ii9wYWNrYWdlcy9jbGljay1kaWR5b3VtZWFuIg%2Cs_tAhKI345IACz6Rn1.png"
---

> Index of every page on this site: [llms.txt](https://pypx.app/llms.txt)

# **click-didyoumean**

v0.3.1

Enables git-like \*did-you-mean\* feature in click

4 KB Python 3.6.2+ py3-none-anyMIT License1 deps Possibly Unmaintained

[**Diff **](https://pypx.app/packages/click-didyoumean/diff)

`$ uv add click-didyoumean`

# click-didyoumean

[![Latest version released on PyPi](https://img.shields.io/pypi/v/click-didyoumean.svg?style=flat&label=version)](https://pypi.python.org/pypi/click-didyoumean) [![Build status of the master branch](https://img.shields.io/travis/click-contrib/click-didyoumean/master.svg?style=flat)](http://travis-ci.org/click-contrib/click-didyoumean) [![Package license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://raw.githubusercontent.com/click-contrib/click-didyoumean/master/LICENSE)

Enable git-like *did-you-mean* feature in click.

It's as simple as this:

```python
import click
from click_didyoumean import DYMGroup

@click.group(cls=DYMGroup)
def cli():
    ...
```

![Demo](https://raw.githubusercontent.com/click-contrib/click-didyoumean/master/examples/asciicast.gif)

## Usage

Install this extension with pip:

```
pip install click-didyoumean
```

Use specific *did-you-mean* `group` class for your cli:

```python
import click
from click_didyoumean import DYMGroup

@click.group(cls=DYMGroup)
def cli():
    pass

@cli.command()
def foo():
    pass

@cli.command()
def bar():
    pass

@cli.command()
def barrr():
    pass

if __name__ == "__main__":
    cli()
```

Or you it in a `CommandCollection`:

```python
import click
from click_didyoumean import DYMCommandCollection

@click.group()
def cli1():
    pass

@cli1.command()
def foo():
    pass

@cli1.command()
def bar():
    pass

@click.group()
def cli2():
    pass

@cli2.command()
def barrr():
    pass

cli = DYMCommandCollection(sources=[cli1, cli2])

if __name__ == "__main__":
    cli()
```

## Change configuration

There are two configuration for the DYMGroup and DYMCommandCollection:

+-----------------+-------+---------+---------------------------------------------------------------------------+ | Parameter | Type | Default | Description | +=================+=======+=========+===========================================================================+ | max\_suggestions | int | 3 | Maximal number of *did-you-mean* suggestions | +-----------------+-------+---------+---------------------------------------------------------------------------+ | cutoff | float | 0.5 | Possibilities that don’t score at least that similar to word are ignored. | +-----------------+-------+---------+---------------------------------------------------------------------------+

### Examples

```python
@cli.group(cls=DYMGroup, max_suggestions=2, cutoff=0.7)
def cli():
    pass

... or ...

cli = DYMCommandCollection(sources=[cli1, cli2], max_suggestions=2, cutoff=0.7)
```

## **Details **

<dl>

<dt>Version</dt>
<dd>0.3.1</dd>

<dt>License</dt>
<dd>MIT License</dd>

<dt>Python</dt>
<dd>&gt;=3.6.2</dd>

<dt>Maintainer</dt>
<dd>Timo Furrer</dd></dl>

## **Links**

- [Homepage](https://github.com/click-contrib/click-didyoumean)
- [Repository](https://github.com/click-contrib/click-didyoumean)
- [View on PyPI](https://pypi.org/project/click-didyoumean/)

## **Maintainers **

- Timo Furrer · [timo.furrer@roche.com](mailto:timo.furrer@roche.com)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pypx.app/#website","@type":"WebSite","description":"The Python Package Index, reimagined. Fast search, dependency insights, download trends, and changelogs — all in one place.","name":"pypx","url":"https://pypx.app/"},{"@id":"https://pypx.app/packages/click-didyoumean#webpage","@type":"WebPage","description":"Enables git-like *did-you-mean* feature in click","name":"click-didyoumean","url":"https://pypx.app/packages/click-didyoumean","isPartOf":{"@id":"https://pypx.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://pypx.app/packages/click-didyoumean"]}]},{"@id":"https://pypx.app/packages/click-didyoumean#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","description":"Enables git-like *did-you-mean* feature in click","license":"MIT License","name":"click-didyoumean","softwareVersion":"0.3.1"}]}
```

## Sitemap

See the full [sitemap](https://pypx.app/sitemap.md) for all pages.
