$ show lmorg/murex
Murex is a cross-platform shell and scripting language designed as a more readable, safe, and type-aware alternative to Bash. In production it works as both an interactive REPL (with autocomplete, hint text, preview panes, spellchecking, and job control) and a scripting interpreter with a custom expression language, typed pipelines, exception handling (try/catch/trypipe), multi-scope variables, a built-in unit test framework, event hooks (onPrompt, onKeyPress, onFileSystemChange, onSignalReceived), an HTTP client, and a package/module manager. The defining architectural feature is that data in pipelines carries type metadata: JSON, YAML, CSV, TOML, XML, S-expressions, HCL and more are first-class structured objects with registered Marshal/Unmarshal/ReadArray/ReadMap/ReadIndex hooks, so builtins like alter, tabulate, count, and jsplit operate on structured data rather than raw text. The implementation is Go (with a JS/WASM interpreter variant), organized around lang/ (parser, expression engine, process lifecycle), shell/ (interactive terminal layer), builtins/ (roughly 200 commands, data type adapters, pipes, and event handlers), config/ (profile-driven runtime configuration), and utils/ (standalone helper libraries).
The LLM identified 6 files worth highlighting for reuse:
A generic TTL-based cache with in-memory and optional SQLite-backed persistence. Supports namespaces, automatic key hashing, default TTLs, and bounded database trimming. Used internally for man-page flags, dynamic autocomplete results, and previews, but the package is self-contained and could be dropped into any Go project needing a small, dependency-light cache with a persistent option.
A hand-written lenient JSON parser that accepts single-quoted strings, unquoted keys, and single-line comments while inferring scalar types - effectively a superset of JSON tuned for interactive shell ergonomics. Includes a fuzz harness and extensive test suite. Demonstrates careful tokenizer/recursive-descent craftsmanship and is fully standalone.
Extracts command summaries and flag/option descriptions from gzipped man pages (with TTL caching), powering murex's context-sensitive autocomplete for external commands. Nearly self-contained and directly reusable by any CLI tool that wants to introspect man pages for completions or quick-help features.
Implements path-based CRUD operations (set, alter, merge, sum, delete) on arbitrary nested `any` data, handling maps, slices, arrays, and structs while honoring context cancellation. This is the engine behind the alter/merge builtins and is a clean, standalone tree-traversal library applicable to any Go project that mutates structured data dynamically.
A metadata-driven documentation generator: parses YAML document definitions plus Go text templates and renders site catalogs (Markdown, VuePress config, embedded Go lookup tables). The pipeline decouples content (YAML) from rendering (templates), making it generic enough to be repurposed for other projects that need structured doc generation.
Self-contained ANSI escape sequence handling: constants, cursor movement, color/style helpers, const-name lookup, and raw ANSI parsing for tests. Cross-platform friendly and easily extracted for any terminal-based Go tool.