Xonsh is a Python-powered shell. Full-featured and cross-platform. The language is a superset of Python 3.6+ with additional shell primitives. The name Xonsh should be pronounced like "consh" - a softer form of the word "conch" (π, @), referring to the world of command shells.
| Xonsh is the Shell | Xonsh is Python |
cd $HOME
id $(whoami) > ~/id.txt
cat /etc/passwd | grep root
$PROMPT = '@ ' |
2 + 2
var = "hello".upper()
@.imp.json.loads('{"a":1}')
[i for i in range(0,10)] |
| Xonsh is the Shell in Python | Xonsh is Python in the Shell |
len($(curl -L https://xon.sh))
$PATH.append('/tmp')
p'/etc/passwd'.read_text().find('root')
xontrib load dalias # plugin
$(@json docker ps --format json)['ID'] |
name = 'snail'
echo @(name) > /tmp/@(name)
with p'/tmp/dir'.mkdir().cd():
touch @(input('File: '))
aliases['e'] = 'echo @(2+2)'
aliases['a'] = lambda args: print(args) |
| Xonsh is a Meta-Shell | Xonsh is an Ecosystem |
xontrib load sh \
fish_completer
def nudf(cmd):
return @.imp.pandas.DataFrame(
@.imp.json.loads(
$(nu -c @(cmd + ' | to json'))
)
)
nudf!(ls -la) |
xontrib load term_integration \
prompt_starship \
powerline \
dracula \
chatgpt \
django \
jupyter \
1password \
github_copilot \
history_encrypt |
If you like xonsh, β the repo and spread the word about xonsh.
Install xonsh from pip:
python -m pip install 'xonsh[full]'And visit https://xon.sh for more information:
- Installation - using packages, docker or AppImage.
- Tutorial - step by step introduction in xonsh.
Some beginners find the xonsh cheatsheet a helpful place to start.
Xonsh has an extension/plugin system. We call these additions xontribs.
- conda and mamba: Modern package managers.
- Starship: Cross-shell prompt.
- zoxide: A smarter cd command.
- gitsome: Supercharged Git/shell autocompleter with GitHub integration.
- xxh: Using xonsh wherever you go through the SSH.
- Snakemake: A workflow management system to create reproducible and scalable data analyses.
- any-nix-shell: xonsh support for the
nix runandnix-shellenvironments of the Nix package manager. - lix: A modern, delicious implementation of the Nix package manager.
- x-cmd: x-cmd is a vast and interesting collection of tools guided by the Unix philosophy.
- rever: Cross-platform software release tool.
- Regro autotick bot: Regro Conda-Forge autoticker.
Jupyter-based interactive notebooks via xontrib-jupyter:
- Jupyter and JupyterLab: Interactive notebook platform.
- euporie: Terminal based interactive computing environment.
- Jupytext: Clear and meaningful diffs when doing Jupyter notebooks version control.
The xonsh shell is developed by a community of volunteers. There are a few ways to help out:
- Solve a popular issue or high priority issue or a good first issue. You can start with the Developer guide. Feel free to use LLM e.g. Github Copilot.
- Take an idea and create a new xontrib.
- Contribute to xonsh API.
- Become xonsh core developer by deep diving into xonsh internals. E.g. we feel a lack of Windows support.
- Add xonsh support in third party tool: package manager, terminal emulator, console tool, IDE.
- Design more logos and images, improve xonsh website (src).
- Become a sponsor to xonsh.
- Spread the good word about xonsh in the world by sharing news and notes about xonsh.
- Give a star to xonsh repository and to xontribs you like.
We welcome new contributors!
- Thanks to Zulip for supporting the xonsh community!
- Thanks to ADS.FUND for supporting xonsh token!