Cametendo dd388a7469 Add Windows Terminal installer (install.ps1 / install.bat)
install.ps1 copies bash.exe to %LOCALAPPDATA%\Programs\BashForWindows,
adds it to the user PATH, and injects a "Bash for Windows" profile into
Windows Terminal's settings.json so the shell appears in the + dropdown.

install.bat is a double-click wrapper that bypasses the PS execution policy.

build.sh --release produces a release/ folder ready to zip and distribute.
Supports -Uninstall flag to cleanly remove everything.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 13:01:20 +02:00
2026-05-26 10:00:45 +02:00

bash-for-windows

A fully functional bash shell for Windows, written in Go. Run bash commands and scripts natively on Windows without WSL, Cygwin, or MSYS2.

Features

  • Interactive shell with prompt (bash$)
  • Built-in commands: cd, pwd, echo, exit, export, source, alias, type
  • Built-in coreutils: ls, cat, grep, sort, wc, head, find, cp, mv, rm, mkdir, touch, clear
  • Command chaining: &&, ||, ;
  • Pipes: | between commands
  • Variable expansion: $NAME, ${NAME}
  • Variable assignment: NAME=VALUE command
  • Single & double quotes: 'literal', "$variable"
  • Script execution: bash-windows script.sh or -c 'commands'
  • No dependencies — single .exe file, runs on any Windows x86-64

Usage

bash-windows            # Interactive mode
bash-windows -c 'echo hello'
bash-windows script.sh

Examples

bash$ echo "Hello from bash-for-windows!"
bash$ ls -la
bash$ cd /tmp && pwd
bash$ cat file.txt | grep pattern | wc -l
bash$ name="Luffy" && echo $name
bash$ mkdir -p project/src && touch project/src/main.go

Building

Requires Go 1.21+.

# Linux
./build.sh

# Manual
go build -o build/bash-windows .

# Windows cross-compile
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o build/bash-windows.exe .

Project Structure

cmd/bash/        - Shell entry point
internal/shell/  - Shell engine (parser, executor, builtins, coreutils)
build/           - Compiled binaries

License

MIT

Description
Fully functional bash for windows
Readme MIT 154 KiB
Languages
Go 92.2%
PowerShell 6.6%
Shell 0.9%
Batchfile 0.3%