PHPackages                             wp-cli/scaffold-command - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. wp-cli/scaffold-command

ActiveWp-cli-package[CLI &amp; Console](/categories/cli)

wp-cli/scaffold-command
=======================

Generates code for post types, taxonomies, blocks, plugins, child themes, etc.

v2.5.4(2mo ago)1717.7M↑24.2%86[3 issues](https://github.com/wp-cli/scaffold-command/issues)[1 PRs](https://github.com/wp-cli/scaffold-command/pulls)12MITGherkinCI passing

Since Apr 12Pushed 1mo ago8 watchersCompare

[ Source](https://github.com/wp-cli/scaffold-command)[ Packagist](https://packagist.org/packages/wp-cli/scaffold-command)[ Docs](https://github.com/wp-cli/scaffold-command)[ RSS](/packages/wp-cli-scaffold-command/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (60)Used By (12)

wp-cli/scaffold-command
=======================

[](#wp-cliscaffold-command)

Generates code for post types, taxonomies, blocks, plugins, child themes, etc.

[![Testing](https://github.com/wp-cli/scaffold-command/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/scaffold-command/actions/workflows/testing.yml) [![Code Coverage](https://camo.githubusercontent.com/fe7204332871252d46db53f319dbbbc34e4f6f119770d01cfb43a8238d82f7c1/68747470733a2f2f636f6465636f762e696f2f67682f77702d636c692f73636166666f6c642d636f6d6d616e642f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/wp-cli/scaffold-command/tree/main)

Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)

Using
-----

[](#using)

This package implements the following commands:

### wp scaffold

[](#wp-scaffold)

Generates code for post types, taxonomies, plugins, child themes, etc.

```
wp scaffold

```

**EXAMPLES**

```
# Generate a new plugin with unit tests.
$ wp scaffold plugin sample-plugin
Success: Created plugin files.
Success: Created test files.

# Generate theme based on _s.
$ wp scaffold _s sample-theme --theme_name="Sample Theme" --author="John Doe"
Success: Created theme 'Sample Theme'.

# Generate code for post type registration in given theme.
$ wp scaffold post-type movie --label=Movie --theme=simple-life
Success: Created '/var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php'.

```

### wp scaffold underscores

[](#wp-scaffold-underscores)

Generates starter code for a theme based on \_s.

```
wp scaffold underscores  [--activate] [--enable-network] [--theme_name=] [--author=] [--author_uri=] [--sassify] [--woocommerce] [--force]

```

**Alias:** `_s`

See the [Underscores website](https://underscores.me/) for more details.

**OPTIONS**

```

	The slug for the new theme, used for prefixing functions.

[--activate]
	Activate the newly downloaded theme.

[--enable-network]
	Enable the newly downloaded theme for the entire network.

[--theme_name=]
	What to put in the 'Theme Name:' header in 'style.css'.

[--author=]
	What to put in the 'Author:' header in 'style.css'.

[--author_uri=]
	What to put in the 'Author URI:' header in 'style.css'.

[--sassify]
	Include stylesheets as SASS.

[--woocommerce]
	Include WooCommerce boilerplate files.

[--force]
	Overwrite files that already exist.

```

**EXAMPLES**

```
# Generate a theme with name "Sample Theme" and author "John Doe"
$ wp scaffold _s sample-theme --theme_name="Sample Theme" --author="John Doe"
Success: Created theme 'Sample Theme'.

```

### wp scaffold block

[](#wp-scaffold-block)

Generates PHP, JS and CSS code for registering a Gutenberg block for a plugin or theme.

```
wp scaffold block  [--title=] [--dashicon=] [--category=] [--theme] [--plugin=] [--force]

```

**Warning: `wp scaffold block` is deprecated.**

The official script to generate a block is the [@wordpress/create-block](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/) package.

See the [Create a Block tutorial](https://developer.wordpress.org/block-editor/getting-started/tutorial/) for a complete walk-through.

**OPTIONS**

```

	The internal name of the block.

[--title=]
	The display title for your block.

[--dashicon=]
	The dashicon to make it easier to identify your block.

[--category=]
	The category name to help users browse and discover your block.
	---
	default: widgets
	options:
	  - common
	  - embed
	  - formatting
	  - layout
	  - widgets
	---

[--theme]
	Create files in the active theme directory. Specify a theme with `--theme=` to have the file placed in that theme.

[--plugin=]
	Create files in the given plugin's directory.

[--force]
	Overwrite files that already exist.

```

### wp scaffold child-theme

[](#wp-scaffold-child-theme)

Generates child theme based on an existing theme.

```
wp scaffold child-theme  --parent_theme= [--theme_name=] [--author=] [--author_uri=] [--theme_uri=] [--activate] [--enable-network] [--force]

```

Creates a child theme folder with `functions.php` and `style.css` files.

**OPTIONS**

```

	The slug for the new child theme.

--parent_theme=
	What to put in the 'Template:' header in 'style.css'.

[--theme_name=]
	What to put in the 'Theme Name:' header in 'style.css'.

[--author=]
	What to put in the 'Author:' header in 'style.css'.

[--author_uri=]
	What to put in the 'Author URI:' header in 'style.css'.

[--theme_uri=]
	What to put in the 'Theme URI:' header in 'style.css'.

[--activate]
	Activate the newly created child theme.

[--enable-network]
	Enable the newly created child theme for the entire network.

[--force]
	Overwrite files that already exist.

```

**EXAMPLES**

```
# Generate a 'sample-theme' child theme based on TwentySixteen
$ wp scaffold child-theme sample-theme --parent_theme=twentysixteen
Success: Created '/var/www/example.com/public_html/wp-content/themes/sample-theme'.

```

### wp scaffold plugin

[](#wp-scaffold-plugin)

Generates starter code for a plugin.

```
wp scaffold plugin  [--dir=] [--plugin_name=] [--plugin_description=] [--plugin_author=] [--plugin_author_uri=] [--plugin_uri=] [--skip-tests] [--ci=] [--activate] [--activate-network] [--force]

```

The following files are always generated:

- `plugin-slug.php` is the main PHP plugin file.
- `readme.txt` is the readme file for the plugin.
- `package.json` needed by NPM holds various metadata relevant to the project. Packages: `grunt`, `grunt-wp-i18n` and `grunt-wp-readme-to-markdown`. Scripts: `start`, `readme`, `i18n`.
- `Gruntfile.js` is the JS file containing Grunt tasks. Tasks: `i18n` containing `addtextdomain` and `makepot`, `readme` containing `wp_readme_to_markdown`.
- `.editorconfig` is the configuration file for Editor.
- `.gitignore` tells which files (or patterns) git should ignore.
- `.distignore` tells which files and folders should be ignored in distribution.

The following files are also included unless the `--skip-tests` is used:

- `phpunit.xml.dist` is the configuration file for PHPUnit.
- `.circleci/config.yml` is the configuration file for CircleCI. Use `--ci=` to select a different service.
- `bin/install-wp-tests.sh` configures the WordPress test suite and a test database.
- `tests/bootstrap.php` is the file that makes the current plugin active when running the test suite.
- `tests/test-sample.php` is a sample file containing test cases.
- `.phpcs.xml.dist` is a collection of PHP\_CodeSniffer rules.

**OPTIONS**

```

	The internal name of the plugin.

[--dir=]
	Put the new plugin in some arbitrary directory path. Plugin directory will be path plus supplied slug.

[--plugin_name=]
	What to put in the 'Plugin Name:' header.

[--plugin_description=]
	What to put in the 'Description:' header.

[--plugin_author=]
	What to put in the 'Author:' header.

[--plugin_author_uri=]
	What to put in the 'Author URI:' header.

[--plugin_uri=]
	What to put in the 'Plugin URI:' header.

[--skip-tests]
	Don't generate files for unit testing.

[--ci=]
	Choose a configuration file for a continuous integration provider.
	---
	default: circle
	options:
	  - circle
	  - gitlab
	  - bitbucket
	  - github
	---

[--activate]
	Activate the newly generated plugin.

[--activate-network]
	Network activate the newly generated plugin.

[--force]
	Overwrite files that already exist.

```

**EXAMPLES**

```
$ wp scaffold plugin sample-plugin
Success: Created plugin files.
Success: Created test files.

```

### wp scaffold plugin-tests

[](#wp-scaffold-plugin-tests)

Generates files needed for running PHPUnit tests in a plugin.

```
wp scaffold plugin-tests [] [--dir=] [--ci=] [--force]

```

The following files are generated by default:

- `phpunit.xml.dist` is the configuration file for PHPUnit.
- `.circleci/config.yml` is the configuration file for CircleCI. Use `--ci=` to select a different service.
- `bin/install-wp-tests.sh` configures the WordPress test suite and a test database.
- `tests/bootstrap.php` is the file that makes the current plugin active when running the test suite.
- `tests/test-sample.php` is a sample file containing the actual tests.
- `.phpcs.xml.dist` is a collection of PHP\_CodeSniffer rules.

Learn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/).

**ENVIRONMENT**

The `tests/bootstrap.php` file looks for the WP\_TESTS\_DIR environment variable.

**OPTIONS**

```
[]
	The name of the plugin to generate test files for.

[--dir=]
	Generate test files for a non-standard plugin path. If no plugin slug is specified, the directory name is used.

[--ci=]
	Choose a configuration file for a continuous integration provider.
	---
	default: circle
	options:
	  - circle
	  - gitlab
	  - bitbucket
	  - github
	---

[--force]
	Overwrite files that already exist.

```

**EXAMPLES**

```
# Generate unit test files for plugin 'sample-plugin'.
$ wp scaffold plugin-tests sample-plugin
Success: Created test files.

```

### wp scaffold post-type

[](#wp-scaffold-post-type)

Generates PHP code for registering a custom post type.

```
wp scaffold post-type  [--label=] [--textdomain=] [--dashicon=] [--theme] [--plugin=] [--raw] [--force]

```

**Alias:** `cpt`

**OPTIONS**

```

	The internal name of the post type.

[--label=]
	The text used to translate the update messages.

[--textdomain=]
	The textdomain to use for the labels.

[--dashicon=]
	The dashicon to use in the menu.

[--theme]
	Create a file in the active theme directory, instead of sending to
	STDOUT. Specify a theme with `--theme=` to have the file placed in that theme.

[--plugin=]
	Create a file in the given plugin's directory, instead of sending to STDOUT.

[--raw]
	Just generate the `register_post_type()` call and nothing else.

[--force]
	Overwrite files that already exist.

```

**EXAMPLES**

```
# Generate a 'movie' post type for the 'simple-life' theme
$ wp scaffold post-type movie --label=Movie --theme=simple-life
Success: Created '/var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php'.

```

### wp scaffold taxonomy

[](#wp-scaffold-taxonomy)

Generates PHP code for registering a custom taxonomy.

```
wp scaffold taxonomy  [--post_types=] [--label=] [--textdomain=] [--theme] [--plugin=] [--raw] [--force]

```

**Alias:** `tax`

**OPTIONS**

```

	The internal name of the taxonomy.

[--post_types=]
	Post types to register for use with the taxonomy.

[--label=]
	The text used to translate the update messages.

[--textdomain=]
	The textdomain to use for the labels.

[--theme]
	Create a file in the active theme directory, instead of sending to
	STDOUT. Specify a theme with `--theme=` to have the file placed in that theme.

[--plugin=]
	Create a file in the given plugin's directory, instead of sending to STDOUT.

[--raw]
	Just generate the `register_taxonomy()` call and nothing else.

[--force]
	Overwrite files that already exist.

```

**EXAMPLES**

```
# Generate PHP code for registering a custom taxonomy and save in a file
$ wp scaffold taxonomy venue --post_types=event,presentation > taxonomy.php

```

### wp scaffold theme-tests

[](#wp-scaffold-theme-tests)

Generates files needed for running PHPUnit tests in a theme.

```
wp scaffold theme-tests [] [--dir=] [--ci=] [--force]

```

The following files are generated by default:

- `phpunit.xml.dist` is the configuration file for PHPUnit.
- `.circleci/config.yml` is the configuration file for CircleCI. Use `--ci=` to select a different service.
- `bin/install-wp-tests.sh` configures the WordPress test suite and a test database.
- `tests/bootstrap.php` is the file that makes the current theme active when running the test suite.
- `tests/test-sample.php` is a sample file containing the actual tests.
- `.phpcs.xml.dist` is a collection of PHP\_CodeSniffer rules.

Learn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/).

**ENVIRONMENT**

The `tests/bootstrap.php` file looks for the WP\_TESTS\_DIR environment variable.

**OPTIONS**

```
[]
	The name of the theme to generate test files for.

[--dir=]
	Generate test files for a non-standard theme path. If no theme slug is specified, the directory name is used.

[--ci=]
	Choose a configuration file for a continuous integration provider.
	---
	default: circle
	options:
	  - circle
	  - gitlab
	  - bitbucket
	  - github
	---

[--force]
	Overwrite files that already exist.

```

**EXAMPLES**

```
# Generate unit test files for theme 'twentysixteenchild'.
$ wp scaffold theme-tests twentysixteenchild
Success: Created test files.

```

Installing
----------

[](#installing)

This package is included with WP-CLI itself, no additional installation necessary.

To install the latest version of this package over what's included in WP-CLI, run:

```
wp package install git@github.com:wp-cli/scaffold-command.git

```

Contributing
------------

[](#contributing)

We appreciate you taking the initiative to contribute to this project.

Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

For a more thorough introduction, [check out WP-CLI's guide to contributing](https://make.wordpress.org/cli/handbook/contributing/). This package follows those policy and guidelines.

### Reporting a bug

[](#reporting-a-bug)

Think you’ve found a bug? We’d love for you to help us get it fixed.

Before you create a new issue, you should [search existing issues](https://github.com/wp-cli/scaffold-command/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.

Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/wp-cli/scaffold-command/issues/new). Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, [review our bug report documentation](https://make.wordpress.org/cli/handbook/bug-reports/).

### Creating a pull request

[](#creating-a-pull-request)

Want to contribute a new feature? Please first [open a new issue](https://github.com/wp-cli/scaffold-command/issues/new) to discuss whether the feature is a good fit for the project.

Once you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See "[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)" for details specific to working on this package locally.

### License

[](#license)

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

Support
-------

[](#support)

GitHub issues aren't for general support questions, but there are other venues you can try:

*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*

###  Health Score

71

—

ExcellentBetter than 100% of packages

Maintenance89

Actively maintained with recent releases

Popularity64

Solid adoption and visibility

Community41

Growing community involvement

Maturity77

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~67 days

Recently: every ~84 days

Total

49

Last Release

63d ago

Major Versions

v1.2.0 → v2.0.02018-08-05

PHP version history (2 changes)v2.0.7PHP ^5.4 || ^7.0

v2.0.10PHP ^5.6 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b5740d002b5556abcceed36e016c8f8ba6f533eefef6107b3c60a830704993b?d=identicon)[danielbachhuber](/maintainers/danielbachhuber)

![](https://www.gravatar.com/avatar/6dde7f578e5530884238e7173f768ae3a890b6d66eb99262a82f2c494a1b67d4?d=identicon)[schlessera](/maintainers/schlessera)

---

Top Contributors

[![danielbachhuber](https://avatars.githubusercontent.com/u/36432?v=4)](https://github.com/danielbachhuber "danielbachhuber (785 commits)")[![schlessera](https://avatars.githubusercontent.com/u/83631?v=4)](https://github.com/schlessera "schlessera (259 commits)")[![scribu](https://avatars.githubusercontent.com/u/225715?v=4)](https://github.com/scribu "scribu (221 commits)")[![swissspidy](https://avatars.githubusercontent.com/u/841956?v=4)](https://github.com/swissspidy "swissspidy (89 commits)")[![miya0001](https://avatars.githubusercontent.com/u/309946?v=4)](https://github.com/miya0001 "miya0001 (64 commits)")[![jmslbam](https://avatars.githubusercontent.com/u/145887?v=4)](https://github.com/jmslbam "jmslbam (50 commits)")[![gitlost](https://avatars.githubusercontent.com/u/481982?v=4)](https://github.com/gitlost "gitlost (37 commits)")[![ernilambar](https://avatars.githubusercontent.com/u/2098823?v=4)](https://github.com/ernilambar "ernilambar (33 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (23 commits)")[![tfirdaus](https://avatars.githubusercontent.com/u/2067467?v=4)](https://github.com/tfirdaus "tfirdaus (21 commits)")[![acusti](https://avatars.githubusercontent.com/u/517889?v=4)](https://github.com/acusti "acusti (18 commits)")[![wojsmol](https://avatars.githubusercontent.com/u/4176111?v=4)](https://github.com/wojsmol "wojsmol (15 commits)")[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (14 commits)")[![sebastiaandegeus](https://avatars.githubusercontent.com/u/1560127?v=4)](https://github.com/sebastiaandegeus "sebastiaandegeus (14 commits)")[![thrijith](https://avatars.githubusercontent.com/u/13589980?v=4)](https://github.com/thrijith "thrijith (13 commits)")[![tedsecretsource](https://avatars.githubusercontent.com/u/28703641?v=4)](https://github.com/tedsecretsource "tedsecretsource (12 commits)")[![wesm87](https://avatars.githubusercontent.com/u/1192513?v=4)](https://github.com/wesm87 "wesm87 (10 commits)")[![gziolo](https://avatars.githubusercontent.com/u/699132?v=4)](https://github.com/gziolo "gziolo (10 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (9 commits)")[![eugeneware](https://avatars.githubusercontent.com/u/38154?v=4)](https://github.com/eugeneware "eugeneware (8 commits)")

---

Tags

cligeneratorhacktoberfestscaffoldtemplatewordpresswp-cliwp-cli-package

### Embed Badge

![Health badge](/badges/wp-cli-scaffold-command/health.svg)

```
[![Health](https://phpackages.com/badges/wp-cli-scaffold-command/health.svg)](https://phpackages.com/packages/wp-cli-scaffold-command)
```

###  Alternatives

[wp-cli/entity-command

Manage WordPress comments, menus, options, posts, sites, terms, and users.

1048.8M55](/packages/wp-cli-entity-command)[wp-cli/i18n-command

Provides internationalization tools for WordPress projects.

11610.4M52](/packages/wp-cli-i18n-command)[wp-cli/extension-command

Manages plugins and themes, including installs, activations, and updates.

919.0M53](/packages/wp-cli-extension-command)[wp-cli/db-command

Performs basic database operations using credentials stored in wp-config.php.

768.0M30](/packages/wp-cli-db-command)[wp-cli/server-command

Launches PHP's built-in web server for a specific WordPress installation.

687.2M5](/packages/wp-cli-server-command)[wp-cli/profile-command

Quickly identify what's slow with WordPress.

294332.2k2](/packages/wp-cli-profile-command)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
