<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/ipython-is-all-you-need-7v06ljio9" -->

---
title: IPython is All You Need | daily.dev
description: A developer walks through turning IPython into a full replacement terminal shell: using %rehashx to run bash commands without the ! prefix, rendering...
canonical: https://daily.dev/posts/ipython-is-all-you-need-7v06ljio9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: IPython is All You Need | daily.dev
og:description: A developer walks through turning IPython into a full replacement terminal shell: using %rehashx to run bash commands without the ! prefix, rendering...
og:url: https://daily.dev/posts/ipython-is-all-you-need-7v06ljio9
og:image: https://api.daily.dev/og/posts/7v06LJio9.png
og:image:alt: IPython is All You Need
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# IPython is All You Need

**[Lobsters](https://daily.dev/sources/lobsters)** · 13 min read · 0 upvotes · 0 comments

## Summary

A developer walks through turning IPython into a full replacement terminal shell: using %rehashx to run bash commands without the ! prefix, rendering matplotlib plots and images inline via the Kitty Terminal Graphics Protocol with kittytgp and ipythonng, and building an AI assistant that lives inside the shell using FastLLM. The assistant is given context via IPython's HistoryManager (tracking In/Out, stream outputs, images, and exceptions), can execute bash and Python through safecmd and safepyrun allowlists to prevent destructive commands, and responds to a custom `:query` input transformer. The piece ends by pointing to ipyai, a library that packages this pattern into a ready-made intelligent IPython shell.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nathancooper.io/blog/2026-08-10-ipython-is-all-you-need>

## Questions this post answers

### How can I display images directly in my terminal from an IPython session?

Images can be rendered inline in IPython using the Kitty Terminal Graphics Protocol (TGP), supported by terminal emulators like Kitty, Ghostty, and WezTerm. The kittytgp Python package renders PNGs using this protocol, and the ipythonng IPython extension wires it in so matplotlib plots and loaded images display directly in the terminal.

_daily.dev surfaces workflow tricks like this for developers building richer terminal setups._

### How do I let an AI assistant safely execute bash and Python commands in my IPython shell without risking destructive commands?

Use the safecmd and safepyrun packages, which check commands against an allowlist before execution. The bash tool from safecmd rejects disallowed commands like rm -fr / with a DisallowedCmd exception, while RunPython from safepyrun raises a PermissionError for unauthorized filesystem operations, letting an AI tool-call bash and Python while blocking destructive actions.

_developers wiring AI tool execution into their own shells often compare sandboxing approaches on daily.dev._

### How can an AI assistant access the context of previous commands and outputs in an IPython session?

IPython's built-in HistoryManager stores executed code in In/Out along with a history_manager.outputs dictionary holding stream, text, and image outputs per cell, plus history_manager.exceptions for tracebacks. A helper function can walk recent cells, pull sources and outputs, and format them as tagged context (code, output, error) to feed into an AI chat call.

_daily.dev helps developers track patterns like this for giving AI tools richer session context._

## Community take

How the wider developer community reacted, aggregated from 2 discussions and 10 comments across lobsters, hackernews (as of 2026-08-25).

**TL;DR:** Reactions are mixed: several find the confusing framing and heavy setup off-putting or even AI-slop-like, while others say the multimodal LLM-in-shell demo (interpreting an inline image) is a genuinely interesting technique once you get past the verbose writeup.

**Sentiment:** 25% positive · 45% mixed · 30% skeptical

**The case for**

- The demo of an inline image being interpreted by a multimodal LLM mid-session is seen as a genuinely novel way to mix Python precision with LLM power.
- Combining a full Python interpreter with a more structured session history for AI queries is viewed as interesting.
- Considered a nice quality-of-life setup for people already working heavily in numpy/matplotlib/pandas workflows.

**The pushback**

- The framing is confusing since the piece leans heavily on an LLM/API key despite claiming IPython alone is 'all you need'.
- %rehashx-based aliasing doesn't behave like a real shell (breaks if PATH changes or files are sourced afterward).
- Too many moving parts to set up, and the writeup is seen as overly long relative to the payoff.
- Allow/deny-list based command safety is seen as risky compared to proper sandboxing.
- Skepticism that this offers real benefits over existing shells like xonsh.

**By community**

- lobsters (mixed): Split between confusion/criticism of the framing and setup complexity, and appreciation once the multimodal LLM demo is understood.
- hackernews (mixed): No substantive comments were provided, so no real discussion signal is available.

**Hottest debate:** Whether this is a genuinely useful, novel technique or overcomplicated AI-slop dressed up as a shell replacement.

**Open questions**

- Does this offer meaningful benefits over existing shells like xonsh?
- What is the startup time impact of using IPython as a default shell?
- Can the allowlist-based command safety actually hold up against a misbehaving or malicious AI agent?

**Highlights**

> It doesn’t read like AI slop to me. The important part is 2/3 down the page. After printing a picture of a cat to the terminal using ipython (scroll until you see the cat), the next ipython input ":What do you see?" calls a multimodal LLM that interprets your ipython session and spits out that it sees a cat. The technique on that page is an interesting way to interact with LLMs. Having a full Python interpreter available so you can mix and match precision (Python statements) and power (LLM queries) deserves a look. If the author is reading this, putting the cat example at the top will help readers understand what makes your contribution unique. And condense the dialogue, or intersperse the dialogue throughout your ipython session.
> — [jbeckford on lobsters · 5 points](https://lobste.rs/s/oqv9np/ipython_is_all_you_need#c_lklxaq)

> Honestly pretty confused by this post. What does an LLM have to do with using IPython as a shell? Edit: it hardly sounds like IPython is “all you need” if you also need an OpenAI API key.
> — [ab5tract on lobsters · 14 points](https://lobste.rs/s/oqv9np/ipython_is_all_you_need#c_mtgpef)

> this post is missing so much and adding too much all at the same time. Is this AI SLOP !?!? The gist I get is enable %rehashx in python to get command aliases created from $PATH but what if I change PATH  or ya know, add a command to PATH after running %rehashx or source a file.. It does not behave like a shell at all this page is honestly too long for me to read since I got very little from its verbosity.  Can anyone with more time explain what the main purpose of this article was?
> — [sigmonsez on lobsters · 5 points, 1 comments](https://lobste.rs/s/oqv9np/ipython_is_all_you_need#c_p1wzp0)

> interesting. imo there's too many moving parts to set up as described in the post, but the end result is undeniably useful and a nice qol experience, esp if you're a ml eng./data scientist/work with numpy/matplotlib/pandas a lot.  i wonder if there's significant benefits to this over just using [xonsh](https://xon.sh/). having an ai agent in the terminal is also undeniably useful, and dangerous! esp. with allow/denylist based security instead of proper sandboxing. that's why i prefer running my agents in devcontainers (docker/podman containers w a declarative config on top), but for having the agent configure the system, that doesn't really work. in that case, i find that whatever ml-based classifiers and manual auto-approval the cli/tui harnesses ship with are ultimately going to be much less risky that whatever OP is suggesting.
> — [kraxen72 on lobsters · 1 points, 1 comments](https://lobste.rs/s/oqv9np/ipython_is_all_you_need#c_eqnfxc)

> sure bruh, and also: bash is all you need. and also: korn shell is all you need. and also: csh is all you need. and also: dash is all you need.
> — [jrwren on lobsters · 1 points](https://lobste.rs/s/oqv9np/ipython_is_all_you_need#c_kb87l0)

**Source threads**

- [lobsters](https://lobste.rs/s/oqv9np/ipython_is_all_you_need) · 18 points · 10 comments
- [hackernews](https://news.ycombinator.com/item?id=49247796) · 1 points · 0 comments

## Similar posts on daily.dev

- [the terminal of the future](https://daily.dev/posts/the-terminal-of-the-future-as03soq8f) · Hacker News · 19 upvotes · 3 comments
- [AI power tools: 6 ways to supercharge your terminal](https://daily.dev/posts/ai-power-tools-6-ways-to-supercharge-your-terminal-txighsnc8) · InfoWorld · 1 upvotes · 0 comments
- [We Gave AI Agents a Live Jupyter Kernel in PyCharm](https://daily.dev/posts/we-gave-ai-agents-a-live-jupyter-kernel-in-pycharm-hrqonqnd7) · JetBrains · 5 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#devtools](https://daily.dev/tags/devtools), [#ai-agents](https://daily.dev/tags/ai-agents)

[View this post on daily.dev](https://daily.dev/posts/ipython-is-all-you-need-7v06ljio9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"IPython is All You Need","url":"https://daily.dev/posts/ipython-is-all-you-need-7v06ljio9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/ipython-is-all-you-need-7v06ljio9"},"datePublished":"2026-08-25T18:29:46.639Z","dateModified":"2026-08-25T19:13:56.774Z","description":"A developer walks through turning IPython into a full replacement terminal shell: using %rehashx to run bash commands without the ! prefix, rendering...","image":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","thumbnailUrl":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/ipython-is-all-you-need-7v06ljio9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,devtools,ai-agents","timeRequired":"PT13M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"IPython is All You Need"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/ipython-is-all-you-need-7v06ljio9#faq","mainEntity":[{"@type":"Question","name":"How can I display images directly in my terminal from an IPython session?","acceptedAnswer":{"@type":"Answer","text":"Images can be rendered inline in IPython using the Kitty Terminal Graphics Protocol (TGP), supported by terminal emulators like Kitty, Ghostty, and WezTerm. The kittytgp Python package renders PNGs using this protocol, and the ipythonng IPython extension wires it in so matplotlib plots and loaded images display directly in the terminal. daily.dev surfaces workflow tricks like this for developers building richer terminal setups."}},{"@type":"Question","name":"How do I let an AI assistant safely execute bash and Python commands in my IPython shell without risking destructive commands?","acceptedAnswer":{"@type":"Answer","text":"Use the safecmd and safepyrun packages, which check commands against an allowlist before execution. The bash tool from safecmd rejects disallowed commands like rm -fr / with a DisallowedCmd exception, while RunPython from safepyrun raises a PermissionError for unauthorized filesystem operations, letting an AI tool-call bash and Python while blocking destructive actions. developers wiring AI tool execution into their own shells often compare sandboxing approaches on daily.dev."}},{"@type":"Question","name":"How can an AI assistant access the context of previous commands and outputs in an IPython session?","acceptedAnswer":{"@type":"Answer","text":"IPython's built-in HistoryManager stores executed code in In/Out along with a history_manager.outputs dictionary holding stream, text, and image outputs per cell, plus history_manager.exceptions for tracebacks. A helper function can walk recent cells, pull sources and outputs, and format them as tagged context (code, output, error) to feed into an AI chat call. daily.dev helps developers track patterns like this for giving AI tools richer session context."}}]}
```

