Skip to content

Getting Started

  • Windows (including WSL), macOS, or Linux
  • x86_64 or ARM64
  • Node.js v14.18 or newer (not applicable if you use the standalone executable)

The fastest way to download Biome is to use npm or your preferred package manager. The CLI is also available as a standalone executable if you want to use Biome without installing Node.js.

To install Biome, run the following commands in a directory containing a package.json file.

  • npm
  • yarn
  • pnpm
  • Bun Logo bun
  
Terminal window
npm install --save-dev --save-exact @biomejs/biome
  
Terminal window
yarn add --dev --exact @biomejs/biome
  
Terminal window
pnpm add --save-dev --save-exact @biomejs/biome
  
Terminal window
bun add --dev --exact @biomejs/biome

It’s highly recommended not to use range operators when installing Biome. Check the versioning page for more information.

We recommend creating a biome.json configuration file for each project. It eliminates the need to repeat the CLI options every time you run a command and ensures that Biome applies the same configuration in your editor. If you’re happy with Biome’s defaults, you don’t have to create the configuration.

To create the configuration, run the init command in the root folder of your project:

  • npm
  • yarn
  • pnpm
  • Bun Logo bun
  • deno
	
Terminal window
npx @biomejs/biome init
	
Terminal window
yarn dlx @biomejs/biome init
	
Terminal window
pnpm dlx @biomejs/biome init
	
Terminal window
bunx @biomejs/biome init
	
Terminal window
deno run -A npm:@biomejs/biome init

After running the init command, you’ll now have a new biome.json file in your directory:

biome.json
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"organizeImports": {
"enabled": false
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}

The linter.enabled: true enables the linter and rules.recommended: true enables the recommended rules.

Formatting is enabled because the configuration doesn’t explicitly disable formatting with formatter.enabled: false.

Biome CLI comes with many commands and options, so you can use only what you need.

You can format files and directories using the format command and the --write option:

  • npm
  • yarn
  • pnpm
  • Bun Logo bun
  • deno
	
Terminal window
npx @biomejs/biome format <files> --write
	
Terminal window
yarn dlx @biomejs/biome format <files> --write
	
Terminal window
pnpm dlx @biomejs/biome format <files> --write
	
Terminal window
bunx @biomejs/biome format <files> --write
	
Terminal window
deno run -A npm:@biomejs/biome format <files> --write

You can lint and apply safe fixes to files and directories using the lint command with the --apply:

  • npm
  • yarn
  • pnpm
  • Bun Logo bun
  • deno
	
Terminal window
npx @biomejs/biome lint <files>
	
Terminal window
yarn dlx @biomejs/biome lint <files>
	
Terminal window
pnpm dlx @biomejs/biome lint <files>
	
Terminal window
bunx @biomejs/biome lint <files>
	
Terminal window
deno run -A npm:@biomejs/biome lint <files>

You can apply both of them by leveraging the check command:

  • npm
  • yarn
  • pnpm
  • Bun Logo bun
  • deno
	
Terminal window
npx @biomejs/biome check --apply <files>
	
Terminal window
yarn dlx @biomejs/biome check --apply <files>
	
Terminal window
pnpm dlx @biomejs/biome check --apply <files>
	
Terminal window
bunx @biomejs/biome check --apply <files>
	
Terminal window
deno run -A npm:@biomejs/biome check --apply <files>

The command check is command meant to run multiple tools at once. Currently, it does:

  • format files
  • lint files
  • organize imports

We recommend installing an editor plugin to get the most out of Biome. Check out the editor page to know which editors support Biome.

If you’re using Node.js, the recommended way to run Biome in CI is to use your favourite package manager. This ensures that your CI pipeline uses the same version of Biome as you do inside the editor or when running local CLI commands.

Success! You’re now ready to use Biome. 🥳