This is a quick reference for common commands used during development. Please keep detailed explanations and documentation in separate external files. For broader contribution guidelines, see docs/CONTRIBUTING.md.
- PHP
- Node.js
- pnpm
- Composer
- Docker
See the Quick Start guide or Development Environment guide for full setup instructions.
Most tasks use the Jetpack CLI. There are two options:
jetpack: runs in your local environment. See tools/cli/README.md for details.- You can invoke it as
pnpm jetpackfrom within the monorepo. - Optionally, you can link it to your path so you can just type
jetpack(pnpm install && pnpm jetpack cli link).
- You can invoke it as
jp: runs commands inside Docker, avoiding local version mismatches. Install globally withnpm install -g @automattic/jetpack-cli. See projects/js-packages/jetpack-cli/README.md.
The examples below use jetpack; prefix with pnpm if you haven't linked it or use jp as desired.
Install root dependencies:
pnpm install # JS dependencies
composer install # PHP dependenciesjetpack build --all # build all projects
jetpack build <project> # build a specific project (e.g. plugins/jetpack)
jetpack build <project> --deps # build a specific project with its dependencies
jetpack watch <project> # watch and rebuild on changesjetpack test php <project> # PHP tests (e.g. PHPUnit)
jetpack test js <project> # JS tests (e.g. Jest)
jetpack docker phpunit jetpack # Run Jetpack PHPUnit tests within Docker containerSee Automated Testing for full details and setup requirements.
pnpm lint # JS/TS (ESLint)
pnpm lint-style # CSS/SCSS (Stylelint)
composer phpcs:lint <path> # PHP (PHPCS)
jetpack phan <project> # Static analysis (Phan)See Coding Guidelines for standards and conventions.
Every PR touching /projects requires a changelog entry:
jetpack changelog add # interactive
# or non-interactive:
jetpack changelog add <project> -s patch -t fixed -e "Implement Unicord."See Writing a Good Changelog Entry.
jetpack docker up -d # start the container
jetpack docker install # initialize the WordPress install
jetpack docker down # stop the containerSee the Docker guide for details.
projects/ # All monorepo projects
plugins/ # WordPress plugins (jetpack, boost, backup, etc.)
packages/ # Shared PHP packages
js-packages/ # Shared JavaScript/TypeScript packages
github-actions/ # Reusable GitHub Actions
tools/ # Monorepo utilities, scripts, and Docker setup
docs/ # Developer documentation