Python-powered, cross-platform, Unix-gazing shell.


Start an interactive shell session

$ xonsh

Execute a single command and then exit
$ xonsh -c "[command]"

Run commands from a script file and then exit
$ xonsh [path/to/script_file.xonsh]

Define environment variables for the shell process
$ xonsh -D[name1]=[value1] -D[name2]=[value2]

Load the specified .xonsh or .json configuration files
$ xonsh --rc [path/to/file1.xonsh] [path/to/file2.json]

Skip loading the .xonshrc configuration file
$ xonsh --no-rc


Xonsh is a Python-ish shell language and command prompt. Unlike other shells, xonsh is based on Python, with additional syntax added that makes calling subprocess commands, manipulating the environment, and dealing with the file system easy. Xonsh supports all normal Python constructs and a subset of those available in bash.

usage: xonsh [-h] [-V] [-c COMMAND] [-i] [-l] [--rc RC [RC ...]] [--no-rc]

[--no-script-cache] [--cache-everything] [-D ITEM] [--shell-type SHELL_TYPE] [--timings] [script-file] ...


positional arguments:


If present, execute the script in script-file and exit.


Additional arguments to the script specified by script-file.

optional arguments:

-h, --help

Show help and exit.

-V, --version

Show version information and exit.


Run a single command and exit.

-i, --interactive

Force running in interactive mode.

-l, --login

Run as a login shell.

--rc RC [RC ...]

The xonshrc files to load, these may be either xonsh files or JSON-based static configuration files.


Do not load the .xonshrc files.


Do not cache scripts as they are run.


Use a cache, even for interactive commands.


Define an environment variable, in the form of -DNAME=VAL. May be used many times.

--shell-type SHELL_TYPE

What kind of shell should be used. Possible options: b, best, d, dumb, ptk, ptk1, ptk2, prompt-toolkit, prompt_toolkit, prompt-toolkit1, prompt-toolkit2, prompt-toolkit3, prompt_toolkit3, ptk3, rand, random, rl, readline. Warning! If set this overrides $SHELL_TYPE variable.


Prints timing information before the prompt is shown. This is useful while tracking down performance issues and investigating startup times.


The run control file is written in xonsh script and executed once at start-up.


System-wide run control file


Per-user run control file

In addition to the run control file, a JSON formatted static file can be used to set runtime parameters and environment variables before the xonshrc files are executed.


Per-user static config file

Copied to clipboard