Table of Contents
- What's New
- Why Rash?
- Quick Start
- Features
- Core Commands
- Advanced Testing
- Documentation
- Quality Metrics
- Shell Compatibility
- Performance
- MCP Server
- Contributing
- License
🚀 What's New in v6.61.0
Latest Release - 2026-02-10
- Transpiler Bug Fixes: 2 critical correctness fixes
returninsidewhile/for/matchin functions now correctly emits shell arithmeticlet x = match y { ... }now generates propercasestatements instead ofx='unknown'
- Corpus Expansion: 14,712 transpilation entries (13,397 Bash + 695 Makefile + 620 Dockerfile)
- V2 Score: 97.5/100 (A+), 0 failures across all entries
- 107+ CLI subcommands for corpus analysis, quality gates, and convergence tracking
- New Example:
transpiler_demoshowcasing nested calls, match-in-let, recursion, and multi-function programs - Quality Metrics: 10,888 tests, 97.5/100 corpus score (A+)
See CHANGELOG.md for complete release notes.
Why Rash?
Shell scripts are everywhere—CI/CD pipelines, deployment automation, system configuration—but they're notoriously difficult to write safely. Rash solves this by providing:
- Bidirectional Safety: Write in Rust and transpile to shell, or purify existing bash scripts
- Automatic Transformation: Don't just detect problems—fix them automatically
- Deterministic Guarantees: Same input always produces identical, reproducible output
- Zero Runtime Dependencies: Generated scripts run on any POSIX-compliant system
Features
- 🛡️ Automatic Safety: Protection against shell injection, word splitting, glob expansion
- 🔍 Beyond Linting: Full AST semantic understanding - transforms code, doesn't just warn
- 📦 Zero Runtime Dependencies: Generated scripts work on any POSIX shell
- 🎯 Deterministic Output: Same input always produces identical scripts
- ✅ ShellCheck Compliant: All output passes strict linting
How Rash Exceeds ShellCheck
| What ShellCheck Does | What Rash Does |
|---|---|
| ⚠️ Warns: "$RANDOM is non-deterministic" | ✅ Rewrites to version-based deterministic IDs |
| ⚠️ Warns: "mkdir may fail if exists" | ✅ Transforms to mkdir -p (idempotent) |
| ⚠️ Warns: "Unquoted variable expansion" | ✅ Quotes all variables automatically |
| Static pattern matching | Full AST semantic understanding |
| Detects issues (read-only) | Fixes issues (read-write transformation) |
Key Difference: ShellCheck tells you what's wrong. Rash understands your code's intent and rewrites it to be safe, deterministic, and idempotent — automatically.
Quick Start
Installation
# From crates.io (recommended)
# Or from source
Write Rust, Get Safe Shell
// install.rs
Transpile to safe POSIX shell:
Or Purify Existing Bash
Before (messy bash):
#!/bin/bash
SESSION_ID= # Non-deterministic
After (purified by Rash):
#!/bin/sh
session_id="session-" # ✅ Deterministic
Core Commands
# Transpile Rust to shell
# Purify legacy bash scripts
# Interactive REPL with debugging
# Lint shell scripts (including Dockerfiles)
# Test bash scripts
# Quality scoring
# Comprehensive audit
Advanced Testing
Rash includes Probar integration for comprehensive quality assurance:
# State machine testing with playbooks
# Mutation testing (goal: >90% kill rate)
# Deterministic simulation replay
Mutation Operators: Rash applies 10 mutation operators including string mutations, command substitutions, conditional inversions, and redirect modifications to verify test quality.
📚 Documentation
The Rash Book is the canonical source for all documentation:
→ Read The Rash Book
Quick links:
Why the book?
- ✅ All examples automatically tested
- ✅ Always up-to-date with latest release
- ✅ Comprehensive coverage of all features
- ✅ Real-world examples and tutorials
Quality Metrics
| Metric | Value | Status |
|---|---|---|
| V2 Corpus Score | 97.5/100 | ✅ Grade A+ |
| Corpus Entries | 14,712 | ✅ 100% pass rate |
| Tests | 10,888 passing | ✅ 100% pass rate |
| Transpilation | 100% (14,712/14,712) | ✅ All entries compile |
| Behavioral | 100% (14,707/14,712) | ✅ Output matches spec |
| Deterministic | 100% (14,712/14,712) | ✅ Same input = same output |
| ShellCheck | 99.9% compliant | ✅ All output passes |
| Cross-Shell | 98.8% (sh + dash) | ✅ POSIX portable |
| Shell Compatibility | 6 shells | ✅ sh, dash, bash, ash, zsh, mksh |
Falsification Testing (Popper Methodology)
Rash uses Popperian falsification—tests attempt to disprove functionality rather than prove it works:
# Run 130-point transpiler falsification checklist
# Run 30-point Dockerfile falsification checklist
A passing test means the falsification attempt failed—the feature works correctly.
Shell Compatibility
Generated scripts are tested on:
| Shell | Version | Status |
|---|---|---|
| POSIX sh | - | ✅ Full support |
| dash | 0.5.11+ | ✅ Full support |
| bash | 3.2+ | ✅ Full support |
| ash (BusyBox) | 1.30+ | ✅ Full support |
| zsh | 5.0+ | ✅ Full support |
| mksh | R59+ | ✅ Full support |
Performance
Rash is designed for fast transpilation:
- Rust-to-Shell: 21.1µs transpile time
- Makefile Parsing: 0.034-1.43ms (70-320x faster than targets)
- Memory Usage: <10MB for most scripts
MCP Server
Rash provides a Model Context Protocol (MCP) server for AI-assisted shell script generation:
# Install MCP server
# Run server
Available in the official MCP registry as io.github.paiml/rash.
Contributing
We welcome contributions! See our Contributing Guide for details.
# Clone and test
# Run all quality checks
License
MIT License. See LICENSE for details.