It is a thin launcher around the real stylua binary from your PATH.
On each run it:
- Checks the current working directory for
stylua.tomlor.stylua.toml. - If neither exists, copies
stylua.default.toml(next to this executable) into./stylua.toml. - Forwards all CLI arguments to
styluaand returns the same exit code.
Editors and format-on-save tools often invoke StyLua without ensuring a project config exists. This wrapper seeds a known-good default once, then behaves like StyLua.
- Install StyLua so
styluais on yourPATH. - Download the release zip for your OS and extract it somewhere stable.
- Keep the wrapper binary and
stylua.default.tomlin the same folder. - Point your editor / formatter setting at the wrapper instead of
stylua.
Example VS Code / Cursor (settings.json):
{
"stylua.styluaPath": "/path/to/stylua_wrapper"
}On Windows use the .exe path, for example C:\\Tools\\stylua_wrapper\\stylua_wrapper.exe.
| Platform | Download |
|---|---|
| Windows x64 | stylua_wrapper-windows-x64.zip |
| Linux x64 | stylua_wrapper-linux-x64.zip |
| macOS Apple Silicon | stylua_wrapper-macos-arm64.zip |
| macOS Intel | stylua_wrapper-macos-x64.zip |
Edit stylua.default.toml next to the executable. New projects without a config will receive that template as stylua.toml.
Existing projects that already have stylua.toml / .stylua.toml are never overwritten.
Either:
- Set environment variable
STYLUA_WRAPPER_LOG=1, or - Create an empty
stylua_wrapper.lognext to the executable.
Logs append to stylua_wrapper.log in the same directory as the executable.
The wrapper does not bundle StyLua. Install it and confirm:
# Linux / macOS
command -v stylua
stylua --version
# Windows
where stylua
stylua --versionThen retry formatting.
No. If stylua.toml or .stylua.toml is already present in the working directory, the wrapper does nothing except forward arguments to StyLua.