Yet another shell can run anywhere Python exists.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

PySh Build Status

Yet another shell can run anywhere Python exists.

Why another shell

Because it's fun.

Supported shell feature

Common shell features can be found here. Pysh already have:

  • |, Pipe output
  • $var, Use value for variable
  • " ", Double quote (allows variable and command expansion)
  • *, Match any character(s) in filename
  • ?, Match single character in filename
  • [ ], Match any characters enclosed


git clone
cd pysh
python -m

## Demo
> ls README*

> ls README.??

> echo $HOME

> echo ${JAVA_HOME}

> pwd

> cd ..

> pwd

> cat /etc/hosts | grep       localhost

> grep /etc/hosts       localhost

Supported commands can be found here.

More commands are on the way. PR welcomed !

Have fun 😄

How PySh work

A shell in unix box is a bridge bewteen user and the kernel through system call.

how unix shell work

As we can see from above picture (taken from here), some commands (eg ls, cat) are passed to other programs, while built-in commands (eg cd, exit) are executed inside shell. This way can keep shell small in size and strong in function.

In order to let PySh run anywhere (hi, Windows, I mean you), PySh implmented all commands in its core, so there is no differences bewteen builtins and one that is not, also you can say all commands are builtins.

One thing I should mention here is:

Pipelines between commands are supported by generator in Python.

So, every command should yield something, this is like s-expression in Lisp world, where every s-expression should return a value.

How to contribute

PySh use pre-commit to ensure code quality, so you should install it before contribute.

Fork and PR 🍺



MIT License © Jiacai Liu

PySh is inspired from yosh.