XONSH(1)
π¦ NAME π¦
xonsh β Pythonish, BASHwards looking shell π
π DESCRIPTION π
okay so. xonsh is a Python-ish shell language AND a command prompt, bestie. unlike other shells, xonsh is based on Python, with extra syntax sprinkled on top that makes calling subprocess commands, messing with the environment, and wrangling the file system actually easy. and the range? it supports all normal Python constructs plus a subset of the ones you'd find in bash. it's giving "why not both" and honestly it ate. π₯
here's the usage, verbatim, no cap:
usage: xonsh [-h] [-V] [-c COMMAND] [-n] [-i] [-l] [--rc RC [RC ...]]
[--no-rc] [--no-env] [--no-script-cache] [--cache-everything] [-D
ITEM] [-st SHELL_TYPE] [--timings] [--save-origin-env]
[--load-origin-env] [script-file] ...
xonsh
β¨ positional arguments β¨
script-fileβ if this is here, xonsh runs the script in script-file and then dips out. bye! πargsβ extra arguments you wanna hand off to the script that script-file points at.
πΈ options πΈ
-h,--helpβ shows the help and exits. classic.-V,--versionβ shows version info and exits. also classic.-c COMMANDβ runs a single command, then exits. one and done, main character behavior.-n,--no-executeβ parses and compiles the code but does not execute it. exits non-zero if there are errors. and bestie, if you want more options β like checking several files at once β go use thexonsh checksubcommand instead.-i,--interactiveβ forces interactive mode. you're gonna interact whether you like it or not π-l,--loginβ runs as a login shell.--rc RC [RC ...]β the xonshrc files to load. these can be xonsh files or directories that contain xonsh files. flexible queen π--no-rcβ don't load any xonsh RC files. heads up: the--rcargument gets ignored if--no-rcis set.--no-envβ don't inherit your parent environment variables.--no-script-cacheβ doesn't cache scripts when they run. no hoarding here.--cache-everythingβ uses a cache, even for interactive commands. maximalist energy π-D ITEMβ defines an environment variable, written as-DVAR=VAL, or inherits an existing variable with-DVAR. you can use this one many times.-st,--shell-type SHELL_TYPEβ what kind of shell should be used. possible options:b,best,d,dumb,ptk,prompt-toolkit,prompt_toolkit,rand,random,rl,readline.
β οΈ Warning! If you set this, it overrides the $SHELL_TYPE variable. it's not a suggestion, it's a takeover π₯
--timingsβ prints timing info before the prompt shows up. super useful when you're hunting down performance issues and investigating startup times. we love a diagnostics moment.--save-origin-envβ saves the origin environment variables before running xonsh. then use--load-origin-envto run xonsh with that saved origin environment. it's a matching set, iykyk π«Ά--load-origin-envβ loads the origin environment variables that were saved before running xonsh by using--save-origin-env.
π subcommands π
formatβ formats xonsh source files. runxonsh format --helpfor the options.checkβ checks xonsh source files for syntax errors without running them. runxonsh check --helpfor the options.lintβ lints xonsh source files for likely mistakes. runxonsh lint --helpfor the options.
π FILES π
so the run control file is written in xonsh script and gets executed once at start-up. one shot, one opportunity.
/etc/xonshrcβ system-wide run control file π~/.xonshrcβ per-user run control file β¨
and plot twist: on top of the run control file, there's a JSON formatted static file you can use to set runtime parameters and environment variables before the xonshrc files get executed. so it runs first. it's the opening act. π
$XDG_CONFIG_HOME/xonsh/config.jsonβ per-user static config file β
and that's the whole page bestie β this was xonsh, version xonsh/0.24.0, from August 2026, served fresh out of the User Commands manual. periodt. π
π
π¦ where this page comes from
- ubuntu stonking: xonsh 0.24.0+dfsg-1 Β· BSD-2-clause-xonsh
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms