---
title: Scripts
---

Every script key from the root Composer and npm manifests, plus the keys the blocks overlay merges into root `package.json`.

## Composer

From `composer.json` `scripts` and `scripts-descriptions`.

<!-- wp:docspress/fields {"title":"composer.json scripts","searchable":true,"compact":false,"fields":[{"name":"php-lint","type":"string","required":false,"defaultValue":"","description":"Syntax lint only (parallel-lint).","values":"","deprecated":false},{"name":"phpcs","type":"string","required":false,"defaultValue":"","description":"Coding standards against phpcs.xml.dist, whole tree.","values":"","deprecated":false},{"name":"phpcbf","type":"string","required":false,"defaultValue":"","description":"Auto-fix what phpcs can.","values":"","deprecated":false},{"name":"phpstan","type":"string","required":false,"defaultValue":"","description":"Static analysis at the level in phpstan.neon.","values":"","deprecated":false},{"name":"check-branch-cs","type":"string","required":false,"defaultValue":"","description":"PHPCS over only the lines this branch changed. What linchpin/actions' php-checks.yml runs.","values":"","deprecated":false},{"name":"check-staged-cs","type":"string","required":false,"defaultValue":"","description":"The same line-scoped check against what a commit is about to introduce. What the husky pre-commit hook runs.","values":"","deprecated":false},{"name":"fixer","type":"string","required":false,"defaultValue":"","description":"php-cs-fixer, applying fixes.","values":"","deprecated":false},{"name":"fixer:test","type":"string","required":false,"defaultValue":"","description":"php-cs-fixer in dry-run mode.","values":"","deprecated":false},{"name":"phpunit","type":"string","required":false,"defaultValue":"","description":"Unit suite. No database.","values":"","deprecated":false},{"name":"lint","type":"string","required":false,"defaultValue":"","description":"Every static gate.","values":"","deprecated":false},{"name":"test","type":"string","required":false,"defaultValue":"","description":"Every static gate, then the unit suite.","values":"","deprecated":false},{"name":"build","type":"string","required":false,"defaultValue":"bash scripts/build.sh","description":"Build the distributable zip into build/plugin-scaffold.zip.","values":"","deprecated":false}]} /-->

<!-- wp:docspress/terminal-session {"title":"composer test","shell":"bash","prompt":"$","command":"composer test","output":""} /-->

## npm (root)

From root `package.json` `scripts`. Commands are `@wordpress/scripts` except `prepare`.

<!-- wp:docspress/fields {"title":"package.json scripts","searchable":true,"compact":false,"fields":[{"name":"build","type":"string","required":false,"defaultValue":"wp-scripts build","description":"Compile src/admin/index.js to build/.","values":"","deprecated":false},{"name":"start","type":"string","required":false,"defaultValue":"wp-scripts start","description":"Watch the root webpack config.","values":"","deprecated":false},{"name":"format","type":"string","required":false,"defaultValue":"wp-scripts format","description":"Format JavaScript with wp-scripts.","values":"","deprecated":false},{"name":"lint:js","type":"string","required":false,"defaultValue":"wp-scripts lint-js","description":"ESLint via wp-scripts. What js.yml runs.","values":"","deprecated":false},{"name":"lint:css","type":"string","required":false,"defaultValue":"wp-scripts lint-style","description":"Style lint via wp-scripts.","values":"","deprecated":false},{"name":"packages-update","type":"string","required":false,"defaultValue":"wp-scripts packages-update","description":"Update @wordpress/* packages through wp-scripts.","values":"","deprecated":false},{"name":"prepare","type":"string","required":false,"defaultValue":"husky","description":"Install Husky git hooks after npm install.","values":"","deprecated":false}]} /-->

## Blocks overlay scripts

Merged into root `package.json` only after `--with-blocks`. Source: `overlays/blocks/package-scripts.json`.

<!-- wp:docspress/fields {"title":"package-scripts.json","searchable":true,"compact":false,"fields":[{"name":"install:all","type":"string","required":false,"defaultValue":"npm install && npm install --prefix blocks","description":"Install root and nested workspaces.","values":"","deprecated":false},{"name":"install:ci","type":"string","required":false,"defaultValue":"npm ci && npm ci --prefix blocks","description":"Lockfile-strict install for both workspaces.","values":"","deprecated":false},{"name":"build:blocks","type":"string","required":false,"defaultValue":"npm run build --prefix blocks","description":"Build the nested blocks project.","values":"","deprecated":false},{"name":"build:all","type":"string","required":false,"defaultValue":"npm run build && npm run build:blocks","description":"Build admin, then blocks.","values":"","deprecated":false},{"name":"start:blocks","type":"string","required":false,"defaultValue":"npm run start --prefix blocks","description":"Watch the nested blocks project.","values":"","deprecated":false}]} /-->

The nested `blocks/package.json` defines its own `build`, `start`, `format`, `lint:js`, `lint:css`, and `packages-update` scripts. The `build` command includes `--blocks-manifest --webpack-copy-php --experimental-modules`. See the [blocks overlay](../overlays/blocks.md).
