Xonsh in TOP10 trending projects
We're listing down the top 10 trending open-source projects In Python on GitHub and the xonsh shell is one of these projects.
The xonsh as a python shell lets you easily mix Python and shell commands in a powerful and simplified approach to the command line.
The xonsh language has shell primitives that you are used to from Bash. Read more →
cd /home cat /etc/passwd | grep root ls -la
The xonsh language is a superset of Python 3.6+ and you can run Python code and import modules. Read more →
2 + 2 import json j = json.loads('{"Hello": "world!", "Answer": 42}') print(j['Answer'])
With xonsh you can combine Python with shell commands. Read more →
len($(curl -L https://xon.sh)) for filename in `.*`: print(filename) du -sh @(filename)
Prepare environment variables and arguments in Python and use them in shell commands. Read more →
var = 'he' + 'llo' echo @(var) > /tmp/@(var) echo @(i for i in range(42))
Xonsh is a super-charged shell that enables you to work quickly and effectively! Some of the features that help set xonsh apart are:
The language is a superset of Python 3.6+ with additional shell primitives that you are used to from Bash and IPython.
Xontributions, or xontribs, are a set of tools and conventions for extending the functionality of xonsh.
The xonsh shell creates history files with rich structure and metadata and an API for interacting with them.
Customisable tab completion, key bindings, color styles are on board by default.
Xonsh can be installed and run with various package managers, by using appimage, or from a docker container.
When using xonsh as a default shell (and we do!), it's important to ensure that it is installed in a Python environment that is independent of changes from the system package manager. If you are installing xonsh via your system package-manager, this is handled for you. If you install xonsh outside of your system package manager, you can use xonsh-install for this.
AppImage is a format for distributing portable software on Linux without needing superuser permissions to install the application. The xonsh AppImage file contains both xonsh and Python and allows xonsh to be run on any AppImage-supported Linux distribution without installation or root access.
Download and run:
wget https://github.com/xonsh/xonsh/releases/latest/download/xonsh-x86_64.AppImage chmod +x xonsh-x86_64.AppImage ./xonsh-x86_64.AppImageLearn more →
Xonsh publishes a handful of containers, primarily targeting CI and automation use cases. All of them are published on Docker Hub.
Run the xonsh shell in a small size docker container:
docker run -it --rm xonsh/xonsh:slim
Another way is to install xonsh from the package manager that is supplied by the operating system. This way is not recommended because in operating systems without the rolling release concept the xonsh shell version may be very old (check latest release).
OSX brew:
brew install xonsh
Debian/Ubuntu apt:
apt install xonsh
Arch Linux pacman:
pacman -S xonsh
Fedora dnf:
dnf install xonsh
GNU guix:
guix install xonsh
Xontributions, or xontribs, are a set of tools and conventions for extending the functionality of xonsh.
Let your pipe lines from the standard output flow thru the Python code in the xonsh shell.
Get identifiers, paths, URLs and words from the previous command output and use them for the next command in the xonsh shell.
Return to the most recently used directory when starting the xonsh shell.
Argcomplete support to tab completion of python and xonsh scripts in the xonsh shell.
Some interesting publications around xonsh.
We're listing down the top 10 trending open-source projects In Python on GitHub and the xonsh shell is one of these projects.
A. Scopatz and G. Forsyth gave a two hour presentation of xonsh.