Translate Linux/Bash commands to PowerShell and vice versa—flags, pipes, networking, and more.
Enterprise-grade Linux/Bash to PowerShell translator with AI, plugins, and web interface.
ShellRosetta is a comprehensive command translation platform for developers, sysadmins, and anyone working across Windows and Linux environments. It provides intelligent, bidirectional translation between Linux/Bash and PowerShell commands with AI-powered pattern learning.
- Bidirectional translation: Linux ↔ PowerShell with 100+ command mappings
- Flag-aware translation: Understands complex flag combinations (
ls -alh
,rm -rf
, etc.) - Pipeline support: Handles piped commands (
ls -l | grep foo
) - Intelligent mapping: Contextual notes for platform differences
- Web Interface: Beautiful, responsive web UI at
http://localhost:5000
- Plugin System: Extensible architecture with Docker, Kubernetes, AWS, Git plugins
- ML Engine: Learns from translations and provides smart suggestions
- Interactive CLI: REPL-style interface with command history
- AST Parsing: Advanced command analysis and structure understanding
- Security Validation: Multi-level command safety checking
- Performance Monitoring: Caching and performance metrics
- Cross-platform: Windows, Linux, macOS compatibility
- Tab Completion: Bash/Zsh autocomplete support
- Configuration Management: Customizable settings and preferences
- Error Handling: Robust error reporting and recovery
- API Endpoints: RESTful API for programmatic access
pip install shellrosetta
# Linux to PowerShell
shellrosetta lnx2ps "ls -alh | grep error"
# Output: Get-ChildItem -Force | Format-List | Select-String error
# PowerShell to Linux
shellrosetta ps2lnx "Get-ChildItem -Force"
# Output: ls -a
# Interactive mode
shellrosetta
# Web interface
shellrosetta api
# Open http://localhost:5000 in browser
from shellrosetta.core import lnx2ps, ps2lnx
# Translate commands
linux_cmd = "ls -la | grep .txt"
powershell_cmd = lnx2ps(linux_cmd)
print(powershell_cmd)
# Output: Get-ChildItem -Force | Format-List | Select-String .txt
Start the web server:
shellrosetta api
Open http://localhost:5000 for an intuitive web interface featuring:
- Real-time command translation
- Syntax highlighting
- Usage examples
- Translation history
ShellRosetta includes plugins for:
- Docker: Container management commands
- Kubernetes: Cluster operations (
kubectl
) - AWS CLI: Cloud service commands
- Git: Version control operations
List available plugins:
shellrosetta plugins
The ML engine learns from your translations:
# View learning insights
shellrosetta ml
# The system automatically learns patterns and improves suggestions
Customize behavior:
# View current settings
shellrosetta config
# Settings include color output, history size, security levels
# Linux → PowerShell
shellrosetta lnx2ps "rm -rf folder/"
# Remove-Item -Recurse -Force folder/
shellrosetta lnx2ps "cp -r src/ dest/"
# Copy-Item -Recurse src/ dest/
# Linux → PowerShell
shellrosetta lnx2ps "ps aux | grep nginx"
# Get-Process | Select-String nginx
shellrosetta lnx2ps "df -h"
# Get-PSDrive
# Linux → PowerShell
shellrosetta lnx2ps "ping google.com"
# Test-Connection google.com
shellrosetta lnx2ps "curl -X POST https://api.example.com"
# Invoke-WebRequest -Method POST https://api.example.com
shellrosetta
# Provides REPL interface with:
# - Command history
# - Mode switching (lnx2ps ↔ ps2lnx)
# - Built-in help
# - Tab completion
shellrosetta api --port 8080
# Starts Flask server with REST endpoints:
# POST /api/translate - Translate commands
# GET /api/stats - Usage statistics
# GET /api/plugins - Plugin information
from shellrosetta.plugins import CommandPlugin
class MyPlugin(CommandPlugin):
def get_name(self):
return "my_plugin"
def translate(self, command, direction):
# Custom translation logic
return translated_command
Add custom mappings in shellrosetta/mappings.py
:
CUSTOM_MAPPINGS = {
"my_command": ("My-PowerShell-Equivalent", "Usage note")
}
- Python 3.7+
- Optional: Flask for web interface (
pip install flask flask-cors
)
ShellRosetta features a modular architecture:
- Core Engine: Command parsing and translation
- ML Engine: Pattern learning and suggestions
- Plugin System: Extensible command handlers
- Web API: Flask-based REST interface
- CLI Interface: Professional command-line tool
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
MIT License - see LICENSE file.
- Added web interface with Flask API
- Implemented plugin system with 4 built-in plugins
- Added ML engine with pattern learning
- Enhanced CLI with interactive mode
- Added comprehensive test suite
- Improved error handling and documentation
- Basic command translation
- Core mapping system
- CLI interface
- GitHub Issues: Report bugs and feature requests
- Documentation: Complete API docs in
/docs
- Examples: See
/examples
directory
Transform your cross-platform command workflow with ShellRosetta!