skillfed

xonsh

Python-powered shell. Full-featured, cross-platform and AI-friendly.

xonsh v0.24.1 390.6K downloads/30d#7,021 on PyPI9,600
Permissive license BSD 2-Clause License Active released

What it is and what it does

Xonsh is a full-featured shell that treats Python 3 as its base language and adds shell syntax on top, rather than the reverse. You write commands using Python expressions, list comprehensions, and imports directly in the shell, and invoke external programs with shell-style syntax. It runs on Linux, macOS, Windows, BSD, and other platforms, and integrates with Jupyter notebooks.

The package is useful when you want to automate tasks, manage system operations, or explore data interactively without switching between a Python REPL and a traditional shell. It supports an extension system called xontribs for adding features like custom prompts, keybindings, and integrations with tools like Starship, ChatGPT, and GitHub Copilot. With no runtime dependencies, it installs cleanly and works out of the box.

Use it for:

  • Write shell scripts that leverage Python's data structures, comprehensions, and standard library without subprocess calls.
  • Interactively explore files and system state using Python syntax (e.g., p'/etc/passwd'.read_text()) alongside traditional commands.
  • Automate DevOps tasks by mixing shell commands with Python logic in a single script without context switching.
  • Build reproducible workflows in tools like Snakemake that need both shell commands and Python control flow.
  • Extend the shell with custom keybindings and event handlers using Python decorators and event hooks.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Xonsh is a Python-based shell that merges Python 3 syntax with shell commands, letting you write scripts and interactive sessions using both languages seamlessly in one environment.

Yes. Xonsh is actively maintained, has no external runtime dependencies, and offers a genuinely novel way to combine Python and shell scripting. It's worth trying if you spend significant time in both environments and want to unify them. The permissive license and broad platform support make it low-risk to evaluate. Start with the tutorial at xon.sh/tutorial.html to see if the syntax and workflow fit your needs.

Install

xonsh on PyPI

pip

pip install xonsh

uv

uv add xonsh

poetry

poetry add xonsh

Installing xonsh

Before you install

Low friction install with wheels available for Python 3.11 through 3.14. Active maintenance with a recent release (14 days old) and steady community engagement (9600 GitHub stars). No runtime dependencies to manage.

License in practice

BSD 2-Clause License is permissive, allowing use in both open-source and proprietary projects with minimal restrictions beyond attribution.

Quickstart

pip install xonsh

# Start the shell
xonsh

# In xonsh, mix Python and shell:
echo @('hello'.upper())
var = $(ls -la)
print(len(var))

Requires Python 3.11 or later.

Verify before relying

  • Whether xonsh works identically across all advertised platforms (Linux, macOS, Windows, BSD, Jupyter, Android, Raspberry Pi) or if some have limitations.
  • Performance characteristics when running complex Python scripts or long-running shell sessions compared to traditional shells.
  • Compatibility with existing shell scripts written for bash or zsh without modification.

Package facts

License BSD 2-Clause License (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 14 days since the last release
Last repo commit
First released
Downloads 390,560/month — #7,021 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: xonsh-0.24.1-py311-none-any.whl; xonsh-0.24.1-py312-none-any.whl; xonsh-0.24.1-py313-none-any.whl; xonsh-0.24.1-py314-none-any.whl

Tags

python shell interpretercross-platform shell scriptingpython command line interfaceshell with python syntaxinteractive python shell environmentbash alternative pythonpython-powered terminal
shell-scriptingpython-replcross-platform

More Terminals packages