Commands
chef build
Build extensions with Rollup, Babel and PostCSS.
chef build [extensions...] [options]| Option | Description |
|---|---|
extensions | Extension names or glob patterns (main.core, ui.bbcode.*) |
-w, --watch | Watch for changes and rebuild |
-p, --path [path] | Build a specific directory |
-v, --verbose | Show detailed build logs |
-f, --force | Skip safety checks and force rebuild |
--production | Production mode (minification, no source maps) |
chef build main.core ui.buttons # Build specific extensions
chef build main.core -w # Build and watch for changes
chef build ui.bbcode.* # Build direct children
chef build im.v2.** # Build all nested extensions
chef build # Build all in current directory
chef build ui.buttons --production # Production buildGlob patterns
| Pattern | Description | Example |
|---|---|---|
* | One level deep | ui.bbcode.* → ui.bbcode.parser, ui.bbcode.model |
** | All levels deep | im.v2.** → im.v2.const, im.v2.provider.service.settings |
TIP
In zsh, escape glob patterns to prevent shell expansion: chef build ui.\*
chef test
Run unit and E2E tests via Playwright.
chef test [extensions...] [options] # unit + e2e
chef test unit [extensions...] [file?] # unit only
chef test e2e [extensions...] [file?] # e2e only
chef test module [modules...] [options] # module-level scenario tests| Option | Description |
|---|---|
extensions | Extension names or glob patterns |
modules | For module only — module names (defaults to the module of the current directory) |
file | For unit/e2e only — test file name (dom.test.ts) |
-w, --watch | Watch for changes and rerun tests |
-p, --path [path] | Test a specific directory |
--headed | Run with visible browser window |
--debug | Open browser with DevTools and sourcemaps |
--grep <pattern> | Run only tests matching the pattern |
--project <names> | Run in specific browsers (chromium, firefox, webkit) |
--console | Print captured browser console output (hidden by default) |
chef test main.core ui.buttons # All tests
chef test unit main.core # Unit only
chef test unit main.core ./render-tag.test.ts # Specific file
chef test e2e ui.buttons # E2E only
chef test ui.* --headed # Direct children, with visible browser
chef test im.v2.** # All nested extensions
chef test main.core -w # Watch mode
chef test main.core --debug # Debug with DevTools
chef test --grep "should render" # Filter by name
chef test main.core --project chromium firefox # Specific browsers
chef test main.core --console # With browser console output
chef test module crm # Scenario tests for the crm module
chef test module # Module of the current directoryThe module subcommand runs module-level E2E scenario tests — for checks that involve several extensions at once. See Scenario Tests for details.
chef typecheck
Check TypeScript types in extensions.
chef typecheck [extensions...] [options]| Option | Description |
|---|---|
extensions | Extension names or glob patterns |
-p, --path [path] | Search for extensions starting from this directory |
--file <patterns...> | Check specific files (paths relative to extension root) |
--exclude <patterns...> | Exclude files from type checking (paths or glob patterns relative to extension root) |
chef typecheck main.core # Check a specific extension
chef typecheck ui.bbcode.* # Check a group of extensions
chef typecheck main.core --file src/lib/dom.ts # Check a specific file
chef typecheck main.core --exclude 'src/legacy/**' # Exclude files from checking
chef typecheck # Check all in current directoryTIP
Types are checked automatically during build (chef build). The chef typecheck command is useful when you need to check types without a full build.
chef lint
Lint extensions with oxlint (ESLint is kept for the transition: --linter eslint).
chef lint [extensions...] [options]| Option | Description |
|---|---|
extensions | Extension names or glob patterns |
-p, --path [path] | Search for and lint extensions starting from this directory |
--fix | Automatically fix problems |
--file <patterns...> | Lint specific files (glob patterns relative to src/) |
--exclude <patterns...> | Exclude files from linting (glob patterns relative to extension root) |
--no-cache | Disable caching (cache is enabled by default) |
--linter <eslint|oxlint> | Linter to use, oxlint by default; also CHEF_LINTER |
--lsp | Run the oxlint language server for editors on stdin/stdout |
chef lint main.core # Lint a specific extension
chef lint ui.* # Lint a group of extensions
chef lint main.core --fix # Auto-fix problems
chef lint main.core --file "*.ts" # Lint only .ts files
chef lint main.core --exclude 'src/old/**' # Exclude files from lintingTIP
With --linter eslint (or CHEF_LINTER=eslint), chef lint requires an eslint.config.{js,mjs,cjs,ts,mts,cts} file in the project. If no config is found, linting is skipped.
oxlint
oxlint is the default linter. chef uses the project's oxlint.config.ts or .oxlintrc.json when there is one, and the Bitrix24 presets otherwise: @bitrix24/oxlint-config-bitrix24 and @bitrix24/oxlint-config-bitrix24-mobile. Files matching the ignorePatterns of the project config are not linted, Flow files included.
chef lint main.core # Lint with oxlint
chef lint -p ui --fix # Fix a whole module
chef lint main.core --linter eslint # Lint with ESLint, as before- Flow files. oxlint has no Flow parser. chef lints a Flow file through a copy that oxlint can read and that keeps every position of the original: maybe types (
?string) lose their?and the file is linted as TypeScript; a file TypeScript cannot read has its types blanked out. Diagnostics caused by the transformation itself are not reported, and neither is formatting inside Flow type annotations. With--fix, fixes are carried back to the original; type-stripped files are reported but not fixed. - Unparsable files are reported with a parsing error instead of being skipped silently.
- Speed. Extensions are sent to oxlint in groups as they are found, each oxlint process lints hundreds of files; results are reported in order as soon as their group is linted.
- Positions are reported in UTF-16 columns, like ESLint.
Language server
chef lint --lsp (or the chef-oxlint --lsp binary) runs the oxlint language server behind a proxy that understands Flow files the same way chef lint does. Editors that start an oxlint binary for the language server can be pointed at chef-oxlint: with --lsp it serves chef's language server, any other arguments go to oxlint unchanged. Run with no arguments, chef-oxlint serves the language server too when the first thing on its stdin is an LSP message, as editors send. See PhpStorm.
chef diag
Diagnose and analyze extensions across the project.
chef diag <subcommand> [options]Subcommands
| Subcommand | Description |
|---|---|
top-used | Most depended-on extensions |
top-deps | Extensions with the most direct dependencies |
top-deps-tree | Extensions with the largest transitive dependency tree |
top-bundle-size | Extensions with the largest bundles (JS + CSS + assets) |
top-total-size | Extensions with the largest total size (own code + dependencies) |
deps-tree | Dependency tree for an extension |
bundle-size | Bundle size for an extension (JS + CSS + assets) |
config | Search extensions by bundle.config parameters |
unused-deps | Extensions with unused dependencies |
circular-deps | Check for circular dependencies |
circular-imports | Check for circular imports between source files |
find-usages | Find where an extension's JS code is used (imports, namespace access, inheritance) |
find-loaders | Find PHP loaders for an extension (Extension::load, CJSCore::Init, config.php rel) |
unused | Extensions that are never referenced anywhere |
re-exports | Extensions that re-export symbols from other extensions |
baseline | Check for web features not supported by target browsers |
Common options
| Option | Description |
|---|---|
-p, --path [path] | Scan for extensions starting from this directory |
-l, --limit <n> | Limit the number of results (default: 20) |
-i, --include <patterns> | Show only extensions matching the glob pattern |
-x, --exclude <patterns> | Exclude extensions matching the glob pattern |
--sort <column> | Sort by column (for top-bundle-size and top-total-size) |
Patterns support *, **, ?, [abc] and other glob constructs. Multiple patterns via comma or by repeating the option:
--include 'ui.*' # Only ui.* extensions
--exclude 'main.*,im.*' # Everything except main.* and im.*
--include 'ui.*' -x 'ui.vue.*' # ui.*, but without ui.vue.*Examples
chef diag top-used # Most depended-on extensions
chef diag top-bundle-size --limit 10 # TOP 10 largest bundles
chef diag top-bundle-size --sort js # Sort by JS size
chef diag top-total-size --sort own # Sort by own bundle size
chef diag top-used --exclude 'main.*,im.*' # Exclude main and im from results
chef diag deps-tree im.v2.application.core # Dependency tree for an extension
chef diag deps-tree main.core --depth 2 # Limit tree depth
chef diag deps-tree main.core --why ui.vue3 # Find path to a specific dependency
chef diag bundle-size ui.buttons # Bundle size for an extension
chef diag bundle-size crm.timeline --with-deps # Including all dependencies
chef diag circular-deps # All circular dependencies
chef diag circular-deps main.core # Check a specific extension
chef diag unused-deps # Unused dependencies
chef diag find-usages ui.buttons # Summary of ui.buttons usages (JS)
chef diag find-usages ui.notification --list # Full list of locations
chef diag find-usages ui.notification --imports UI # Only files importing { UI }
chef diag find-usages ui.notification --namespace BX.UI.Notification.Center
chef diag find-usages ui.notification --kind extends # Only subclasses
chef diag find-loaders ui.notification # Where the extension is loaded from PHP
chef diag config --key namespace # Extensions with namespace in config
chef diag config --key minification --missing # Extensions without minification
chef diag config --key input --except # Extensions with params other than input
chef diag unused # Unused extensions
chef diag re-exports # Re-exports of symbols from other extensions
chef diag re-exports 'calendar.*' # Only within calendar.*
chef diag re-exports 'im.v2.**' ui.text-editor # Multiple patterns at once
chef diag baseline # Overview of unsupported features across all extensions
chef diag baseline ui.buttons # Check a specific extensionchef aliases
Regenerate TypeScript path aliases (aliases.tsconfig.json).
chef aliases [options]| Option | Description |
|---|---|
-p, --path [path] | Project root to scan for extensions |
-q, --quiet | Quiet mode — single-line output without colors |
chef aliases # Regenerate aliases
chef aliases -q # Quiet mode (for scripts and hooks)Usually runs automatically via VCS hooks (see chef init hooks).
chef create
Create a new Bitrix extension with standard file structure.
chef create <name> [options]| Option | Description |
|---|---|
name | Extension name (my.extension) |
-p, --path [path] | Create in a specific directory |
-t, --tech [tech] | Technology: ts or js. Auto-detected from the environment by default |
-f, --force | Overwrite without confirmation |
chef create my.extension # TypeScript extension
chef create my.extension --tech js # JavaScript extension
chef create my.extension -p ./local/js/vendor # In a specific directoryGenerated files:
my.extension/
├── bundle.config.ts
├── config.php
└── src/
└── my.extension.tschef init
Initialize build and test environment.
chef init build
Initialize TypeScript, path aliases and browserslist.
chef init build [options]| Option | Description |
|---|---|
-p, --path [path] | Initialize in a specific directory |
The command:
- Scans all extensions in the project
- Generates
aliases.tsconfig.jsonwith path aliases for each extension - Creates
tsconfig.jsonwith recommended settings - Creates
.browserslistrcwith recommended browser targets
See TypeScript for details.
chef init tests
Initialize the Playwright test environment.
chef init tests [options]| Option | Description |
|---|---|
-p, --path [path] | Initialize in a specific directory |
Creates playwright.config.ts and .env.test in the project root.
See Testing for details.
chef init hooks
Install VCS hooks to auto-update path aliases.
chef init hooks [options]| Option | Description |
|---|---|
-p, --path [path] | Project root where hooks will be installed |
Supports Git and Mercurial. Hooks run chef aliases --quiet after pull, merge, checkout and rebase to keep aliases.tsconfig.json up to date.
chef init agents
Connect the chef guide for AI coding agents.
chef init agents [options]| Option | Description |
|---|---|
-p, --path [path] | Project root where agent instructions will be written |
Adds a block to AGENTS.md (and to an existing CLAUDE.md) that sends agents to chef help agent. See AI Agents for details.
chef baseline
Check web feature availability for your project's browser targets.
chef baseline [query] [options]| Option | Description |
|---|---|
query | Feature ID or search query (subgrid, "private fields", Promise.any) |
--list | List all supported and transpiled features |
-p, --path [path] | Path to project (for reading .browserslistrc) |
Without arguments or with --list, outputs a full list of available features grouped by category (JavaScript, CSS, API, HTML).
Searching features
Search works by ID, name, description and MDN identifiers (compat_features). Queries are automatically normalized — spaces are converted to hyphens for ID matching.
chef baseline subgrid # Search by ID
chef baseline "private fields" # Search by compat_features
chef baseline "container queries" # Search CSS feature
chef baseline "Promise.any" # Search JS APIStatuses
Results show the status relative to current targets:
✓ supported— natively supported by all target browsers~ transpiled— JS syntax, transpiled by Babel✗ unsupported— not supported, requires a polyfill or fallback
For Babel-transpiled features, a per-transform breakdown shows which parts work natively and which will be transpiled.
Examples
chef baseline # All available features (supported + transpiled)
chef baseline class-syntax # Feature details with Babel transforms
chef baseline "arrow functions" # Search by description
chef baseline --list # Full list by categorychef flow-to-ts
Migrate Flow.js typed code to TypeScript.
chef flow-to-ts [extensions...] [options]| Option | Description |
|---|---|
extensions | Extension names or glob patterns (main.core, ui.bbcode.*) |
-p, --path [path] | Migrate a specific directory |
--rm-ts | Remove existing .ts files after migration |
--rm-js | Remove original .js files after migration |
What it does:
- Renames
.jsfiles to.tsviahg rename - Converts Flow syntax to TypeScript equivalents
- Updates
bundle.config.js→bundle.config.ts
See Flow.js → TypeScript for details.
chef help
Command help and the guide for AI coding agents.
chef help [command...]chef help # List of commands
chef help build # All options of a command
chef help test unit # Options of a subcommand
chef help agent # Guide for AI coding agentschef help agent prints a guide for AI coding agents that matches the installed chef version. See AI Agents for details.