Pobshell: A Bash-like shell for live Python objects
What Pobshell Does
Think cd, ls, cat, and find — but for Python objects instead of files.
Stroll around your code, runtime state, and data structures. Inspect everything: modules, classes, live objects. Plus recursive search and CLI integration.
2 minute video demo: https://www.youtube.com/watch?v=I5QoSrc_E_A
What it's for:
- Exploratory debugging: Inspect live object state on the fly
- Understanding APIs: Examine code, docstrings, class trees
- Shell integration: Pipe object state or code snippets to LLMs or OS tools
- Code and data search: Recursive search for object state or source without file paths
- REPL & paused script: Explore runtime environments dynamically
- Teaching & demos: Make Python internals visible and walkable
Pobshell is pick‑up‑and‑play: familiar commands plus optional new tricks.
Target Audience
Python devs, Data Scientists, LLM engineers and intermediate Python learners.
Pobshell is open source, and in alpha release -- Don't use it in production. N.B. Tab-completion isn't available in Jupyter.
Tested on MacOs, Linux and Windows (Python 3.12)
Install: pip install pobshell
Github: https://github.com/pdalloz/pobshell
Alternatives
You can get similar information from a good IDE or JupyterLab, but you'd need to craft Python list comprehensions using the inspect module. IPython has powerful introspection commands too.
What makes Pobshell different is how expressive its commands are, with an easy learning curve - because basic commands and navigation are based on Bash - and tight integration with CLI tools.
17 comments · 95% upvoted · other discussions
The
cdandls -lare nice ideas, butdirin Python already does most of what yourlsdoes. Using/seems clunky compared to the normal.in Python.Can you make the commands into Python functions (or something?) in a simple library that could be imported into the normal Python repl with a
from pobshell import *How's it work together with
pdbtoo?cogitoe [OP] 5 points · Jun 2025
The shell can be imported and used as you describe. Some of Pobshell's main strengths focus on interactive use.
But for sure there is also an option to create a persistent session object & run commands with it:
import pobshell pob_session = pobshell.pob() pob_session.onecmd_plus_hooks('ls -l') pob_session.onecmd_plus_hooks('quit')NB you must end with the quit command (to avoid risk of memory leaks from saved frame objects)cogitoe [OP] 2 points · Jun 2025
You can do similar with dir() and list comprehensions but it gets painful quickly.
There's a reason most people prefer exploring/interacting with the filesystem with Posix shells to Python REPLs with list comprehensions -- I prefer Python for multi use code, but ls and cd etc are better for exploring and seeing what's going on.
When there's a lot less friction it can be a step change in usefulness.
Edit: Reworded a sentence for clarity