IPython is all you need IPython can serve as a full terminal shell replacement, enabling bash commands without the '!' prefix and displaying images inline via the Kitty Terminal Graphics Protocol, according to a blog post by Nathan (last name not provided) from AnswerDotAI. The post introduces tools 'safepyrun' and 'safecmd' to restrict an AI assistant's actions, and mentions 'ipythonng' and 'kittytgp' for image rendering. IPython is All You Need "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 https://github.com/AnswerDotAI/safepyrun and , which let me set up allowlists of what it can use." https://github.com/AnswerDotAI/safecmd safecmd " 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 https://sw.kovidgoyal.net/kitty/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 Python package for rendering PNGs using this protocol 🤓. https://github.com/AnswerDotAI/kittytgp kittytgp To wire it into IPython, we will be using ipythonng https://github.com/AnswerDotAI/ipythonng that is also from Jeremy. ipythonng is a small extension that renders images with kittytgp , renders markdown with , and keeps a richer output history more on that later . Run the following to install and load it: https://github.com/Textualize/rich rich %pip install -q ipythonng matplotlib Note: 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 python import matplotlib.pyplot as plt fig, ax = plt.subplots ax.plot 1, 2, 3 , 1, 4, 9 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 https://github.com/answerdotai/fastllm from my colleague Kerem to do the heavy lifting, and to nicely display the AI's markdown responses. https://github.com/Textualize/rich rich 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 rich Note: you may need to restart the kernel to use updated packages. python from fastllm.chat import AsyncChat, contents, mk msgs from rich.markdown import Markdown mdl = 'gpt-5.6-terra' sp = "You are a helpful assistant living in a user's IPython shell. Use markdown syntax for styling your responses." c = AsyncChat mdl, sp, vendor name='openai' r = await c 'Hi' Markdown contents r .text Hi How can I help? However, no AI is very intelligent without context, which means ours is about as dumb as rocks. So, let's give it the context of the IPython environment and the code we run and the outputs it produces. Luckily, there is a cool mechanism in IPython that captures a lot of these pieces for us. It's called the HistoryManager https://ipython.readthedocs.io/en/stable/api/generated/IPython.core.history.html and it's used a lot in IPython. For example, those In