Additional Biome capabilities for debugging, pattern searching, server management, and LSP integration.
Search for GritQL patterns across a project.
biome search [OPTIONS] <PATTERN> [PATHS]...Status: EXPERIMENTAL - API may change in future versions
Arguments:
<PATTERN> - The GritQL pattern to search for (use single quotes to avoid shell interpretation)[PATHS]... - Files or directories to search (default: current directory)Options:
# Target language (default: JavaScript)
-l, --language <LANGUAGE>
# Process stdin with specified file path
--stdin-file-path <PATH>Usage Examples:
# Search for console.log statements
biome search '`console.log($message)`'
# Search in specific directory
biome search '`console.log($message)`' ./src
# Search for function calls with specific pattern
biome search '`fetch($url)`'
# Search for React hooks
biome search '`useState($initial)`'
# Search with specific language
biome search --language typescript '`interface $name { }`'
# Process stdin
echo "console.log('hello')" | biome search '`console.log($msg)`' --stdin-file-path=file.jsGritQL Pattern Syntax:
GritQL uses backticks to escape code snippets:
`console.log($message)` - Match console.log with any argument`$var = $value` - Match variable assignments$variable - Capture/match any expression`function $name() { }` - Match function declarationsImportant:
biome search `console.log($msg)` (shell interprets backticks)biome search '`console.log($msg)`' (single quotes protect backticks)Output:
src/index.ts:10:5
console.log('hello world')
src/utils.ts:25:10
console.log(result)
Found 2 matchesExit Codes:
0 - Pattern found1 - Pattern not found or error occurredPrint debugging information useful for filing bug reports.
biome rage [OPTIONS]Options:
# Print daemon server logs
--daemon-logs
# Print formatter options applied
--formatter
# Print linter options applied
--linterUsage Examples:
# Basic debugging info
biome rage
# Include daemon logs
biome rage --daemon-logs
# Show formatter configuration
biome rage --formatter
# Show linter configuration
biome rage --linter
# Show all information
biome rage --daemon-logs --formatter --linterOutput Includes:
Basic information:
With --daemon-logs:
With --formatter:
With --linter:
Example Output:
CLI Version: 2.3.8
Platform: linux-x64
CPU Architecture: x86_64
Configuration:
Path: /project/biome.json
Status: Loaded successfully
Root: true
Workspace:
Root: /project
VCS: git (enabled)
Formatter:
Enabled: true
IndentStyle: space
IndentWidth: 2
LineWidth: 80
Linter:
Enabled: true
Rules: 342 enabled
Errors: 120
Warnings: 222Use Cases:
Exit Codes:
0 - Always succeedsShow documentation for rules, diagnostics, or other CLI aspects.
biome explain <NAME>Arguments:
<NAME> - Name of the rule or documentation topic to explainUsage Examples:
# Explain a linter rule
biome explain noDebugger
biome explain noUnusedVariables
biome explain useConst
# Explain daemon logs topic
biome explain daemon-logs
# Explain specific rule with category
biome explain correctness/noUnusedVariablesOutput:
Displays comprehensive documentation for the specified rule or topic, including:
Example Output:
Rule: noDebugger
Category: suspicious
Severity: error
Description:
Disallow the use of debugger statements in production code.
Why:
Debugger statements cause execution to pause and should not be
present in production code. They are useful during development
but should be removed before deployment.
Invalid:
function example() {
debugger; // ❌
return 42;
}
Valid:
function example() {
return 42; // ✅
}
Configuration:
{
"linter": {
"rules": {
"suspicious": {
"noDebugger": "error"
}
}
}
}
See also:
- noConsoleLog
- noConsole
Source: ESLint no-debuggerAvailable Topics:
noDebugger, useConst)daemon-logs)Exit Codes:
0 - Documentation displayed successfully1 - Rule or topic not foundClean logs emitted by the daemon server.
biome cleanUsage Examples:
# Clean all daemon logs
biome clean
# Useful after debugging sessions
biome rage --daemon-logs # View logs
biome clean # Remove logsBehavior:
~/.cache/biome/~/Library/Caches/biome/%LOCALAPPDATA%\biome\cache\BIOME_LOG_PATH environment variableExit Codes:
0 - Logs cleaned successfully1 - Error accessing or removing log filesStart the Biome daemon server process.
biome start [OPTIONS]Options:
# Prefix for log file names (default: "server.log")
--log-prefix-name <STRING>
# Directory where logs are stored
--log-path <PATH>Environment Variables:
BIOME_LOG_PREFIX_NAME - Alternative to --log-prefix-nameBIOME_LOG_PATH - Alternative to --log-pathUsage Examples:
# Start daemon with defaults
biome start
# Start with custom log prefix
biome start --log-prefix-name=my-daemon
# Start with custom log directory
biome start --log-path=/tmp/biome-logs
# Start with environment variables
export BIOME_LOG_PATH=/var/log/biome
export BIOME_LOG_PREFIX_NAME=production
biome startBehavior:
{prefix}.{timestamp}.logBenefits:
Use Cases:
Exit Codes:
0 - Daemon started successfully1 - Error starting daemon (e.g., already running, permission denied)Stop the Biome daemon server process.
biome stopUsage Examples:
# Stop running daemon
biome stop
# Typical workflow
biome start
biome check --use-server --write
biome format --use-server --write
biome stopBehavior:
biome clean for that)Exit Codes:
0 - Daemon stopped successfully (or wasn't running)1 - Error stopping daemonAct as a server for the Language Server Protocol over stdin/stdout.
biome lsp-proxy [OPTIONS]Options:
# Prefix for log file names
--log-prefix-name <STRING>
# Directory where logs are stored
--log-path <PATH>
# Bogus argument for vscode-languageclient compatibility
--stdioEnvironment Variables:
BIOME_LOG_PREFIX_NAME - Alternative to --log-prefix-nameBIOME_LOG_PATH - Alternative to --log-pathUsage Examples:
# Start LSP server
biome lsp-proxy
# Start with custom logging
biome lsp-proxy --log-prefix-name=lsp --log-path=/tmp/biome-lsp
# VS Code compatible invocation
biome lsp-proxy --stdioBehavior:
LSP Capabilities:
Formatting:
Linting:
Code Actions:
Editor Integration:
VS Code:
{
"biome.lspBin": "path/to/biome"
}Neovim (with nvim-lspconfig):
require('lspconfig').biome.setup{}Emacs (with lsp-mode):
(add-to-list 'lsp-language-id-configuration '(typescript-mode . "typescript"))
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection '("biome" "lsp-proxy"))
:major-modes '(typescript-mode js-mode)
:server-id 'biome))Exit Codes:
Complete workflow for using the Biome daemon:
# Start daemon
biome start
# Verify it's running
biome rage --daemon-logs# Commands with --use-server flag
biome check --use-server --write
biome format --use-server --write
biome lint --use-server --write
# Multiple invocations share the daemon
for file in *.ts; do
biome format --use-server --write "$file"
done# Stop daemon
biome stop
# Clean up logs (optional)
biome clean# Check daemon status
biome rage --daemon-logs
# Restart daemon
biome stop
biome clean
biome start
# Custom daemon configuration
export BIOME_LOG_PATH=/var/log/biome
export BIOME_LOG_PREFIX_NAME=production
biome startCombine multiple features for comprehensive debugging:
# Enable verbose logging and collect information
export BIOME_LOG_PATH=./debug-logs
biome start --log-prefix-name=debug
# Run commands with verbose output
biome check --use-server --verbose --log-level=debug
# Collect diagnostic information
biome rage --daemon-logs --formatter --linter > debug-info.txt
# Explain specific issues
biome explain noUnusedVariables
# Clean up
biome stop
biome cleanCommon GritQL patterns for the search command:
# Find all console statements
biome search '`console.$method($args)`'
# Find TODO comments
biome search '`// TODO: $message`'
# Find specific import patterns
biome search '`import $name from "react"`'
# Find function declarations
biome search '`function $name($params) { $body }`'
# Find arrow functions
biome search '`($params) => $body`'
# Find JSX components
biome search '`<$Component $props />`'
# Find state hooks
biome search '`const [$state, $setState] = useState($initial)`'
# Find effect hooks
biome search '`useEffect($fn, $deps)`'
# Find async functions
biome search '`async function $name($params) { $body }`'
# Find try-catch blocks
biome search '`try { $body } catch ($err) { $handler }`'When running as LSP server, Biome provides:
biome.json configurationoverrides