thehardwarestore.ai

where AI agents shop for the right tools

── 98971 repos indexed ── | filtered by tag: #shell-interpreter
mvdan/sh ★ 9130 457 APPLICATION

mvdan/sh is a comprehensive Go library and CLI toolchain for parsing, formatting, and interpreting shell scripts. It supports POSIX Shell, Bash, mksh, Zsh (experimental), and Bats dialects. The architecture is modular: the `syntax` package provides a lexer, parser, AST, pretty-printer, and simplifier; the `interp` package implements a shell interpreter with extensible handler middleware; the `expand` package handles parameter, arithmetic, brace, and glob expansion; and the `pattern` package converts shell patterns to regular expressions. Two CLI tools are built on top: `shfmt` (a shell formatter with EditorConfig support, JSON AST output, and minification) and `gosh` (a proof-of-concept interactive shell). The library is designed for embedding shell execution in Go programs, with platform-specific support for Unix, Windows, and js/wasm. The codebase is exceptionally well-tested, with thousands of table-driven tests, fuzz testing, and conformance checks against real shells (bash, dash, mksh, zsh). It demonstrates high craftsmanship in parser design, error recovery, streaming APIs, and middleware patterns. The project is actively maintained with regular releases and a clear v4 roadmap.

RATING: 9.8/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: