Registry / devops / click-shell

click-shell

JSON →
library2.1pypypi✓ verified 86d ago

An extension to Click that turns your Click app into a shell utility with autocomplete and persistent context. Current version 2.1. Maintenance mode with no recent releases.

pip install click-shell
INSTALL
IMPORT
SIG · CLICK-SHELL
C
click-shell
devopspythonv2.1
Install
1.6s avg
Import
93ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1 · 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.098s · 18.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.088s · 19MB
17MB installed
● package 17MB
Code
Verified usage

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

Shell
from click_shell import Shell
from click_shell.shell import Shell
Direct import from click_shell is correct, not from submodule
click_shell
import click_shell
import click.shell
click-shell is a separate package, not part of click

Create a Click shell with custom prompt and intro message.

import click from click_shell import Shell @click.group(cls=Shell, prompt='myapp> ', intro='Welcome to myapp shell') def cli(): pass @cli.command() def hello(): click.echo('Hello, world!') if __name__ == '__main__': cli()
click-shell --version
Debug
Known issues
gotchaclick-shell does not support Click 8+ fully; may cause import errors with newer Click versions.
fix
Pin Click to 7.x or use a fork like click-shell2.
affects: >=2.1, all versions
deprecatedLibrary is in maintenance mode; no active development since 2019.
fix
Consider migrating to alternative like click-shell2 or prompt_toolkit-based solutions.
affects: all
gotchaThe Shell class requires a click.Group subclass; using a simple click.group() decorator will not work.
fix
Always pass cls=Shell to @click.group.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'Shell' from 'click_shell'
Incorrect import path or missing package installation.
fix
Run 'pip install click-shell' and use 'from click_shell import Shell'.
TypeError: 'Shell' object is not callable
Using @click.group() without cls=Shell, or calling Shell() directly instead of decorating a function.
fix
Use @click.group(cls=Shell) on a function, do not instantiate Shell directly.
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment.
Python locale misconfiguration; common on minimal Docker images.
fix
Set environment variable 'LC_ALL=C.UTF-8' or 'LANG=C.UTF-8'.
Upgrade
Version history
2.1latest on PyPI · released Jun 27, 2021
Audit
Dependencies
clickrequiredRequired dependency
Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources
click-shell — pip install click-shell · libregistry