https://github.com/winterreisender/bangshim
[WIP]BanG Shim! From sheBanG to Shim
https://github.com/winterreisender/bangshim
powershell shell windows
Last synced: 6 months ago
JSON representation
[WIP]BanG Shim! From sheBanG to Shim
- Host: GitHub
- URL: https://github.com/winterreisender/bangshim
- Owner: Winterreisender
- License: apache-2.0
- Created: 2025-09-09T05:22:41.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-09-09T05:45:14.000Z (7 months ago)
- Last Synced: 2025-09-09T08:30:47.868Z (7 months ago)
- Topics: powershell, shell, windows
- Language: Python
- Homepage:
- Size: 145 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# #Bang Shim!
[](https://pypi.org/project/bangshim)
[](https://pypi.org/project/bangshim)

Make scripts with shebang executable in Windows by adding [shim](https://docs.chocolatey.org/en-us/features/shim/).
## Quick Start
1. Install bangshim with [scoop](https://scoop.sh/)
```sh
scoop install https://raw.githubusercontent.com/Winterreisender/bangshim/refs/heads/master/bangshim.json
```
or [uv](https://docs.astral.sh/uv/)
```sh
uv tool install bangshim
```
or pip
```sh
pip install bangshim
```
It's also recommended to install [uutils/coreutils](https://github.com/uutils/coreutils) for the `env` in shebang
2. Write any script with [shebang](https://www.in-ulm.de/~mascheck/various/shebang/), supposing you have an intepreter (Git Bash, MSYS2, Python,etc.) installed in `PATH` for your scripts.
```python
#!/usr/bin/python
print("Hello World")
```
3. Make your script executable
```sh
bangshim ./myscript.sh
./myscript
# "Hello World"
```
## More Usage
1. Search your script in `PATH` and make it executable. Supposing your have a `my_script.js` with a Node.js shebang. You can simply run `bangshim my_script.js`. Then you can call `my_script` in your console directly.
## FAQ
1. Q: Why doing this?
A: shebang is the Unix way for executable scripts, while shim are the best practice for Windows. And this is a tool to make the Unix style scripts work in Windows.
2. Q: How it works?
A: bangshim do a simple things, search intepreter from shebang in `PATH`, and generate args for [shim](https://docs.chocolatey.org/en-us/features/shim/). The folder path, like `/usr/bin/` is ignored so that your script will work in Linux/Windows.
3. Q: How to work with `/usr/bin/env` ?
A: We suppose you installed an `env.exe` in your `PATH`. For example, you can install [uutils/coreutils](https://github.com/uutils/coreutils) by `scoop install uutils-coreutils`
## Build
See [Makefile](Makefile) for more information
## Credit
1. `shim.exe` from [kiennq/scoop-better-shimexe](https://github.com/kiennq/scoop-better-shimexe) licensed under `MIT OR Unlicense`
## License
Copyright 2025 Winterreisender
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.