{"id":35210138,"url":"https://github.com/paiml/bashrs","last_synced_at":"2026-03-17T07:02:49.584Z","repository":{"id":295834952,"uuid":"991392639","full_name":"paiml/bashrs","owner":"paiml","description":"Bashrs: Rust-to-Shell Transpiler for Deterministic Bootstrap Scripts","archived":false,"fork":false,"pushed_at":"2026-03-14T15:04:31.000Z","size":127954,"stargazers_count":31,"open_issues_count":22,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-15T01:21:35.386Z","etag":null,"topics":["bash","mcp","rust"],"latest_commit_sha":null,"homepage":"https://paiml.github.io/bashrs/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paiml.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.yaml","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-27T14:54:24.000Z","updated_at":"2026-03-14T15:04:35.000Z","dependencies_parsed_at":"2026-01-18T20:02:12.585Z","dependency_job_id":null,"html_url":"https://github.com/paiml/bashrs","commit_stats":null,"previous_names":["paiml/rash","paiml/bashrs"],"tags_count":109,"template":false,"template_full_name":null,"purl":"pkg:github/paiml/bashrs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paiml%2Fbashrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paiml%2Fbashrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paiml%2Fbashrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paiml%2Fbashrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paiml","download_url":"https://codeload.github.com/paiml/bashrs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paiml%2Fbashrs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30616034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T04:46:40.957Z","status":"ssl_error","status_checked_at":"2026-03-17T04:46:32.538Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","mcp","rust"],"created_at":"2025-12-29T17:33:11.623Z","updated_at":"2026-03-17T07:02:49.577Z","avatar_url":"https://github.com/paiml.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\".github/bashrs-hero.svg\" alt=\"bashrs\" width=\"800\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eRash - Bidirectional Shell Safety Tool\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://crates.io/crates/bashrs\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/bashrs.svg\" alt=\"Crates.io\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://docs.rs/bashrs\"\u003e\u003cimg src=\"https://docs.rs/bashrs/badge.svg\" alt=\"Documentation\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://paiml.github.io/bashrs/\"\u003e\u003cimg src=\"https://img.shields.io/badge/book-The%20Rash%20Book-blue\" alt=\"Book\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/crates/l/bashrs.svg\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/paiml/bashrs/actions\"\u003e\u003cimg src=\"https://github.com/paiml/bashrs/workflows/CI/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eBidirectional shell safety tool that purifies legacy bash scripts and lets you write shell scripts in REAL Rust with automatic safety guarantees.\u003c/b\u003e\n\u003c/p\u003e\n\n\u003c/div\u003e\n\n## Table of Contents\n\n- [What's New](#-whats-new-in-v6650)\n- [Why Rash?](#why-rash)\n- [Quick Start](#quick-start)\n- [Features](#features)\n- [Usage](#usage)\n- [Advanced Testing](#advanced-testing)\n- [Documentation](#-documentation)\n- [Quality Metrics](#quality-metrics)\n- [Shell Compatibility](#shell-compatibility)\n- [Performance](#performance)\n- [MCP Server](#mcp-server)\n- [Contributing](#contributing)\n- [License](#license)\n\n## 🚀 What's New in v6.65.0\n\n**Latest Release** - 2026-02-27\n\n- **Coverage Milestone**: Line coverage raised from 94.00% to **95.04%** (19,204 uncovered lines remaining)\n  - 1,572 new coverage tests across 25 test files and 11 modules\n  - CLI command coverage (corpus, lint, comply, installer)\n  - Parser coverage (arithmetic, control flow, declarations, expressions)\n- **15,117 Tests**: All passing with zero failures\n- **Examples Fixed**: All 7 `cargo run --example` demos now work correctly in workspace\n- **Book Updated**: All `mdbook test` examples pass, transpiler docs corrected\n\nSee [CHANGELOG.md](CHANGELOG.md) for complete release notes.\n\n## Why Rash?\n\nShell scripts are everywhere—CI/CD pipelines, deployment automation, system configuration—but they're notoriously difficult to write safely. Rash solves this by providing:\n\n1. **Bidirectional Safety**: Write in Rust and transpile to shell, or purify existing bash scripts\n2. **Automatic Transformation**: Don't just detect problems—fix them automatically\n3. **Deterministic Guarantees**: Same input always produces identical, reproducible output\n4. **Zero Runtime Dependencies**: Generated scripts run on any POSIX-compliant system\n\n## Features\n\n- 🛡️ **Automatic Safety**: Protection against shell injection, word splitting, glob expansion\n- 🔍 **Beyond Linting**: Full AST semantic understanding - **transforms** code, doesn't just warn\n- 📦 **Zero Runtime Dependencies**: Generated scripts work on any POSIX shell\n- 🎯 **Deterministic Output**: Same input always produces identical scripts\n- ✅ **ShellCheck Compliant**: All output passes strict linting\n\n### How Rash Exceeds ShellCheck\n\n| What ShellCheck Does | What Rash Does |\n|---------------------|----------------|\n| ⚠️ **Warns**: \"$RANDOM is non-deterministic\" | ✅ **Rewrites** to version-based deterministic IDs |\n| ⚠️ **Warns**: \"mkdir may fail if exists\" | ✅ **Transforms** to `mkdir -p` (idempotent) |\n| ⚠️ **Warns**: \"Unquoted variable expansion\" | ✅ **Quotes** all variables automatically |\n| Static pattern matching | **Full AST semantic understanding** |\n| Detects issues (read-only) | **Fixes issues (read-write transformation)** |\n\n**Key Difference**: ShellCheck tells you what's wrong. Rash **understands your code's intent** and rewrites it to be safe, deterministic, and idempotent — automatically.\n\n## Quick Start\n\n### Installation\n\n```bash\n# From crates.io (recommended)\ncargo install bashrs\n\n# Or from source\ngit clone https://github.com/paiml/bashrs\ncd bashrs\ncargo install --path rash\n```\n\n### Write Rust, Get Safe Shell\n\n```rust\n// install.rs\n#[rash::main]\nfn main() {\n    let version = env_var_or(\"VERSION\", \"1.0.0\");\n    let prefix = env_var_or(\"PREFIX\", \"/usr/local\");\n\n    echo(\"Installing MyApp {version} to {prefix}\");\n\n    mkdir_p(\"{prefix}/bin\");\n    mkdir_p(\"{prefix}/share/myapp\");\n\n    if exec(\"cp myapp {prefix}/bin/\") {\n        echo(\"✓ Binary installed\");\n    } else {\n        eprint(\"✗ Failed to install binary\");\n        exit(1);\n    }\n}\n```\n\n**Transpile to safe POSIX shell**:\n\n```bash\n$ bashrs build install.rs -o install.sh\n```\n\n### Or Purify Existing Bash\n\n**Before** (messy bash):\n```bash\n#!/bin/bash\nSESSION_ID=$RANDOM                      # Non-deterministic\nmkdir /app/releases/$RELEASE            # Non-idempotent\nrm /app/current                         # Fails if doesn't exist\n```\n\n**After** (purified by Rash):\n```bash\n#!/bin/sh\nsession_id=\"session-${version}\"         # ✅ Deterministic\nmkdir -p \"/app/releases/${release}\"     # ✅ Idempotent\nrm -f \"/app/current\"                    # ✅ Safe removal\n```\n\n## Usage\n\n```bash\n# Transpile Rust to shell\nbashrs build input.rs -o output.sh\n\n# Purify legacy bash scripts\nbashrs purify messy.sh -o clean.sh\n\n# Interactive REPL with debugging\nbashrs repl\n\n# Lint shell scripts (including Dockerfiles)\nbashrs lint script.sh\n\n# Test bash scripts\nbashrs test script.sh\n\n# Quality scoring\nbashrs score script.sh\n\n# Comprehensive audit\nbashrs audit script.sh\n```\n\n## Advanced Testing\n\nRash includes Probar integration for comprehensive quality assurance:\n\n```bash\n# State machine testing with playbooks\nbashrs playbook install.playbook.yaml --run\n\n# Mutation testing (goal: \u003e90% kill rate)\nbashrs mutate script.sh --count 10\n\n# Deterministic simulation replay\nbashrs simulate script.sh --seed 42 --verify\n```\n\n**Mutation Operators**: Rash applies 10 mutation operators including string mutations, command substitutions, conditional inversions, and redirect modifications to verify test quality.\n\n## 📚 Documentation\n\n**The Rash Book** is the canonical source for all documentation:\n\n### [**→ Read The Rash Book**](https://paiml.github.io/bashrs/)\n\n**Quick links**:\n- [Getting Started](https://paiml.github.io/bashrs/getting-started/installation.html)\n- [Quick Start Tutorial](https://paiml.github.io/bashrs/getting-started/quick-start.html)\n- [Linting Rules](https://paiml.github.io/bashrs/linting/security.html)\n- [Configuration Management](https://paiml.github.io/bashrs/config/overview.html)\n- [API Reference](https://docs.rs/bashrs)\n\n**Why the book?**\n- ✅ All examples automatically tested\n- ✅ Always up-to-date with latest release\n- ✅ Comprehensive coverage of all features\n- ✅ Real-world examples and tutorials\n\n## Quality Metrics\n\n| Metric | Value | Status |\n|--------|-------|--------|\n| **V2 Corpus Score** | 97.5/100 | ✅ Grade A+ |\n| **Corpus Entries** | 17,882 | ✅ 100% pass rate |\n| **Tests** | 15,117 passing | ✅ 100% pass rate |\n| **Line Coverage** | 95.04% | ✅ Exceeds 95% target |\n| **Transpilation** | 100% (17,882/17,882) | ✅ All entries compile |\n| **Behavioral** | 100% | ✅ Output matches spec |\n| **Deterministic** | 100% | ✅ Same input = same output |\n| **ShellCheck** | 99.9% compliant | ✅ All output passes |\n| **Cross-Shell** | 98.8% (sh + dash) | ✅ POSIX portable |\n| **Shell Compatibility** | 6 shells | ✅ sh, dash, bash, ash, zsh, mksh |\n\n### Falsification Testing (Popper Methodology)\n\nRash uses Popperian falsification—tests attempt to **disprove** functionality rather than prove it works:\n\n```bash\n# Run 130-point transpiler falsification checklist\ncargo test -p bashrs --test transpiler_tcode_tests\n\n# Run 30-point Dockerfile falsification checklist\ncargo test -p bashrs --test dockerfile_dcode_tests\n```\n\nA passing test means the falsification attempt **failed**—the feature works correctly.\n\n## Shell Compatibility\n\nGenerated scripts are tested on:\n\n| Shell | Version | Status |\n|-------|---------|--------|\n| POSIX sh | - | ✅ Full support |\n| dash | 0.5.11+ | ✅ Full support |\n| bash | 3.2+ | ✅ Full support |\n| ash (BusyBox) | 1.30+ | ✅ Full support |\n| zsh | 5.0+ | ✅ Full support |\n| mksh | R59+ | ✅ Full support |\n\n## Performance\n\nRash is designed for fast transpilation:\n\n- **Rust-to-Shell**: 21.1µs transpile time\n- **Makefile Parsing**: 0.034-1.43ms (70-320x faster than targets)\n- **Memory Usage**: \u003c10MB for most scripts\n\n## MCP Server\n\nRash provides a Model Context Protocol (MCP) server for AI-assisted shell script generation:\n\n```bash\n# Install MCP server\ncargo install rash-mcp\n\n# Run server\nrash-mcp\n```\n\nAvailable in the official MCP registry as `io.github.paiml/rash`.\n\n## Contributing\n\nWe welcome contributions! See our [Contributing Guide](CONTRIBUTING.md) for details.\n\n```bash\n# Clone and test\ngit clone https://github.com/paiml/bashrs.git\ncd bashrs\nmake test\n\n# Run all quality checks\nmake validate\n```\n\n\n## MSRV\n\nMinimum Supported Rust Version: **1.82**\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\u003cb\u003eFor comprehensive documentation, visit \u003ca href=\"https://paiml.github.io/bashrs/\"\u003eThe Rash Book\u003c/a\u003e\u003c/b\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaiml%2Fbashrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaiml%2Fbashrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaiml%2Fbashrs/lists"}