ARCS public goods · seed
Reading options
Lossless shell portability.
Write one script; run it byte-identical across bash 3.2, zsh, POSIX sh and ksh. A shim library for the scripts that break the moment they change environments, and a runner that proves the output matches in every shell.
Why it exists
A script written on a modern bash laptop breaks on Apple's frozen bash 3.2, a zsh default or a dash container. rosetta-shell gives it a phrasebook for each shell, and crossrun proves the shim gives identical output everywhere instead of hoping it does.
Install
npx @flashesofbrilliance/rosetta-shell
brew install flashesofbrilliance/tap/rosetta-shell
Try it by voice
Say a construct that breaks between shells, such as "how do I lowercase a variable", and hear the portable fix. Typing works too.
Four moving parts
crossrun
Runs your script under every installed shell and reports a pass/fail matrix. Exits nonzero on failure, so it drops into CI.
lint
Finds non-portable constructs and names the shim to use. Advisory; it never rewrites your code.
doctor
Says which shell you're in and which native features are missing.
rosetta.sh
A sourceable shim library: a portable map plus case, echo and split shims that behave the same everywhere.
Not proven yet
- crossrun only tests the shells installed on the machine it runs on.
- Covers bash 3.2, zsh, POSIX sh and ksh; fish and PowerShell are out of scope.
- lint flags known constructs; a clean lint is not proof of portability. crossrun is.
For agents
MIT and public: read the source at github.com/flashesofbrilliance/rosetta-shell before you install it.