---
url: /docs/guide/usage/formatter/cli.md
---

# Command-line Interface

## Usage

**`oxfmt`** \[**`-c`**=*`PATH`*] \[*`PATH`*]...

## Mode Options:

* **`    --init`** —
  Initialize `.oxfmtrc.json` with default values
* **`    --migrate`**=*`SOURCE`* —
  Migrate configuration to `.oxfmtrc.json` from specified source Available sources: prettier, biome
* **`    --lsp`** —
  Start language server protocol (LSP) server
* **`    --stdin-filepath`**=*`PATH`* —
  Specify the file name to use to infer which parser to use

## Output Options:

* **`    --write`** —
  Format and write files in place (default)
* **`    --check`** —
  Check if files are formatted, also show statistics
* **`    --list-different`** —
  List files that would be changed

## Config Options

* **`-c`**, **`--config`**=*`PATH`* —
  Path to the configuration file (.json, .jsonc, .ts, .mts, .cts, .js, .mjs, .cjs)
* **`    --disable-nested-config`** —
  Do not search for configuration files in subdirectories

## Ignore Options

* **`    --ignore-path`**=*`PATH`* —
  Path to ignore file(s). Can be specified multiple times. If not specified, .gitignore and .prettierignore in the current directory are used.
* **`    --with-node-modules`** —
  Format code in node\_modules directory (skipped by default)

## Runtime Options

* **`    --no-error-on-unmatched-pattern`** —
  Do not exit with error when pattern is unmatched
* **`    --threads`**=*`INT`* —
  Number of threads to use. Set to 1 for using only 1 CPU core.

## Available positional items:

* *`PATH`* —
  Single file, path or list of paths. Glob patterns are also supported. (Be sure to quote them, otherwise your shell may expand them before passing.) Exclude patterns with `!` prefix like `'!**/fixtures/*.js'` are also supported. If not provided, current working directory is used.

## Available options:

* **`-h`**, **`--help`** —
  Prints help information
* **`-V`**, **`--version`** —
  Prints version information
