PyShell is a lightweight, cross-platform, and customizable Python-based terminal application designed to provide a familiar shell experience with enhanced features. It offers essential command-line utilities, secure user account management, and detailed system information inspired by popular tools like Neofetch.
PyShell provides a robust set of functionalities to manage your system and enhance your command-line experience:
- Core Shell Commands: Emulates fundamental Unix-like commands including
mv(move),cp(copy),cd(change directory),ls(list contents),pwd(print working directory),rm(remove files),rmdir(remove empty directories),mkdir(create directories),touch(create/update files),echo(print text/redirect), andcat(display file contents). - User Account Management: Securely handles local user accounts with
signupandlogincommands. Passwords are protected using robustbcrypthashing. - System Information (
pyfetch): Displays comprehensive hardware and OS details such as CPU, GPU, operating system version, kernel information, system uptime, total and used memory, and screen resolution, presented in an easy-to-read format. - Interactive Terminal: Powered by
richlibrary for beautiful and consistent command-line output and interactive prompts. - Extensible Architecture: Designed with modularity in mind, allowing for straightforward addition of new commands and functionalities.
pyshell/
├── pyshell/
│ ├── pyshell.py # Main application entry point and command dispatcher.
│ ├── terminal.py # Centralized rich.Console instance and helper functions entry point.
├── assets/
│ ├── pyshell.png # Screenshot showcasing PyShell's interface.
├── shared/
│ ├── utils.py # Contains core PyShell commands, user management logic,
│ │ # and other general utility functions.
│ ├── pyfetch.py # Module for gathering and displaying system hardware information.
│ ├── cputils.py # Helper for CPU brand information (modified cpuinfo module).
│ └── __init__.py # Marks 'shared' as a Python package.
└── .gitignore # Git ignore file
├── Pipfile # Specifies project dependencies using pipenv.
├── Pipfile.lock # Locks specific versions of dependencies for reproducible builds.
├── LICENSE # Project's licensing information (Apache-2.0 License)
├── README.md # This README file, providing project overview and documentation.
-
Install pipenv (if you haven't already):
pip install pipenv
-
Clone the repository:
git clone https://github.com/hinmbo/pyshell.git cd pyshell -
Install dependencies and set up virtual environment:
pipenvwill read thePipfile, create a virtual environment (if one doesn't exist), and install all necessary packages.pipenv install
-
Run PyShell: Execute PyShell within the
pipenvshell. This command activates the virtual environment and runs the application.pipenv run python -m pyshell/pyshell.py
Alternatively, you can enter the pipenv shell and then run the command:
pipenv shell python -m pyshell.pyshell # Exit the pipenv shell when done: # exit
Note: If you encounter issues, ensure your Python executable is correctly added to your system's PATH.
Here are a few examples demonstrating PyShell's functionality:
- File Operations:
> mkdir test_dir > touch test_file.txt > mv test_file.txt test_dir/ - User Management:
> signup Username: alice Password: •••••• Retype password: •••••• <> 'bob' has been created successfully > login Enter username: alice Enter password: •••••• - System Information:
> pyfetch ┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ pyfetch ┃ System Information ┃ ┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ OS │ Windows 11 (v10.0.26100) │ │ Host │ SN1987A-S │ │ Kernel │ Windows NT kernel │ │ Uptime │ 5:37:04 │ │ Shell │ pyshell │ │ Resolution │ 1920x1080 │ ├────────────┼───────────────────────────────────────────────┤ │ CPU │ AMD Ryzen 5 5600X 6-Core Processor (6C / 12T) │ │ GPU │ NVIDIA GeForce RTX 3060 (VRAM: 12288MB) │ │ Memory │ 13365MB / 32694MB │ └────────────┴───────────────────────────────────────────────┘
Contributions are always weclome to PyShell! If you're interested in improving the project, please follow these steps:
- Fork the repository.
- Create a feature branch for your changes:
git checkout -b feature/your-feature-name
- Commit your changes with a clear and descriptive commit message:
git commit -m "feat: Add new command 'example' for demonstration" - Push your changes to your forked repository:
git push origin feature/your-feature-name
- Open a Pull Request.
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.
- Inspired by the functionality and spirit of traditional Unix-like shells and system information tools like Neofetch.
