{
  "id": "stylua",
  "name": "StyLua",
  "homepage": "https://github.com/JohnnyMorganz/StyLua",
  "description": "An opinionated Lua code formatter.",
  "executables": [
    "stylua"
  ],
  "dotfiles": {
    "paths": [
      "[configHome]/stylua/stylua.toml"
    ],
    "secret": [],
    "side_effect": false
  },
  "commands": {
    "format": 1,
    "label": "Format Lua files",
    "description": "Format or check Lua/Luau files and directories with StyLua. Range formatting, stdin, glob filters and per-style overrides other than indentation and column width are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "readme",
        "kind": "help",
        "url": "https://raw.githubusercontent.com/JohnnyMorganz/StyLua/main/README.md",
        "revision": "2026-10-27",
        "evidence": "To check whether files require formatting (but not write directly to them), use the `--check` flag.\n- `--output-format=standard`: output a custom diff (default)\n- `--output-format=unified`: output a unified diff, consumable by tools like `patch` or `delta`\n- `--output-format=json`: output JSON representing the changes, useful for machine-readable output\n- `--output-format=summary`: output a summary list of file paths that are incorrectly formatted\nyou can optionally provide the filename via `--stdin-filepath`.\nUse `--config-path <path>` to provide a custom path to the configuration.\nUse `--search-parent-directories` to recursively search parent directories.\nAlternatively, you can specify it on the command line, with `stylua --syntax lua52 ...`\nWhen specifying the option on the command line, replace the underscore with a dash, e.g., `indent_type` becomes `--indent-type`.\n| `column_width`               | `120`              | Approximate line length for printing.\n| `indent_type`                | `Tabs`             | Indent type. Possible options: `Tabs` or `Spaces`\n| `indent_width`               | `4`                | Character size of single indentation.\nyou can use the `--verify` flag to verify the output of all formatting before saving the file.\n"
      }
    ],
    "field": [
      {
        "id": "check",
        "label": "Check only",
        "description": "Do not rewrite files; print a diff and exit with status 1 if any file needs formatting.",
        "type": "boolean",
        "option": [
          "--check"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "output_format",
        "label": "Check output format",
        "type": "enum",
        "option": [
          "--output-format"
        ],
        "choices": [
          {
            "value": "standard",
            "label": "Standard diff"
          },
          {
            "value": "unified",
            "label": "Unified diff"
          },
          {
            "value": "json",
            "label": "JSON"
          },
          {
            "value": "summary",
            "label": "Summary of files"
          }
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "verify",
        "label": "Verify output",
        "description": "Verify the formatted output before saving each file.",
        "type": "boolean",
        "option": [
          "--verify"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "config_path",
        "label": "Config file",
        "type": "path",
        "option": [
          "--config-path"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "readme"
        ]
      },
      {
        "id": "search_parents",
        "label": "Search parent directories for config",
        "type": "boolean",
        "option": [
          "--search-parent-directories"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "indent_type",
        "label": "Indent type",
        "type": "enum",
        "option": [
          "--indent-type"
        ],
        "choices": [
          {
            "value": "Tabs",
            "label": "Tabs"
          },
          {
            "value": "Spaces",
            "label": "Spaces"
          }
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "files",
        "label": "Files or directories",
        "type": "path",
        "position": 0,
        "multiple": true,
        "path": {
          "kind": "any",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "readme"
        ]
      }
    ],
    "task": [
      {
        "id": "format",
        "label": "Format in place",
        "fields": [
          "files",
          "verify"
        ],
        "required": [
          "files"
        ]
      },
      {
        "id": "check",
        "label": "Check formatting",
        "fields": [
          "files",
          "check",
          "output_format"
        ],
        "required": [
          "files",
          "check"
        ],
        "set": {
          "check": [
            true
          ]
        }
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "files",
          "check",
          "output_format",
          "verify"
        ]
      },
      {
        "id": "advanced",
        "label": "Style and config",
        "fields": [
          "config_path",
          "search_parents",
          "indent_type"
        ]
      }
    ]
  }
}
