Skip to main content

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.

MIT License PRs Welcome Shell Tested PyPI version codecov

ShellRosetta v1.2.0

Enterprise-grade Linux/Bash to PowerShell translator with AI, plugins, and web interface.

MIT License PyPI version Python 3.7+

What is ShellRosetta?

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.

Features

Core Translation

  • 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

Advanced Features (NEW in v1.2.0)

  • 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

Professional Features

  • 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

Installation

pip install shellrosetta

Quick Start

Command Line Usage

# 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

Python API

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

Web Interface

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

Plugin System

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

Machine Learning

The ML engine learns from your translations:

# View learning insights
shellrosetta ml

# The system automatically learns patterns and improves suggestions

Configuration

Customize behavior:

# View current settings
shellrosetta config

# Settings include color output, history size, security levels

Examples

File Operations

# Linux → PowerShell
shellrosetta lnx2ps "rm -rf folder/"
# Remove-Item -Recurse -Force folder/

shellrosetta lnx2ps "cp -r src/ dest/"  
# Copy-Item -Recurse src/ dest/

System Information

# Linux → PowerShell
shellrosetta lnx2ps "ps aux | grep nginx"
# Get-Process | Select-String nginx

shellrosetta lnx2ps "df -h"
# Get-PSDrive

Network Operations

# 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

Advanced Usage

Interactive Mode

shellrosetta
# Provides REPL interface with:
# - Command history
# - Mode switching (lnx2ps ↔ ps2lnx)  
# - Built-in help
# - Tab completion

API Server

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

Development

Custom Plugins

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

Extending Mappings

Add custom mappings in shellrosetta/mappings.py:

CUSTOM_MAPPINGS = {
    "my_command": ("My-PowerShell-Equivalent", "Usage note")
}

Requirements

  • Python 3.7+
  • Optional: Flask for web interface (pip install flask flask-cors)

Architecture

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

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Submit a pull request

License

MIT License - see LICENSE file.

Changelog

v1.2.0 (Latest)

  • 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

v1.1.x

  • Basic command translation
  • Core mapping system
  • CLI interface

Support

  • 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!

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.2.1.tar.gz (34.3 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.2.1-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shellrosetta-1.2.1.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for shellrosetta-1.2.1.tar.gz
Algorithm Hash digest
SHA256 9266aa92d8f8eca6b65fada6ae31391865854bb27bd6c834439b0bd154508b6a
MD5 7e1339813db87b3fdcdc832e9c8cfb93
BLAKE2b-256 8e13f28e896a7853b16b8234698c3bc669cf8f7ff05428d158a92bf517c55cad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shellrosetta-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for shellrosetta-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eec438ab67529eaa998ca0532b0c78ef8130ecd9174523e0c60179161427de15
MD5 a9344b2c70c0a7f2b7ef28f8407988c3
BLAKE2b-256 fb13fe1ff315cd36e2048d5c55e595ca2307891345395d25a6bcb2b5555e832d

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