> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qlty.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# fmt

```bash lines theme={"system"}
qlty fmt [OPTIONS] [PATHS]...
```

Auto-format files by rewriting them

By default, only changed files are auto-formatted. Use `--all` or specify paths to override this behavior.

Installs plugins and their required runtimes as needed before analyzing.

Must be run within a Git repository with Qlty initializd.

## Arguments

<AccordionGroup>
  <Accordion title="[PATHS]...">Files to analyze</Accordion>
  <Accordion title="-a, --all">Check all files, not just changed</Accordion>
  <Accordion title="--no-progress">Disable progress bar</Accordion>
  <Accordion title="--no-error">Exit successfully regardless of linter errors</Accordion>

  <Accordion title="--sample <SAMPLE>">
    Sample results from a number of files for each linter
  </Accordion>

  <Accordion title="--jobs <JOBS>">Maximum number of concurrent jobs</Accordion>
  <Accordion title="--filter <FILTER>">Filter by plugin or check</Accordion>

  <Accordion title="--trigger <TRIGGER>">
    \[default: manual] \[possible values: manual, pre-commit, pre-push, build]
  </Accordion>

  <Accordion title="-v, --verbose...">Print verbose output</Accordion>
  <Accordion title="--upstream <UPSTREAM>">Upstream base ref to compare against</Accordion>
  <Accordion title="--index">Format files in the Git index</Accordion>

  <Accordion title="--index-file <INDEX_FILE>">
    Format files in the specified Git index file
  </Accordion>
</AccordionGroup>

## Examples

```bash Auto-format changed files on your current branch lines theme={"system"}
qlty fmt
```

```bash Auto-format all files with prettier lines theme={"system"}
qlty fmt --all --filter=prettier
```

```bash Auto-format files in a directory lines theme={"system"}
qlty fmt web/
```

## See Also

* [`init`](/cli/commands/init)
* [`check`](/cli/commands/check)
* [Available Plugins](/plugins)
* [Excluding Files](/excluding-files)
* [Global Options](/cli/global-options)
