Skip to content

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
  • --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

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, single path or list of paths. If not provided, current working directory is used. Glob is supported only for exclude patterns like '!**/fixtures/*.js'.

Available options:

  • -h, --help — Prints help information
  • -V, --version — Prints version information

Released under the MIT License.