# Install stylua with Cargo

A code formatter for Lua. Version 2.5.2 via Cargo; verified 2026-05-16. Also installable with nix: nix profile install nixpkgs#stylua.

## Install

```sh
sudo av install cargo:stylua
```

Additional install commands:

### Portable and language managers

- Cargo (100%):

```sh
cargo install stylua
```

  Evidence: local crates.io package metadata

## Package facts

- **Package key:** cargo:stylua
- **Package manager:** Cargo
- **Package manager page:** <https://crates.io/crates/stylua>
- **Version:** 2.5.2
- **Source summary:** A code formatter for Lua
- **Repository:** <https://github.com/johnnymorganz/stylua>
- **License:** MPL-2.0
- **Source archive:** <https://static.crates.io/crates/stylua/stylua-2.5.2.crate>
- **Published:** 2026-05-16 15:47:03.299978+00
- **Last updated:** 2026-05-16 15:47:03.299978+00
- **Generated:** 2026-09-19T06:45:57+00:00

## Executables

- stylua (binary): Declared by crates.io version metadata.

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-09-19
- Package-manager version: 2.5.2

## Security Notes

No matching local secret-handling manifest was found for stylua. Package metadata is still published here so future coverage has a stable package URL.


## Source Database Details

- **Source Database:** crates.io database dump
- **Crate ID:** 325,325
- **Crate Size:** 175,973
- **Edition:** 2018
- **Executable Intent:** Intent: public_cli, Signals: manifest declares a binary target, binary name matches crate name
- **Has Lib:** yes
- **Num Versions:** 62
- **Recent Download Window Days:** 90
- **Version ID:** 2,408,081

## Other Package-Manager Records

- Nix - stylua: normalized package name match | nixpkgs package indexes: pkgs/by-name/st/stylua/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - stylua - 2.5.2-r0: normalized package name match | Alpine Linux edge package indexes: stylua from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Opinionated Lua code formatter | https://github.com/JohnnyMorganz/StyLua
- pacman - stylua - 2.5.2-1: normalized package name match | Arch Linux sync databases: stylua from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Deterministic code formatter for Lua | https://github.com/JohnnyMorganz/StyLua
- zypper - StyLua - 2.0.2-1.7: normalized package name match | openSUSE Tumbleweed package metadata: StyLua from https://download.opensuse.org/tumbleweed/repo/oss/repodata/d310d5a96106e1e8872a385adf98aaa23be9db5d80937a6717314e7e7f37715065c6c748ab7ccee6475d620b46979c0fe64235fc0c46988e17edf659578fcf31-primary.xml.zst | Opinionated Lua code formatter | https://github.com/JohnnyMorganz/StyLua
- MacPorts - stylua: normalized package name match | MacPorts ports tree: lua/stylua/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/stylua: normalized package name match | Scoop official bucket manifest trees: bucket/stylua.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - JohnnyMorganz.StyLua: normalized package name match | Windows Package Manager source index: JohnnyMorganz.StyLua from https://cdn.winget.microsoft.com/cache/source.msix


## Related links

- [stylua](https://pkg.so/brew/stylua/) - Same normalized package name exists in another local package ecosystem.

## Sources

- crates.io package index
- external package-manager database matches
- cross-ecosystem install command graph
