# oxfmt — card for AI agents

Fast JavaScript formatter from the Oxc compiler project.

Category: Linting and formatting · npm package `oxfmt` · latest version 0.75.0 (checked 2026-11-01)
Install: `npm install oxfmt`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## oxfmt
- Install as a dev dependency (`pnpm add -D oxfmt`). Add `"fmt": "oxfmt"` and `"fmt:check": "oxfmt --check"` scripts.
- In CI, run `oxfmt --check`, not the write mode.
- In lint-staged, use `oxfmt --no-error-on-unmatched-pattern`.
- When replacing Prettier or Biome, run `oxfmt --migrate prettier` or `oxfmt --migrate biome` first. Then reformat with `oxfmt` and uninstall the old packages.
- Do not add `prettier-plugin-tailwindcss`: Tailwind class sorting is built in.
- For a typed config, use `oxfmt.config.ts` with `defineConfig` from `oxfmt`. `oxfmt .` discovers it automatically, so no config path flag is needed.
- After migrating, update CONTRIBUTING.md, AGENTS.md or CLAUDE.md if they still mention prettier.

## Docs written for agents
- [llms.txt (index of the docs)](https://oxc.rs/llms.txt)

## What it is
- Oxfmt is the formatter in Oxc, a collection of JavaScript and TypeScript tools written in Rust. The linter Oxlint comes from the same project. The beta announcement calls Oxfmt a "Rust-powered, Prettier-compatible code formatter built for the JavaScript ecosystem." The project website still labels the formatter Beta.
- You install it as a dev dependency. Run `oxfmt` to write changes or `oxfmt --check` to only check them. The docs index describes configuring it with a `.oxfmtrc.json` file. One package author recommends a typed `oxfmt.config.ts` instead. There is also a Node.js `format()` API. The `--migrate prettier` and `--migrate biome` flags convert an existing config.
- The beta post is written for projects moving off Prettier. It gives a one-line migration command and a ready-made prompt to hand to an AI coding assistant. The docs index also has a page on configuring coding agents to use Oxlint and Oxfmt.

## Caveats
- Still beta: The project announced Oxfmt as beta, and the website still labels it that way. The roadmap to a stable release lists stability and performance work.
- Prettier plugins were on the roadmap: As of the beta announcement, Prettier plugin support was listed as roadmap work toward stable, along with better xxx-in-js formatting. Check its current status if you rely on a Prettier plugin.
- Some plugin behavior is lost: Ching writes that Oxfmt replaces Prettier's native rules but that some plugins need trade-offs. In Ching's case, that meant dropping Pangu spacing formatting for Markdown for now.
- package.json is reordered by default: Field sorting in `package.json` is on by default. Expect those files to change the first time you run it.
- Format-only speedup was modest in one migration: In one monorepo, formatting alone went from ~2.9s on Biome to ~1.9s on Oxfmt. The author credits the large headline drop to removing ESLint, not to the formatter.

## Numbers (AgentGid data)
- Gid Score: 79.6 (#108 of all tools, 6 of 83 in its category)
- Used in 168 public projects set up for AI coding agents (2.7%)
- Downloads last week: 33,092,096 (as of 2026-11-24), +78.5% over 4 weeks
- GitHub stars: 23,581 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
oxlint 92.9%, oxlint-tsgolint 44.6%, Vitest 56.5%, TypeScript 90.5%, Zod 51.8%, dotenv 38.7%

## Checked alternatives (same job)
- Prettier: https://agentgid.com/tools/prettier/agent.md
- Biome: https://agentgid.com/tools/biomejs/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/oxfmt/
- Homepage: https://oxc.rs/docs/guide/usage/formatter
- Repository: https://github.com/oxc-project/oxc
- Source: https://github.com/oxc-project/oxc#readme
- Source: https://github.com/oxc-project/oxc
- Source: https://github.com/oxc-project/oxc/releases
- Source: https://oxc.rs
- Source: https://oxc.rs/llms.txt

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
