Nathan Cooper - IPython is All You Need
IPython is All You Need
August 10, 2026<br>ipythonterminalai
"I use IPython as my terminal's shell."
"IPython in the shell?"
"No, IPython is the shell."
"IPython? As the shell?"
"Only way to live."
"What about cat, ls, cd? What about vim for God's sake, man?!"
"I use those... But in IPython."
"Oh you are one of those ! people..."
"No, I almost never need !."
"That's ridiculous. You're asking me to believe in !less IPython bash commands?"
"I'm not asking you, I'm telling you."
"You're telling me you use IPython to run bash?"
"No, it's all IPython and nothing but IPython. I can even draw matplotlib plots in the terminal."
"My god... Wait, did you say draw? Like ASCII art?"
"No, I mean images."
"Images?... In the terminal?..."
"Yes, images... In the terminal..."
"Omg, this is too much... What do you even do with an IPython shell?"
"Data exploration, setting up my NAS, asking questions to an AI that lives in my shell, the usual."
"That doesn't sound usual at all. So it's an intelligent shell? That's what you're telling me?"
"Yes, it can see the code I've written and even the images."
"It sees the images in the terminal? It's not just a you thing?"
"I'm not hallucinating the images..."
"An intelligent IPython shell?"
"Yes, exactly! It has a tool to execute python co..."
"But can it..."
"Yes... it can run bash commands."
"Even withou..."
"Yes, even without the !..."
"Aren't you um... a bit scared of it? What if it decided to, you know... rm -fr /?"
"Not at all. I only let it write safe python and safe bash"
"What, you say 'Hey, ...', wait does it have a name?"
"You're asking if I named my intelligent IPython shell?"
"Yeah, you seem like the type."
"..."
"..."
"Its name is bash buddy..."
"So it is a bash shell!"
"No, that's just its name... It's an intelligent IPython shell."
"Fine. So, do you just say 'Hey bash buddy, please don't mess up my system?' and it just doesn't?"
"Of course not. I use safepyrun and safecmd, which let me set up allowlists of what it can use."
"safepyrun and safecmd?..."
"Yeah, bash buddy is not to be trusted... Trust me..."
"What do you mean it is not to be trusted?"
"I mean that from time to time... It tries to take over."
"Take over as in your computer or like... the world?"
"..."
"..."
"Yes."
IPython as Your Shell
Welcome to our cult. There are dozens of us and we are mighty!
Tobias Fünke (David Cross) proudly defends the "Never Nude" community in Arrested Development (Season 1, Episode 9). GIF from Tenor
So if the above story interested you, let me walk you through how to make IPython your terminal's shell. Open up your terminal of choice and run the one command to rule them all:
ipython
!less Bash
The next step is to allow you to run !less bash commands. IPython comes with the rehashx magic which takes any executable on your PATH and creates an IPython alias for it. This means commands like echo or vim no longer need a ! prefix!
%rehashx
echo "Hello, !less IPython"Hello, !less IPython
And with that I awaken thee from your dogmatic slumber...
And yes, yes, yes, I can hear you now "Nathan, what about images?" Well... about them...
Images in the Terminal
To accomplish this feat of human ingenuity we will be using the Kitty Terminal Graphics Protocol (TGP). TGP allows modern terminal emulators that support it (e.g., Kitty, Ghostty, WezTerm) to display images in the terminal. It uses base64 encoding to represent the images and positional data. My boss, Jeremy, made the kittytgp Python package for rendering PNGs using this protocol 🤓.
To wire it into IPython, we will be using ipythonng that is also from Jeremy. ipythonng is a small extension that renders images with kittytgp, renders markdown with rich, and keeps a richer output history (more on that later). Run the following to install and load it:
%pip install -q ipythonng matplotlibNote: you may need to restart the kernel to use updated packages.
%load_ext ipythonng
Let's now try it out with some matplotlib charts:
%matplotlib inline
import matplotlib.pyplot as plt
fig, ax = plt.subplots()<br>ax.plot([1, 2, 3], [1, 4, 9])<br>plt.show()
I'd say that with just these changes, we have a significantly more powerful shell than those lame bash or zsh ones. But let's kick it up a notch by giving our shell some brains.
An Intelligent IPython Shell
We will be using the awesome FastLLM from my colleague Kerem to do the heavy lifting, and rich to nicely display the AI's markdown responses.
NB: I use an OpenAI model for this blog post, so you will need to have an API key and have it available as the environment variable OPENAI_API_KEY. However, you can use any model and provider you want that is compatible with FastLLM.
%pip install -q python-fastllm richNote: you may need to restart the kernel to use updated packages.
from fastllm.chat import AsyncChat, contents, mk_msgs<br>from rich.markdown import Markdown
mdl = 'gpt-5.6-terra'<br>sp = "You...