shellingham
Tool to Detect Surrounding Shell
Install
shellingham on PyPI
pip
pip install shellinghamuv
uv add shellinghampoetry
poetry add shellinghamPackage facts
| License | ISC License (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,024 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: shellingham-1.5.4-py2.py3-none-any.whl
Keywords: shell
About shellingham
from the package's own PyPI description — quoted content, verbatim
============================================= Shellingham: Tool to Detect Surrounding Shell =============================================
.. image:: https://img.shields.io/pypi/v/shellingham.svg :target: https://pypi.org/project/shellingham/
Shellingham detects what shell the current Python executable is running in.
Usage
.. code-block:: python
>>> import shellingham
>>> shellingham.detect_shell()
('bash', '/bin/bash')
detect_shell pokes around the process's running environment to determine
what shell it is run in. It returns a 2-tuple:
- The shell name, always lowercased.
- The command used to run the shell.
ShellDetectionFailure is raised if detect_shell fails to detect the
surrounding shell.
Notes
- The shell name is always lowercased.
- On Windows, the shell name is the name of the executable, minus the file extension.
Notes for Application Developers
Remember, your application's user is not necessarily using a shell.
Shellingham raises ShellDetectionFailure if there is no shell to detect,
but your application should almost never do this to your user.
A practical approach to...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Shellingham detects which shell the current Python process is running in and returns both the shell name and its command path. It raises ShellDetectionFailure if no shell is detected.
Installs with no runtime dependencies and low friction. The package is actively maintained with recent commits and has been stable since 2018, supporting Python 3.7–3.12.
Licensed under ISC (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open and closed-source projects.
Usage
import shellingham
try:
shell_name, shell_path = shellingham.detect_shell()
print(f"Shell: {shell_name} at {shell_path}")
except shellingham.ShellDetectionFailure:
print("No shell detected")
Requires Python 3.7 or later; shell detection may fail if the process is not running in an interactive shell environment.
Verdict: A lightweight, zero-dependency utility for shell detection with a clean API and permissive license. Active maintenance, broad Python version support, and no known vulnerabilities make it a reliable choice for tools that need to identify the user's shell environment.
Needs verification
- Whether shell detection works reliably across all POSIX and Windows environments in practice
- Performance impact of the detection logic on startup time for CLI tools
Similar packages
permissive · top 1,000 on PyPI
identifypermissive · top 1,000 on PyPI
azure-monitor-opentelemetry-exporterpermissive · top 1,000 on PyPI
charset-normalizerpermissive · top 100 on PyPI
seleniumpermissive · top 1,000 on PyPI
questionarypermissive · top 1,000 on PyPI
findpythonpermissive · top 1,000 on PyPI
langsmithpermissive · top 1,000 on PyPI
azure-cosmospermissive · top 1,000 on PyPI
pyflakespermissive · top 1,000 on PyPI