XRU is a Domain-Specific Language (DSL) designed for Structured Text Transformation. It operates as a Structured Text Patcher (STP), preserving formatting, comments, and non-standard syntaxes while applying complex mutations.
curl -sL https://raw.githubusercontent.com/Nehonix-Team/xru/master/install.sh | bashirm https://raw.githubusercontent.com/Nehonix-Team/xru/master/install.ps1 | iex- Structured Patching: Precise manipulation of JSON, YAML, and source code while preserving formatting.
- Inception Mode: Execute nested XRU logic (
#FOR,#IF) directly within template blocks. - Universal Injection: Support for
@TSINJECT,@GOINJECT, etc., with automatic language detection. - Recursive Orchestration: Nested action execution across file-targeting blocks.
- Strict Scoping: Isolated execution environments for templates and loops.
The documentation is modularized for better maintainability:
- Syntax Overview: General rules and log colorization.
- Directives: Scoping (
#BEGIN,#SELECT) and Utility (#LOG,#EXEC) directives. - Actions: Patching operations, symbols (
++,>>), and code injections. - Variables: Scoping rules, declarations, and interpolation.
- CLI Usage: Command line options and examples.
Create a file named patch.xru:
let app = "MyProject"
#SELECT: ./src
#LOG: "<cyan>[INFO]</> Patching {app}..."
#BEGIN: config.json
SET version "1.0.0"
MERGE metadata {
"author": "XyPriss"
}
#END
#LOG: "<green>[SUCCESS]</> Done."
Apply it:
xru patch.xru .xru build <file.xru>: Transpile an XRU script into standalone.sh(Unix) and.ps1(Windows) scripts.xru run <file.xru> [target]: Execute rules on a target directory.
For syntax highlighting, install the XRU extension. To build and install it locally:
- Navigate to the extension directory:
cd pkg/ext/vscode - Ensure you have XFPM installed.
- Run the build command:
xfpm run build:ext
The XRU engine supports both direct execution and standalone compilation into native shell scripts.
MIT © Nehonix-Team