Pyash is a feature-rich, highly portable, and deeply customizable Unix shell emulator coded entirely in clean modular Python. Designed primarily as a secure sandbox environment, Pyash restricts file operations strictly to a designated "shell" folder, preventing directory traversal and protecting your host machine.
Whether you are looking for an educational tool to study shell or Python mechanics, a safe terminal environment for a Capture The Flag (CTF) game, or just a fun text-based interface to play with, Pyash delivers a native-feeling terminal experience right in your Python runtime.
-
Secure Sandbox Environment: Pyash operates fully in a sandboxed "shell" folder, Pyash specifically leverages
os.path.commonpathto ensure users absolutely cannot read, write, or navigate to files outside the designated "shell" root folder. -
Command Chaining (
&&): Supports sequential execution and if a command fails, the chain safely halts. -
Stream Piping (
|): Custom text-stream pipeline architecture allows you to seamlessly pass data across utilities (e.g.,cat file.txt | head). -
Colored Output and Output History: Built-in persistent history (.pyash_history) and crisp terminal color coding powered by
colorama. -
Support for Extra Commands: More commands can easily be added by modifying the ".pyash_extras" file that Pyash creates in its "shell" folder
-
Battery-Included Utilities: Native Python rewrites of classic coreutils:
Navigation & Files Description cdChange the current directory pwdDisplay the current working directory ls (-a, -l)List files in the current directory mkdirCreates a new directory (folder) rmdirRemoves an empty directory rmDeletes files or directories touchCreates a new empty file or changes a file cpCopies files or directories mvMoves or renames files or directories Text Processing Description catDisplays the contents of a file headShows the first lines of a file tailShows the last lines of a file echo (>, >>)Prints text to the terminal System & Info Description unameDisplays system information uptimeShows how long the system has been running whoamiShows the current user dateDisplays the current date and time treeDisplays files and directories in a tree chmodChanges file permissions historyShow previously executed commands exitExit the shell Extras Description fortuneDisplays a random quote or message pyimA line-based text editor built for Pyash ddCopies or transforms data at a low level manA localized manual paging system
Read INSTRUCTIONS.txt for more info.
Pyash only works on Unix based Operating Systems (so Linux, BSD, MacOS, etc).
Pyash relies primarily on the Python Standard Library. You only need to install colorama for terminal colors:
pip install coloramagit clone https://github.com/Jb0x0/Pyash.git
cd Pyash/pyash
python3 Pyash.py
Distributed under the MIT License. See LICENSE for more information. This grants you full rights to use, modify, study, and distribute this codebase in both private and commercial environments.