2020-10-19 23:06:00 +03:00
xonsh
=====
2021-02-04 11:45:37 -05:00
.. class :: center
2024-07-09 10:45:56 +02:00
**xonsh** is a Python-powered shell. Full-featured and cross-platform. The language is a superset of Python 3.6+ with additional shell primitives. Xonsh word was made from *conch* (🐚, *@* ) and indicates belonging to the command shells world.
2021-02-04 11:45:37 -05:00
2024-07-06 01:28:49 +02:00
.. list-table ::
:widths: 1 1
2021-02-04 11:45:37 -05:00
2024-07-06 01:28:49 +02:00
* - **Xonsh is the Shell**
- **Xonsh is Python**
* - .. code-block:: shell
cd $HOME
id $(whoami)
cat /etc/passwd | grep root > ~/root.txt
$PROMPT = '@ '
2024-07-08 20:29:00 +02:00
2024-07-06 01:28:49 +02:00
- .. code-block:: python
2 + 2
var = "hello".upper()
import json; json.loads('{"a":1}')
[i for i in range(0,10)]
* - **Xonsh is the Shell in Python**
- **Xonsh is Python in the Shell**
2021-02-04 11:45:37 -05:00
2024-07-06 01:28:49 +02:00
* - .. code-block:: python
len($(curl -L https://xon.sh))
$PATH.append('/tmp')
p'/etc/passwd'.read_text().find('root')
2024-08-08 15:29:18 +02:00
xontrib load dalias
2024-07-06 01:28:49 +02:00
id = $(@json docker ps --format json)['ID']
- .. code-block:: python
name = 'foo' + 'bar'.upper()
echo @(name) > /tmp/@(name)
ls @(input('file: '))
2024-08-08 15:29:18 +02:00
touch @([f"file{i}" for i in range(0,10)])
2024-07-06 01:28:49 +02:00
aliases['e'] = 'echo @(2+2)'
aliases['a'] = lambda args: print(args)
2024-07-08 20:29:00 +02:00
2024-07-06 01:28:49 +02:00
If you like xonsh, :star: the repo, `write a tweet`_ and stay tuned by watching releases.
.. class :: center
2021-02-04 11:45:37 -05:00
2024-04-29 16:01:02 +02:00
.. image :: https://img.shields.io/badge/Zulip%20Community-xonsh-green
:target: https://xonsh.zulipchat.com/join/hbvue5rimpdkwkdjuiqfs7tv/
:alt: Join to xonsh.zulipchat.com
2021-02-04 11:45:37 -05:00
2024-04-29 10:15:16 -04:00
.. image :: https://github.com/xonsh/xonsh/actions/workflows/test.yml/badge.svg
:target: https://github.com/xonsh/xonsh/actions/workflows/test.yml
:alt: GitHub Actions
2021-02-04 11:45:37 -05:00
2021-08-30 23:42:08 +05:30
.. image :: https://codecov.io/gh/xonsh/xonsh/branch/master/graphs/badge.svg?branch=main
:target: https://codecov.io/github/xonsh/xonsh?branch=main
:alt: codecov.io
2024-04-29 10:15:16 -04:00
2023-03-16 19:15:26 +06:00
.. image :: https://repology.org/badge/tiny-repos/xonsh.svg
:target: https://repology.org/project/xonsh/versions
:alt: repology.org
2023-03-17 20:27:03 +07:00
2024-07-06 01:28:49 +02:00
2020-10-18 03:37:35 +03:00
First steps
***** ***** *
2020-09-23 09:19:53 +03:00
2022-07-29 13:40:26 +06:00
Install xonsh from pip:
.. code-block :: xonshcon
python -m pip install 'xonsh[full]'
And visit https://xon.sh for more information:
2020-09-23 09:19:53 +03:00
- `Installation <https://xon.sh/contents.html#installation> `_ - using packages, docker or AppImage.
- `Tutorial <https://xon.sh/tutorial.html> `_ - step by step introduction in xonsh.
2022-07-14 23:51:40 +03:00
Extensions
***** *****
2023-03-17 13:25:22 +06:00
2024-04-29 10:15:16 -04:00
Xonsh has an extension/plugin system. We call these additions `` xontribs `` .
2023-03-17 13:25:22 +06:00
- `Xontribs on Github <https://github.com/topics/xontrib> `_
- `Awesome xontribs <https://github.com/xonsh/awesome-xontribs> `_
- `Core xontribs <https://xon.sh/api/_autosummary/xontribs/xontrib.html> `_
2022-07-29 13:38:43 +06:00
- `Create a xontrib step by step from template <https://github.com/xonsh/xontrib-template> `_
2016-05-14 18:59:14 -04:00
2023-03-17 12:22:48 +06:00
Projects that use xonsh or compatible
***** ***** ***** ***** ***** ***** ***** **
2016-05-14 18:59:14 -04:00
2024-07-18 13:26:59 +02:00
- `conda <https://conda.io/projects/conda/en/latest/> `_ and `mamba <https://mamba.readthedocs.io/en/latest/> `_ : Modern package managers.
2024-07-18 13:28:02 +02:00
- `Starship <https://starship.rs/> `_ : Cross-shell prompt.
- `zoxide <https://github.com/ajeetdsouza/zoxide> `_ : A smarter cd command.
2023-03-17 12:22:48 +06:00
- `gitsome <https://github.com/donnemartin/gitsome> `_ : Supercharged Git/shell autocompleter with GitHub integration.
- `xxh <https://github.com/xxh/xxh> `_ : Using xonsh wherever you go through the SSH.
2024-03-06 16:37:19 +07:00
- `any-nix-shell <https://github.com/haslersn/any-nix-shell> `_ : xonsh support for the `` nix run `` and `` nix-shell `` environments of the Nix package manager.
2024-07-12 00:39:28 +02:00
- `lix <https://github.com/lix-project/lix> `_ : A modern, delicious implementation of the Nix package manager.
2024-07-18 13:28:02 +02:00
- `x-cmd <https://www.x-cmd.com/> `_ : x-cmd is a vast and interesting collection of tools guided by the Unix philosophy.
- `rever <https://regro.github.io/rever-docs/> `_ : Cross-platform software release tool.
- `Regro autotick bot <https://github.com/regro/cf-scripts> `_ : Regro Conda-Forge autoticker.
2021-02-04 11:45:37 -05:00
2023-03-17 12:22:48 +06:00
Jupyter-based interactive notebooks via `xontrib-jupyter <https://github.com/xonsh/xontrib-jupyter> `_ :
2024-05-10 11:03:44 +02:00
- `Jupyter and JupyterLab <https://jupyter.org/> `_ : Interactive notebook platform.
2023-03-17 12:22:48 +06:00
- `euporie <https://github.com/joouha/euporie> `_ : Terminal based interactive computing environment.
2024-05-10 11:03:44 +02:00
- `Jupytext <https://jupytext.readthedocs.io/> `_ : Clear and meaningful diffs when doing Jupyter notebooks version control.
2021-12-03 17:39:19 +03:00
The xonsh shell community
***** ***** ***** ***** *****
2024-04-29 10:15:16 -04:00
The xonsh shell is developed by a community of volunteers. There are a few ways to help out:
2023-03-17 17:41:28 +06:00
2024-07-04 16:48:01 +02:00
- Solve a `popular issue <https://github.com/xonsh/xonsh/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc> `_ or `high priority issue <https://github.com/xonsh/xonsh/issues?q=is%3Aopen+is%3Aissue+label%3Apriority-high+sort%3Areactions-%2B1-desc> `_ or a `good first issue <https://github.com/xonsh/xonsh/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+sort%3Areactions-%2B1-desc> `_ . You can start with the `Developer guide <https://xon.sh/devguide.html> `_ .
2024-04-29 10:15:16 -04:00
- Take an `idea <https://github.com/xonsh/xontrib-template/issues?q=is%3Aopen+is%3Aissue+label%3Aidea+sort%3Areactions-%2B1-desc> `_ and `create a new xontrib <https://github.com/xonsh/xontrib-template#why-use-this-template> `_ .
2024-09-24 13:38:32 +02:00
- Contribute to `xonsh API <https://github.com/xonsh/xonsh/tree/main/xonsh/api> `_ .
- Become xonsh core developer by deep diving into xonsh internals. E.g. we feel a lack of Windows support.
2024-04-17 17:34:57 +05:30
- `Become a sponsor to xonsh <https://github.com/sponsors/xonsh> `_ .
- `Write a tweet`_ , post or an article to spread the good word about xonsh in the world.
2023-09-04 20:18:35 +06:00
- Give a star to xonsh repository and to `xontribs <https://github.com/topics/xontrib> `_ you like.
2023-03-17 17:41:28 +06:00
We welcome new contributors!
2021-12-03 17:39:19 +03:00
2021-02-04 11:45:37 -05:00
.. _write a tweet: https://twitter.com/intent/tweet?text=xonsh%20is%20a%20Python-powered,%20cross-platform,%20Unix-gazing%20shell%20language%20and%20command%20prompt.&url=https://github.com/xonsh/xonsh
2024-04-29 16:01:02 +02:00
Credits
***** **
2024-04-29 10:15:16 -04:00
- Thanks to `Zulip <https://zulip.com/> `_ for supporting the xonsh community!