Advanced Linux/Bash to PowerShell translator with ML, plugins, web API, and interactive shell support.
Project description
ShellRosetta Project Analysis & Implementation Summary
Translate Linux/Bash commands to PowerShell and vice versa—flags, pipes, networking, and more.
What is ShellRosetta?
ShellRosetta is a cross-platform CLI tool for developers, sysadmins, and anyone switching between Windows and Linux.
It instantly translates commands—including flags and arguments—between Linux/Bash and PowerShell. No more flipping between cheat sheets or Stack Overflow!
Features
- 🖥️ Interactive Shell Mode! Open ShellRosetta as a REPL and translate commands live, just like in a real shell.
- 🔄 Bi-directional translation: Linux ↔ PowerShell, with accurate mappings for real-world scenarios.
- 🏷️ Flag and multi-flag aware: Understands combos like
ls -alh,rm -rf, etc. - 🔗 Pipeline support: Handles piped commands (e.g.
ls -l | grep foo). - 🌐 Networking and system commands: Supports
ping,curl,Get-NetTCPConnection, and many more. - 📋 Extensive mappings: Permissions, archiving, users, process management, environment variables, I/O redirection, and more.
- 🚦 Helpful notes: Outputs usage tips or warnings if there's no direct translation or if a flag behaves differently.
- 🧩 Easily extensible: Add or edit mappings in
mappings.py—grow as you learn! - ⚡ Ready for shell aliases & tab-completion: Bash/Zsh completion script included.
- 🤖 Machine Learning Integration: Learns from your translations and provides smart suggestions.
- 🔌 Plugin System: Extensible architecture with built-in plugins for Docker, Kubernetes, AWS, and Git.
- 🌐 Web API: REST API and beautiful web interface for programmatic access.
- 📊 Advanced Features: AST parsing, configuration management, and comprehensive testing.
What's New in v1.1.0
- ✅ Fixed all markdownlint formatting issues in documentation
- ✅ Enhanced CLI functionality with better error handling and Windows compatibility
- ✅ Improved documentation with proper markdown formatting
- ✅ Resolved import dependencies (flask-cors installation)
- ✅ Better cross-platform support with readline handling for Windows
Quickstart
Install from PyPI:
pip install shellrosetta
Or clone and install locally:
git clone https://github.com/sdirishguy/shellrosetta.git
cd shellrosetta
pip install .
Usage:
shellrosetta lnx2ps "ls -alh | grep error"
shellrosetta ps2lnx "Get-ChildItem -Force | Select-String error"
Or test before installing:
python -m shellrosetta.cli lnx2ps "ls -alh | grep error"
python -m shellrosetta.cli ps2lnx "Get-ChildItem -Force | Select-String error"
(Optional) Add aliases to your shell:
echo "alias lnx2ps='shellrosetta lnx2ps'" >> ~/.bashrc
echo "alias ps2lnx='shellrosetta ps2lnx'" >> ~/.bashrc
source ~/.bashrc
(Optional) Enable tab-completion:
Copy shellrosetta/autocomplete.sh somewhere (or use directly from the repo), then add this to your ~/.bashrc or ~/.zshrc:
source /path/to/shellrosetta/autocomplete.sh
Reload your shell:
source ~/.bashrc
# or
source ~/.zshrc
Now you get tab completion for commands and flags!
Interactive Shell Mode
Run with no arguments for a live translation shell!
shellrosetta
You'll be prompted for your translation mode (lnx2ps or ps2lnx). Enter commands and see translations instantly, switching modes at any time with mode or exit with exit.
Example session:
$ shellrosetta
=================================================================
ShellRosetta: Linux ↔ PowerShell CLI Command Translator
Author: David Donohue
Repo: github.com/sdirishguy/shellrosetta
=================================================================
Welcome to ShellRosetta Interactive Mode!
Type 'exit' to quit, or 'mode' to switch translation direction.
Mode [lnx2ps/ps2lnx] (or 'exit'): lnx2ps
Type your LNX2PS commands below. Type 'mode' to switch, 'exit' to quit.
> ls -alh | grep foo
--- Translation ---
PowerShell Equivalent:
Get-ChildItem -Force | Format-List # [Human-readable file sizes not natively available.] | Select-String foo
-------------------
> rm -rf /tmp
--- Translation ---
PowerShell Equivalent:
Remove-Item -Recurse -Force /tmp
-------------------
> mode
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shellrosetta-1.2.0.tar.gz.
File metadata
- Download URL: shellrosetta-1.2.0.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e49ca18a1e69297cad15d55bd2cf10b62b31ee35fa0177d463820fe8e05ce43
|
|
| MD5 |
ea22d09a10dea0c9fdc33a1574bfb357
|
|
| BLAKE2b-256 |
6e01a9896c92c8547407d3545638d4ed5a3eb5b93b50e3860d42160c7d36e6c1
|
File details
Details for the file shellrosetta-1.2.0-py3-none-any.whl.
File metadata
- Download URL: shellrosetta-1.2.0-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0404a9df2269518438d6eb960878a8e345479ee3d988b19af86af4a210f8c887
|
|
| MD5 |
b6a3319a0732db70e330967458204c6c
|
|
| BLAKE2b-256 |
27a62f1aa0695f0ccf4b1c04183256f30376dea06e41f178bfe011aa2c3e395b
|