shellingham
Tool to Detect Surrounding Shell
Decision gist · record as of 2026-08-14
Yes. Shellingham is a focused, zero-dependency utility with active maintenance, permissive licensing, and no known vulnerabilities. Install it if your application needs to detect the surrounding shell; skip it if you can rely on environment variables like SHELL or COMSPEC directly.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Actively maintained as of 2026-03-13 with a stable release history since 2018.
License · maintenance · safety
ISC License (permissive) — ISC License is permissive and imposes minimal restrictions; you can use this package in commercial and proprietary projects with minimal obligation.
last release 2023-10-24 (1025 days) · last repo commit 2026-03-13 · 319 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 382,454,724 downloads/mo, #112 on PyPI
Alternatives
Verify before relying
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")- Whether detection works reliably across all POSIX systems and Windows variants in practice
- Performance characteristics when called repeatedly in tight loops
What it is and what it does
Shellingham is a lightweight utility that inspects the process environment to determine which shell is running the current Python executable. It returns a tuple containing the shell's name (lowercased) and its full command path—for example, ('bash', '/bin/bash'). The package is designed for scenarios where your application needs to know the user's shell context, such as when launching interactive subshells or configuring shell-specific behavior.
The package handles the reality that not all Python processes run inside a shell; it raises ShellDetectionFailure when detection fails, and the documentation explicitly recommends wrapping calls in try-except blocks and providing sensible defaults (like the SHELL environment variable on POSIX systems or COMSPEC on Windows). It supports Python 3.7 through 3.12 and works across operating systems.
Use it for
- Detect the user's shell to launch an interactive subshell with appropriate configuration
- Determine shell type to apply shell-specific syntax or behavior in CLI tools
- Fallback detection when SHELL or COMSPEC environment variables are unavailable or unreliable
- Build shell integration features in development tools that need to know the surrounding environment
- Cross-platform shell identification for scripts that adapt behavior by shell type
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Shellingham is a focused, zero-dependency utility with active maintenance, permissive licensing, and no known vulnerabilities. Install it if your application needs to detect the surrounding shell; skip it if you can rely on environment variables like SHELL or COMSPEC directly.
Install
shellingham on PyPI
Before you install
Low install friction with no runtime dependencies. Actively maintained as of 2026-03-13 with a stable release history since 2018.
License in practice
ISC License is permissive and imposes minimal restrictions; you can use this package in commercial and proprietary projects with minimal obligation.
Quickstart
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")
Verify before relying
- Whether detection works reliably across all POSIX systems and Windows variants in practice
- Performance characteristics when called repeatedly in tight loops
Package 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,025 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 382,454,724 / month, #112 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)Operating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules |
Evidence: shellingham-1.5.4-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “detect shell environment”
- shellinghamShellingham detects which shell the current Python process is running…
- lib-detect-testenvDetects whether code is running in a test environment (pytest,…
- poetry-plugin-shellA Poetry plugin that launches a subshell with the project's virtual…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also poetry-plugin-shell · detect-installer · detect_agent · detect-delimiter · hatch_build_scripts · identify · subprocess.run · ptyprocess · typer · lib-detect-testenv