On a clean install, sgpt fails to start because click is imported by the package but is no longer present in the env:
$ sgpt --help
Traceback (most recent call last):
File ".../bin/sgpt", line 4, in <module>
from sgpt import cli
File ".../site-packages/sgpt/__init__.py", line 1, in <module>
from .app import main as main
File ".../site-packages/sgpt/app.py", line 8, in <module>
from click import UsageError
ModuleNotFoundError: No module named 'click'
click is imported directly in sgpt/app.py, sgpt/utils.py, sgpt/config.py, sgpt/role.py and sgpt/handlers/chat_handler.py, but it is not listed in [project] dependencies in pyproject.toml. It used to come in transitively through typer, but recent typer releases dropped that — typer 0.26.7 (which typer >=0.7.0, <1.0.0 resolves to today) only requires shellingham, rich, annotated-doc, and (Windows-only) colorama. So nothing pulls click in anymore.
This is independent of installer — any clean install that strictly follows the declared deps hits it. The minimal repro is just pip in a fresh venv:
python -m venv /tmp/sgpt
/tmp/sgpt/bin/pip install shell-gpt
/tmp/sgpt/bin/sgpt --help
# ModuleNotFoundError: No module named 'click'
uv tool install shell-gpt and pipx install shell-gpt reproduce it for the same reason (they always build an isolated env). Existing users likely didn't notice because click was already present in their environment from something unrelated. It also reproduces against main — the pyproject.toml and the from click import ... sites are unchanged.
Environment
- shell-gpt 1.5.1
- typer 0.26.7
- Python 3.13
- macOS (arm64)
Suggested fix
Either:
- add
click to [project] dependencies in pyproject.toml (preferred, since click is used directly), or
- pin
typer to a range that still pulls click transitively.
Workaround
pip install click
# or, for isolated installers:
uv tool install --with click shell-gpt
pipx inject shell-gpt click
On a clean install,
sgptfails to start becauseclickis imported by the package but is no longer present in the env:clickis imported directly insgpt/app.py,sgpt/utils.py,sgpt/config.py,sgpt/role.pyandsgpt/handlers/chat_handler.py, but it is not listed in[project] dependenciesinpyproject.toml. It used to come in transitively throughtyper, but recenttyperreleases dropped that —typer 0.26.7(whichtyper >=0.7.0, <1.0.0resolves to today) only requiresshellingham,rich,annotated-doc, and (Windows-only)colorama. So nothing pullsclickin anymore.This is independent of installer — any clean install that strictly follows the declared deps hits it. The minimal repro is just pip in a fresh venv:
python -m venv /tmp/sgpt /tmp/sgpt/bin/pip install shell-gpt /tmp/sgpt/bin/sgpt --help # ModuleNotFoundError: No module named 'click'uv tool install shell-gptandpipx install shell-gptreproduce it for the same reason (they always build an isolated env). Existing users likely didn't notice becauseclickwas already present in their environment from something unrelated. It also reproduces againstmain— thepyproject.tomland thefrom click import ...sites are unchanged.Environment
Suggested fix
Either:
clickto[project] dependenciesinpyproject.toml(preferred, sinceclickis used directly), ortyperto a range that still pullsclicktransitively.Workaround
pip install click # or, for isolated installers: uv tool install --with click shell-gpt pipx inject shell-gpt click