Deprecated — This package is no longer maintained. All functionality has been absorbed into
imagewize/pt-cliv2.0.0.composer global remove imagewize/elayne-cli composer global require imagewize/pt-cliCommands are identical —
pattern:create,layout:create,style:create,pattern:list— now alongsidept-cli check.
CLI scaffolding tool for Elayne, a WordPress block theme. Generates WordPress block pattern PHP files, layout patterns, and theme style variation JSON files interactively from pre-built templates.
- PHP >= 8.0
- Composer
composer require imagewize/elayne-cliOr clone and install locally:
git clone https://github.com/imagewize/elayne-cli.git
cd elayne-cli
composer installAdd these scripts to your theme's composer.json to avoid typing vendor/bin/elayne every time:
"scripts": {
"pattern:list": "@php ./vendor/bin/elayne pattern:list",
"pattern:create": "@php ./vendor/bin/elayne pattern:create",
"layout:create": "@php ./vendor/bin/elayne layout:create",
"style:create": "@php ./vendor/bin/elayne style:create"
}Then run composer pattern:list, composer pattern:create, composer layout:create, or composer style:create.
To use the bare elayne command from any project directory, add ./vendor/bin to your shell PATH:
# ~/.zshrc or ~/.bashrc
export PATH="./vendor/bin:$PATH"After reloading your shell (source ~/.zshrc) you can run elayne pattern:list, elayne pattern:create, elayne layout:create, and elayne style:create directly.
vendor/bin/elayne pattern:listvendor/bin/elayne pattern:createYou will be prompted for pattern title, slug, category, template, keywords, and output directory. Use --with-style to also generate a companion CSS file, and --shell-only for an editor-first workflow (PHP header + paste marker only).
vendor/bin/elayne layout:createYou will be prompted for pattern title, slug, layout type, category, keywords, and output directory. Use --shell-only for an editor-first workflow.
Example non-interactive usage:
vendor/bin/elayne layout:create \
--title="Home Hero" \
--slug="elayne/home-hero" \
--layout=hero-image-right \
--category=elayne/hero \
--keywords="hero, home" \
--output-dir=./patternsvendor/bin/elayne style:createYou will be prompted for style name, vertical preset (or custom colors), and output directory.
Example non-interactive usage:
vendor/bin/elayne style:create --name="Ocean Legal" --vertical=legalvendor/bin/elayne pattern:create \
--title="My Pattern" \
--slug="elayne/my-pattern" \
--template=hero-cover \
--category=elayne/hero \
--keywords="hero, banner" \
--output-dir=./patterns \
--with-style \
--style-dir=./assets/styles/block-stylesWith --shell-only (editor-first workflow):
vendor/bin/elayne pattern:create \
--title="My Pattern" \
--slug="elayne/my-pattern" \
--template=hero-cover \
--category=elayne/hero \
--shell-onlyThe --slug option accepts the full elayne/<slug> form or just the bare slug — the elayne/ prefix is stripped automatically.
Detailed reference material is available in the docs/ directory:
- 📄 Templates — Available pattern templates and descriptions
- 📄 Layouts — Structural layout patterns for the
layout:createcommand - 📄 Snippets — Reusable block markup fragments
- 📄 Categories — Available pattern categories
- 📄 CSS Stubs — CSS file generation and custom stubs
- 📄 Style Presets — Theme style variation color palettes
The command writes a .php file to the output directory. Example output for a blank pattern:
<?php
/**
* Title: My Pattern
* Slug: elayne/my-pattern
* Description: My Pattern
* Categories: elayne/hero
* Keywords: hero, banner
* Viewport Width: 1200
* Block Types: core/group
*/
?>After generation, add your block markup inside the file and flush the WordPress pattern cache.
GPL-2.0-or-later — see LICENSE.md for details.