npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

wp-lemon

v1.2.1

Published

A CLI tool to help you with common tasks when setting up a new WordPress project using the wp-lemon-stack

Downloads

676

Readme

wp-lemon CLI

A powerful command-line tool designed to streamline the setup and management of WordPress sites built with the wp-lemon WordPress theme by Studio Lemon. This CLI helps you scaffold new sites, create and manage blocks, and simplify your WordPress development workflow.

Developed by Studio Lemon for developers working with the wp-lemon stack.


📋 Table of Contents


✨ Features

  • 🚀 Quick Site Setup - Scaffold a new wp-lemon WordPress site in minutes
  • 🧩 Block Management - Create, reuse, and update WordPress blocks effortlessly
  • 🔄 Site Ejection - Convert a wp-lemon site to a standard WordPress installation
  • 🎨 Interactive CLI - User-friendly prompts guide you through setup processes

Use with npx:

npx wp-lemon <command>

Install from source:

git clone [email protected]:Studio-Lemon/wp-lemon-create.git
cd wp-lemon-create
npm install
npm link

🔧 Requirements

  • Node.js v16.0.0 or higher
  • npm (comes with Node.js)
  • PHP (8.2 or higher)
  • Composer (for PHP dependency management)
  • wp CLI (for WordPress command line management)
  • wp dotenv package (for managing environment variables)

Check your Node.js version:

node --version

📚 Commands

Site Commands

wp-lemon site create

Creates a new wp-lemon WordPress site with scaffolded theme structure and dependencies.

Usage:

npx wp-lemon site create

What it does:

  • Initializes a new WordPress project
  • Sets up the wp-lemon theme structure
  • Installs required PHP dependencies via Composer
  • Configures block directories
  • Creates initial configuration files

Interactive prompts:

  • Project name
  • Project slug (auto-generated from name)
  • Theme configuration options

Example:

$ npx wp-lemon site create
# Follow the prompts to configure your new site

wp-lemon site update

Updates an existing wp-lemon site with the latest theme files and dependencies.

Usage:

npx wp-lemon site update

Note: This feature is currently in development. Check back soon for updates!


wp-lemon site eject

Converts a wp-lemon managed site to a standard WordPress installation, removing wp-lemon specific tooling and configurations.

Usage:

npx wp-lemon site eject

What it does:

  • Removes wp-lemon CLI dependencies
  • Converts wp-lemon specific configurations to standard WordPress configs
  • Maintains all your content and customizations
  • Generates a backup of your configuration

⚠️ Warning: This action is irreversible. Make sure you have a backup before ejecting!


Block Commands

wp-lemon block create

Scaffolds a new WordPress block in the current site with all necessary files and configuration.

Usage:

npx wp-lemon block create

What it does:

  • Creates a new block directory with proper structure
  • Generates PHP block files (PHP registration and rendering)
  • Creates JavaScript/TypeScript component files
  • Sets up block metadata (block.json)
  • Configures block styles and editor styles
  • Registers the block with WordPress

Interactive prompts:

  • Block name (e.g., "Hero Section")
  • Block slug (auto-generated, can be customized)
  • Block category (common, formatting, layout, widgets, embed)
  • Additional block options (supports, alignments, etc.)

Generated files:

blocks/
├── block-slug/
│   ├── block.json
│   ├── block-slug.php
│   ├── block-slug.twig
│   ├── acf-block-slug.css
│   └── index.json

Example:

$ npx wp-lemon block create
# Follow the prompts to configure your new block

wp-lemon block reuse

Reuses a block from a different wp-lemon site by copying it into the current site.

Usage:

npx  wp-lemon block reuse

What it does:

  • Allows you to copy/paste a path to a block from another wp-lemon site
  • Copies block files to your current site
  • Registers the block with your site configuration
  • Able to rename the block if needed

Interactive prompts:

  • Input path to source block
  • Confirm block configuration for new site

Example:

$ npx wp-lemon block reuse
# Select a block from another project to copy into this one

Blocks Commands

wp-lemon blocks update

Updates all blocks in your site to the latest versions and standards.

Usage:

npx wp-lemon blocks update

What it does:

  • Scans all blocks in your site
  • Updates block metadata and registration
  • Migrates blocks to latest WordPress block standards
  • Updates block styles and scripts
  • Validates block configurations

Note: This feature is currently in development. Check back soon for updates!


Help & Version

wp-lemon help

Displays comprehensive help information about all available commands.

Usage:

npx wp-lemon help

or

npx wp-lemon --help
npx wp-lemon -h

wp-lemon --version

Displays the current version of the wp-lemon CLI tool.

Usage:

npx wp-lemon --version
npx wp-lemon -v

🤝 Contributing

We welcome contributions from the wp-lemon community! Here's how you can help improve wp-lemon-create:

Getting Started

  1. Fork the repository on GitHub

    git clone [email protected]:YOUR_USERNAME/wp-lemon-create.git
    cd wp-lemon-create
  2. Install dependencies

    npm install
  3. Create a feature branch

    git checkout -b feature/your-feature-name

Development Workflow

Running Tests

npm test

This runs the CLI test suite and validates all commands.

Testing Commands Locally

Link the package locally for testing:

npm link

Then test commands as if they were globally installed:

npx wp-lemon site create
npx wp-lemon block create

To unlink:

npm unlink

Code Structure

wp-lemon-create/
├── index.js                    # Main CLI entry point
├── lib/
│   ├── banner.js              # CLI banner display
│   ├── actions/
│   │   ├── help.js            # Help command handler
│   │   ├── site/
│   │   │   ├── site-create.js # Site creation logic
│   │   │   ├── site-eject.js  # Site ejection logic
│   │   │   └── create-vanilla.js # Vanilla site setup
│   │   └── block/
│   │       ├── block-create.js # Block scaffolding
│   │       └── block-reuse.js  # Block reuse logic
│   └── helpers/
│       └── test-block-version.js # Version utilities
├── test/
│   └── cli.test.js            # Test suite
└── package.json               # Dependencies & scripts

Common Tasks

Adding a New Command

  1. Create action file in appropriate directory:

    // lib/actions/your-feature/your-command.js
    const yourCommand = () => {
      // Implementation
    };
       
    module.exports = { yourCommand };
  2. Import in index.js:

    const { yourCommand } = require('./lib/actions/your-feature/your-command');
  3. Register command:

    const yourCommand = program.command('your-feature');
    yourCommand
      .command('your-command')
      .description('Description of your command')
      .action(() => {
        showBanner('Your Command');
        yourCommand();
      });

Adding a Helper Function

  1. Create in lib/helpers/:

    // lib/helpers/your-helper.js
    const yourHelper = (param) => {
      // Implementation
    };
       
    module.exports = { yourHelper };
  2. Import where needed and add tests


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🆘 Support

Getting Help


🔗 Related Resources


Made with ❤️ by Studio Lemon