A simple shell (command prompt) made in python featuring a command handler.
- Note: Python will be automatically downloaded by Rye
- Rye
Works and was tested on the following environments:
- Windows
- Linux
Not that it should work under MACOS too but wasn't tested
- Clone using git (or download zip using the green button):
git clone https://github.com/0x454d505459/Py-Shell
- Change directory to Py-Shell:
cd Py-Shell
- Install the requirements using Rye:
rye sync
- Run shell.py
rye run python shell.py
- Change into the
commands
directory - Copy the
template.txt
as<command_name>.py
(make sure you replace<command_name>
with the command's name, this will be used by the command handler to invoke it) - Fillin the required variables located at the top (
description
andusage
, if command doesn't have any usage examples, leave usage empty) - Start coding
- the
run
function will be executed every time the command is entered in the shell, put any code needing to be ran multiple times here ro_path
argument is read_only, changing it won't affect the pathconstructor
is a MUST HAVE function, it will be called by the command handler to get the necessary informations to run the command, it will be called only at startuprun
also is a MUST HAVE, you can rename it if you want but make sure changes are reflected in theconstructor
function- All imports should be outside of the run function
All commits made by Me (0x454d505459) fall under GPLv3 and Later licenses. For other commits please contact their commiters.