Skip to main content

A shell extension for Click

Project description

Incenp.Click-Shell is an extension to click that easily turns your Click-powered Python command-line application into a shell utility. It is built on top of the built in Python cmd module, with modifications to make it work with Click.


  • Adds a “shell” mode with command completion to any Click app.

  • Just a one line change for most click apps.


Simply replace with on the root level command:

import click
from incenp.click_shell import shell

#  # no longer
@shell(prompt='my-app> ', intro='Starting my app...')
def my_app():

def testcommand():
    click.echo("testcommand is running")

# more commands

if __name__ == '__main__':

When run, you should expect an output like so:

$ python
Starting my app...
my-app> testcommand
testcommand is running

Using the Incenp.Click-Shell decorator alters the functionality of your program only when the program is called without a subcommand argument. Otherwise, your app will function identically to how it did before.


Incenp.Click-Shell is a fork of Clark Perkins’ click-shell, motivated by the lack of recent development in the original project and in particular the lack of support for recent versions of Click, which introduced changes that completely broke the original click-shell.

Incenp.Click-Shell is used in exactly the same way as the original click-shell, the only difference being that the module to import is named incenp.click_shell instead of click_shell.

Importantly, in this fork Python 2 support has been completely removed. If support for Python 2 is important for you, then you may keep using the original click-shell module instead; it won’t work with Click 8, but if you’re using Python 2 you’re stuck with older versions of Click anyway, since Click 8 also dropped support for Python 2.


Incenp.Click-Shell is distributed under a 3-clause BSD license. The full license is included in the LICENSE file of the source distribution.

Homepage and repository

The project is located at with the manual at

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (21.6 kB view hashes)

Uploaded source

Built Distribution

incenp.click_shell-2.1.0-py2.py3-none-any.whl (12.1 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page