A feature-rich, customizable Unix shell implementation written in Python with theme support, job control, and comprehensive command handling.
- Interactive Command Execution - Full support for executing system commands with proper I/O handling
- Theme Support - 5 built-in themes (Dracula, Solarized Dark, Nord, Monokai, Gruvbox) plus custom themes
- Job Control - Background and foreground job management with
jobs,fg, andbgcommands - Pipeline Support - Chain commands using the pipe operator (
|) - Output Redirection - Redirect output and error streams to files (
>,>>,2>,2>>) - Command Aliases - Create and manage command aliases
- History Management - Full command history with persistence and custom history files
- Tab Completion - Smart tab completion for commands and file paths
- Signal Handling - Proper handling of SIGINT, SIGTSTP, SIGQUIT, and SIGWINCH
- PTY Support - Interactive programs (vim, git, ssh, etc.) run with proper terminal control
- Security - No external dependencies, safe input handling, no eval/exec
pip install phoenixnebula-cli
phoenixnebulagit clone https://github.com/SysTechSalihY/phoenixnebula.git
cd phoenixnebula
sudo python3 setup.py install
phoenixnebuladocker pull nobodydeveloper/phoenixnebula:latest
docker run -it nobodydeveloper/phoenixnebula:latestPhoenixNebula can be distributed as a standalone binary, so users can run it without installing Python.
Install PyInstaller:
pip install pyinstaller
git clone https://github.com/SysTechSalihY/phoenixnebula.git
cd phoenixnebula
pyinstaller --onefile phoenixnebula/phoenixnebula.py
Run it directly: ./dist/phoenixnebula
### From source (Development)
```bash
git clone https://github.com/SysTechSalihY/phoenixnebula.git
cd phoenixnebula
pip install -e .
phoenixnebula$ echo "Hello, World!"
Hello, World!
$ pwd
/home/user
$ cd Documents
$ ls -laAppend & to run a command in the background:
$ sleep 100 &
[1] 12345
$ jobs
[1] Running sleep 100
$ fg %1$ cat file.txt | grep "search_term" | wc -l$ echo "text" > output.txt # Write to file
$ echo "text" >> output.txt # Append to file
$ command 2> errors.txt # Redirect stderr
$ command 2>> errors.txt # Append stderr$ theme list
Available themes:
- dracula *
- nord
- solarized_dark
- monokai
- gruvbox
$ theme set nord
Theme applied: NordCreate ~/.phoenixnebularc for aliases and settings:
alias ll=ls -la
alias ..=cd ..
alias gs=git status
export PS1="\u@\h \w\$ "PhoenixNebula comes with 5 built-in themes. Create custom themes at ~/.phoenixnebula/themes/mytheme.json:
{
"name": "My Custom Theme",
"background": "#1e1e1e",
"foreground": "#e0e0e0",
"cursor_color": "#e0e0e0",
"black": "#000000",
"red": "#ff0000",
"green": "#00ff00",
"yellow": "#ffff00",
"blue": "#0000ff",
"purple": "#ff00ff",
"cyan": "#00ffff",
"white": "#ffffff",
"bright_black": "#808080",
"bright_red": "#ff8080",
"bright_green": "#80ff80",
"bright_yellow": "#ffff80",
"bright_blue": "#8080ff",
"bright_purple": "#ff80ff",
"bright_cyan": "#80ffff",
"bright_white": "#ffffff",
"prompt_user": "#00ff00",
"prompt_host": "#00ffff",
"prompt_path": "#ffff00",
"prompt_symbol": "#ff00ff"
}Then apply it:
$ theme set mytheme| Command | Usage | Description |
|---|---|---|
cd |
cd [directory] |
Change current directory |
pwd |
pwd |
Print working directory |
echo |
echo [text] |
Print text to output |
exit |
exit [code] |
Exit the shell |
type |
type <command> |
Display command type |
clear |
clear |
Clear terminal screen |
| Command | Usage | Description |
|---|---|---|
history |
history [n] |
Show last n commands |
history -r <file> |
Load history from file | |
history -w <file> |
Write history to file | |
history -a <file> |
Append history to file |
| Command | Usage | Description |
|---|---|---|
alias |
alias |
List all aliases |
alias [name]=[value] |
alias ll='ls -la' |
Create alias |
unalias |
unalias <n> |
Remove alias |
| Command | Usage | Description |
|---|---|---|
export |
export VAR=value |
Set environment variable |
unset |
unset VAR |
Unset environment variable |
set |
set [VAR=value] |
Get/set shell variables |
| Command | Usage | Description |
|---|---|---|
jobs |
jobs |
List background jobs |
fg |
fg %jobid |
Bring job to foreground |
bg |
bg %jobid |
Resume job in background |
| Command | Usage | Description |
|---|---|---|
theme |
theme |
Show available themes |
theme list |
List all themes | |
theme set <n> |
theme set dracula |
Apply theme |
theme current |
Show current theme |
Chain multiple commands with pipes:
$ cat data.txt | sort | uniq | wc -lExpand environment variables:
$ echo $HOME
/home/user
$ echo ${PATH}
/usr/local/bin:/usr/bin:/binHome directory shortcut:
$ cd ~/Documents
$ cat ~/.bashrcThe shell automatically detects and runs interactive programs with proper terminal control:
$ vim file.txt
$ git commit
$ python3- No External Dependencies - Uses only Python standard library
- Safe Input Handling - All input is validated and parsed safely using
shlex - No Code Injection - Never uses
eval(),exec(), or__import__() - Secure Variable Expansion - Variables are safely expanded with fallbacks
- Signal Safety - Proper signal handling without race conditions
- Process Isolation - Background jobs properly isolated using process groups
See SECURITY.md for detailed security information.
Run the comprehensive test suite:
# Install test dependencies
pip install pytest pytest-cov
# Run all tests
pytest tests/ -v
# Run with coverage report
pytest tests/ -v --cov=phoenixnebula
# Run specific test class
pytest tests/test_phoenixnebula.py::TestSecurityInputValidation -vphoenixnebula/
βββ phoenixnebula/
β βββ __init__.py
β βββ phoenixnebula.py
βββ tests/
β βββ test_phoenixnebula.py
βββ Dockerfile
βββ Dockerfile.prod
βββ docker-compose.yml
βββ setup.py
βββ setup.cfg
βββ pyproject.toml
βββ MANIFEST.in
βββ README.md
βββ LICENSE
βββ .gitignore
Ctrl+C- Cancel current commandCtrl+Z- Suspend current commandCtrl+D- Exit shell (EOF)Tab- Auto-complete command or file pathUp/Down Arrows- Navigate command historyCtrl+R- Reverse history search (if supported)
| Variable | Description |
|---|---|
PATH |
Search path for executables |
HOME |
User's home directory |
HISTFILE |
Location of command history file |
SHELL |
Current shell name |
USER |
Current user name |
HOSTNAME |
System hostname |
Check your ~/.phoenixnebularc file for errors:
cat ~/.phoenixnebularcEnsure the history file location is writable:
export HISTFILE=~/.phoenixnebula_historyVerify Python readline module is available:
python3 -c "import readline; print('readline available')"Ensure your terminal emulator supports ANSI escape codes and PTY operations. Try clearing the screen:
clearTry resetting the terminal:
reset
phoenixnebulaContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by bash, zsh, and other Unix shells
- Theme colors from popular terminal themes
- Built with Python's standard library
For issues, questions, or suggestions:
- Check existing GitHub Issues
- Create a new issue with detailed description
- Submit a Pull Request with improvements
If you discover a security vulnerability, please email salihyilboga98@gmail.com instead of using the issue tracker.
Enjoy using PhoenixNebula! π
For more information and advanced usage, visit the GitHub repository.