https://github.com/g000d1ess/snakeshell
🐍 SnakeShell: a Bash-like Unix Shell in Python
https://github.com/g000d1ess/snakeshell
bash cli console linux python shell snake unix unix-shell
Last synced: 6 months ago
JSON representation
🐍 SnakeShell: a Bash-like Unix Shell in Python
- Host: GitHub
- URL: https://github.com/g000d1ess/snakeshell
- Owner: G000D1ESS
- License: mit
- Created: 2024-02-09T20:45:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-01T20:18:15.000Z (over 1 year ago)
- Last Synced: 2025-10-27T07:26:12.068Z (7 months ago)
- Topics: bash, cli, console, linux, python, shell, snake, unix, unix-shell
- Language: Python
- Homepage:
- Size: 112 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🐍 SnakeShell: A Bash-like Unix Shell in Python



Welcome to **SnakeShell**! 🎉
This project aims to develop a Unix shell similar to Bash, written in Python and utilizing the PEG parser [TatSu](https://github.com/neogeny/TatSu). SnakeShell is designed to replicate core functionalities of traditional Unix shells while incorporating modern features.
## 📚 Table of Contents
- [Features](#-features)
- [Installation](#-installation)
- [Usage](#-usage)
- [Roadmap](#-roadmap)
- [Contributing](#-contributing)
- [License](#-license)
## 🌟 Features
- ✨ **Process Management**: Forking, executing, and waiting for processes
- ✨ **File Redirection and Pipes**: Input/output redirection and command pipelines
- 🚧 **Job Control**: Background processes and signal handling
- ⏳ **Quoting and Expansion**: Variable expansion and globbing
- ⏳ **Interactive Features**: Command history and auto-completion
## 🚀 Installation
### Install with pip (Recommended):
- Install SnakeShell from PyPI:
```bash
python3 -m pip install cobrashell
```
### From Source:
1. **Clone the repository**
```bash
git clone https://github.com/G000D1ESS/snakeshell.git
```
2. **Navigate to the project directory**
```bash
cd snakeshell
```
3. **Run the installation**
```bash
python3 -m pip install .
```
## 🎮 Usage
To use this Unix Shell, follow these steps:
1. **Start the shell by executing the command:**
```bash
snake
```
2. **Enter commands in the interactive shell and press Enter to execute them.**
Example commands:
```bash
ls -l
cd /path/to/directory
mkdir new_directory
```
## 📋 Roadmap
### Development Stages
#### Stage 1: Fork/Exec/Wait ✅
- Basics of Unix processes
- Implement the simplest possible shell
- Support built-in commands like `cd`, `exec`, etc.
- Search for commands in `PATH`
- Handle exit statuses and the `!` operator
- Support command lists using `;`, `&&`, and `||`
- Support subshells and line continuation
#### Stage 2: Files and Pipes ✅
- Implement file descriptor redirection (`<`, `>`, `>>`, `<>`)
- Support pipes between commands (`|`)
- Handle file descriptor duplication (`<&`, `>&`)
- Implement process and command substitution (`<(...)`, `$(...)`)
- Ensure proper handling of file descriptors and inheritance
#### Stage 3: Job Control and Signals 🚧
- Discuss signals and support for keyboard shortcuts like `Ctrl+C`, `Ctrl+\`, and `Ctrl+Z`
- Implement background processes and job control (`&`, `jobs`, `fg`, `bg`)
- Ensure proper handling of sessions and process groups
#### Stage 4: Quoting and Expansion ⏳
- Handle environments and variables
- Implement globbing (wildcard matching)
- Support quoting and character escaping
- Handle alias and function expansions
#### Stage 5: Interactivity ⏳
- Enhance the shell for interactive work
- Support command history
- Implement auto-completion
- Customize prompts and themes
## 📄 License
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
---
Feel free to ⭐ star the repository if you find it interesting!