bunmsh
v0.0.1
Published
Cross-platform command shell for Bun
Readme
bunmsh
bunmshis a dependency-free, mksh-inspired cross-platform command shell for Bun- Bun Modern Shell
- Early releases focus on a small, usable command interpreter rather than full mksh compatibility.
Usage
Install Bun first
- bunmsh requires Bun
- On Android, install it in Termux:
npm install -g bunOn other platforms, follow the official Bun installation guide.
No project dependencies need to be installed with npm install or bun install.
Option 1: Run with npx
# Interactive shell
npx bunmshnpx bunmsh -c 'print $PATH'npx installs and launches the package, but the bunmsh executable itself
uses Bun. Bun must therefore already be available on PATH.
Option 2: Run with git clone
After the repository is publicly available:
- Interactive shell
git clone https://github.com/jjtseng93/bunmsh.git
cd bunmsh
bun ./bunmsh- Running commands or scripts
bun ./bunmsh -c 'print $PATH'
# bun ./bunmsh script.sh arg1 arg2What's implemented
Interactive prompt, standard-input scripts, script files and
-cExternal commands through
Bun.spawnSequential pipelines (
a | b)Command lists with
;,&&and||Single quotes, double quotes and backslash quoting
$NAME,${NAME},$?,$$,$#,$0through$9Leading environment assignments and persistent assignment-only commands
<,>,>>,2>and2>>cd,pwd,export,unset,env,exit,set,:,true,false,echo,printand a smallprintfSee PORTING.md for semantic limitations and the remaining mksh work.
Test
bun testBuilt-in README
Show this README in the terminal with ANSI formatting:
bunmsh --readme--readme reads the embedded copy first when running a standalone executable,
then falls back to the repository's README.md during development.
Standalone executable
Build a single-file executable for the current platform:
bun ./src/main.js --build-exe
./bmsh --versionCross-compile for a Bun-supported target:
bun ./src/main.js --build-for bun-linux-x64The build writes ./bmsh and leaves the repository's ./bunmsh launcher
unchanged. The executable includes README.md as an internal asset. See
single-exe/README.md for asset-management options.
License
The original bunmsh JavaScript implementation is released under the MIT License, Copyright (c) 2026 Dr. John (醫者小智).
mksh is a separate upstream project and is not relicensed under MIT. Its complete licence terms remain in LICENSE-MKSH.
