Skip to main content

Advanced Linux/Bash to PowerShell translator with ML, plugins, web API, and interactive shell support.

Project description

ShellRosetta

Translate Linux/Bash commands to PowerShell and vice versa—flags, pipes, networking, and more.

MIT License PRs Welcome Shell Tested PyPI version


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

shellrosetta-1.1.1.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shellrosetta-1.1.1-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file shellrosetta-1.1.1.tar.gz.

File metadata

  • Download URL: shellrosetta-1.1.1.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for shellrosetta-1.1.1.tar.gz
Algorithm Hash digest
SHA256 dc8a57569068ad1c930a6c07eab46a9d6c5ce9b1c5d49db84d0b43880097fbc0
MD5 2d42baa2894534b331dd4d2236e7d0f6
BLAKE2b-256 2432a4fc99b3856587373c7974b12e11509c6d9d2b2bc90942535d11287ea1b3

See more details on using hashes here.

File details

Details for the file shellrosetta-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: shellrosetta-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for shellrosetta-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a366e9df0c80a2523673a35c115cef297ec806618436a959ac7b4f045eba139
MD5 182d299005244c49d726b465b7867747
BLAKE2b-256 b105a4c74a433d55336e04a5af93c1267c384c6f2edf8cb1ef9c92ec48381790

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page