{"id":13903018,"url":"https://github.com/wp-cli/scaffold-command","last_synced_at":"2026-01-12T14:10:02.918Z","repository":{"id":18986475,"uuid":"85741108","full_name":"wp-cli/scaffold-command","owner":"wp-cli","description":"Generates code for post types, taxonomies, blocks, plugins, child themes, etc.","archived":false,"fork":false,"pushed_at":"2025-05-12T18:30:50.000Z","size":9314,"stargazers_count":167,"open_issues_count":27,"forks_count":86,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-12T19:48:17.745Z","etag":null,"topics":["cli","generator","hacktoberfest","scaffold","template","wordpress","wp-cli","wp-cli-package"],"latest_commit_sha":null,"homepage":"","language":"Gherkin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wp-cli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-03-21T18:51:20.000Z","updated_at":"2025-05-12T18:30:53.000Z","dependencies_parsed_at":"2023-11-16T15:44:29.474Z","dependency_job_id":"b42900b5-f02e-47af-b758-e9f5a229244c","html_url":"https://github.com/wp-cli/scaffold-command","commit_stats":{"total_commits":1073,"total_committers":115,"mean_commits":9.330434782608696,"dds":0.7781919850885368,"last_synced_commit":"036c5152f85861bbd46ec63b36cde9074d786117"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fscaffold-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fscaffold-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fscaffold-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fscaffold-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-cli","download_url":"https://codeload.github.com/wp-cli/scaffold-command/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254169026,"owners_count":22026207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","generator","hacktoberfest","scaffold","template","wordpress","wp-cli","wp-cli-package"],"created_at":"2024-08-06T22:01:33.764Z","updated_at":"2026-01-12T14:10:02.885Z","avatar_url":"https://github.com/wp-cli.png","language":"Gherkin","readme":"wp-cli/scaffold-command\n=======================\n\nGenerates code for post types, taxonomies, blocks, plugins, child themes, etc.\n\n[![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)\n\nQuick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)\n\n## Using\n\nThis package implements the following commands:\n\n### wp scaffold\n\nGenerates code for post types, taxonomies, plugins, child themes, etc.\n\n~~~\nwp scaffold\n~~~\n\n**EXAMPLES**\n\n    # Generate a new plugin with unit tests.\n    $ wp scaffold plugin sample-plugin\n    Success: Created plugin files.\n    Success: Created test files.\n\n    # Generate theme based on _s.\n    $ wp scaffold _s sample-theme --theme_name=\"Sample Theme\" --author=\"John Doe\"\n    Success: Created theme 'Sample Theme'.\n\n    # Generate code for post type registration in given theme.\n    $ wp scaffold post-type movie --label=Movie --theme=simple-life\n    Success: Created '/var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php'.\n\n\n\n### wp scaffold underscores\n\nGenerates starter code for a theme based on _s.\n\n~~~\nwp scaffold underscores \u003cslug\u003e [--activate] [--enable-network] [--theme_name=\u003ctitle\u003e] [--author=\u003cfull-name\u003e] [--author_uri=\u003curi\u003e] [--sassify] [--woocommerce] [--force]\n~~~\n\nSee the [Underscores website](https://underscores.me/) for more details.\n\n**OPTIONS**\n\n\t\u003cslug\u003e\n\t\tThe slug for the new theme, used for prefixing functions.\n\n\t[--activate]\n\t\tActivate the newly downloaded theme.\n\n\t[--enable-network]\n\t\tEnable the newly downloaded theme for the entire network.\n\n\t[--theme_name=\u003ctitle\u003e]\n\t\tWhat to put in the 'Theme Name:' header in 'style.css'.\n\n\t[--author=\u003cfull-name\u003e]\n\t\tWhat to put in the 'Author:' header in 'style.css'.\n\n\t[--author_uri=\u003curi\u003e]\n\t\tWhat to put in the 'Author URI:' header in 'style.css'.\n\n\t[--sassify]\n\t\tInclude stylesheets as SASS.\n\n\t[--woocommerce]\n\t\tInclude WooCommerce boilerplate files.\n\n\t[--force]\n\t\tOverwrite files that already exist.\n\n**EXAMPLES**\n\n    # Generate a theme with name \"Sample Theme\" and author \"John Doe\"\n    $ wp scaffold _s sample-theme --theme_name=\"Sample Theme\" --author=\"John Doe\"\n    Success: Created theme 'Sample Theme'.\n\n\n\n### wp scaffold block\n\nGenerates PHP, JS and CSS code for registering a Gutenberg block for a plugin or theme.\n\n~~~\nwp scaffold block \u003cslug\u003e [--title=\u003ctitle\u003e] [--dashicon=\u003cdashicon\u003e] [--category=\u003ccategory\u003e] [--theme] [--plugin=\u003cplugin\u003e] [--force]\n~~~\n\n**Warning: `wp scaffold block` is deprecated.**\n\nThe official script to generate a block is the [@wordpress/create-block](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/) package.\n\nSee the [Create a Block tutorial](https://developer.wordpress.org/block-editor/getting-started/tutorial/) for a complete walk-through.\n\n**OPTIONS**\n\n\t\u003cslug\u003e\n\t\tThe internal name of the block.\n\n\t[--title=\u003ctitle\u003e]\n\t\tThe display title for your block.\n\n\t[--dashicon=\u003cdashicon\u003e]\n\t\tThe dashicon to make it easier to identify your block.\n\n\t[--category=\u003ccategory\u003e]\n\t\tThe category name to help users browse and discover your block.\n\t\t---\n\t\tdefault: widgets\n\t\toptions:\n\t\t  - common\n\t\t  - embed\n\t\t  - formatting\n\t\t  - layout\n\t\t  - widgets\n\t\t---\n\n\t[--theme]\n\t\tCreate files in the active theme directory. Specify a theme with `--theme=\u003ctheme\u003e` to have the file placed in that theme.\n\n\t[--plugin=\u003cplugin\u003e]\n\t\tCreate files in the given plugin's directory.\n\n\t[--force]\n\t\tOverwrite files that already exist.\n\n\n\n### wp scaffold child-theme\n\nGenerates child theme based on an existing theme.\n\n~~~\nwp scaffold child-theme \u003cslug\u003e --parent_theme=\u003cslug\u003e [--theme_name=\u003ctitle\u003e] [--author=\u003cfull-name\u003e] [--author_uri=\u003curi\u003e] [--theme_uri=\u003curi\u003e] [--activate] [--enable-network] [--force]\n~~~\n\nCreates a child theme folder with `functions.php` and `style.css` files.\n\n**OPTIONS**\n\n\t\u003cslug\u003e\n\t\tThe slug for the new child theme.\n\n\t--parent_theme=\u003cslug\u003e\n\t\tWhat to put in the 'Template:' header in 'style.css'.\n\n\t[--theme_name=\u003ctitle\u003e]\n\t\tWhat to put in the 'Theme Name:' header in 'style.css'.\n\n\t[--author=\u003cfull-name\u003e]\n\t\tWhat to put in the 'Author:' header in 'style.css'.\n\n\t[--author_uri=\u003curi\u003e]\n\t\tWhat to put in the 'Author URI:' header in 'style.css'.\n\n\t[--theme_uri=\u003curi\u003e]\n\t\tWhat to put in the 'Theme URI:' header in 'style.css'.\n\n\t[--activate]\n\t\tActivate the newly created child theme.\n\n\t[--enable-network]\n\t\tEnable the newly created child theme for the entire network.\n\n\t[--force]\n\t\tOverwrite files that already exist.\n\n**EXAMPLES**\n\n    # Generate a 'sample-theme' child theme based on TwentySixteen\n    $ wp scaffold child-theme sample-theme --parent_theme=twentysixteen\n    Success: Created '/var/www/example.com/public_html/wp-content/themes/sample-theme'.\n\n\n\n### wp scaffold plugin\n\nGenerates starter code for a plugin.\n\n~~~\nwp scaffold plugin \u003cslug\u003e [--dir=\u003cdirname\u003e] [--plugin_name=\u003ctitle\u003e] [--plugin_description=\u003cdescription\u003e] [--plugin_author=\u003cauthor\u003e] [--plugin_author_uri=\u003curl\u003e] [--plugin_uri=\u003curl\u003e] [--skip-tests] [--ci=\u003cprovider\u003e] [--activate] [--activate-network] [--force]\n~~~\n\nThe following files are always generated:\n\n* `plugin-slug.php` is the main PHP plugin file.\n* `readme.txt` is the readme file for the plugin.\n* `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`.\n* `Gruntfile.js` is the JS file containing Grunt tasks. Tasks: `i18n` containing `addtextdomain` and `makepot`, `readme` containing `wp_readme_to_markdown`.\n* `.editorconfig` is the configuration file for Editor.\n* `.gitignore` tells which files (or patterns) git should ignore.\n* `.distignore` tells which files and folders should be ignored in distribution.\n\nThe following files are also included unless the `--skip-tests` is used:\n\n* `phpunit.xml.dist` is the configuration file for PHPUnit.\n* `.circleci/config.yml` is the configuration file for CircleCI. Use `--ci=\u003cprovider\u003e` to select a different service.\n* `bin/install-wp-tests.sh` configures the WordPress test suite and a test database.\n* `tests/bootstrap.php` is the file that makes the current plugin active when running the test suite.\n* `tests/test-sample.php` is a sample file containing test cases.\n* `.phpcs.xml.dist` is a collection of PHP_CodeSniffer rules.\n\n**OPTIONS**\n\n\t\u003cslug\u003e\n\t\tThe internal name of the plugin.\n\n\t[--dir=\u003cdirname\u003e]\n\t\tPut the new plugin in some arbitrary directory path. Plugin directory will be path plus supplied slug.\n\n\t[--plugin_name=\u003ctitle\u003e]\n\t\tWhat to put in the 'Plugin Name:' header.\n\n\t[--plugin_description=\u003cdescription\u003e]\n\t\tWhat to put in the 'Description:' header.\n\n\t[--plugin_author=\u003cauthor\u003e]\n\t\tWhat to put in the 'Author:' header.\n\n\t[--plugin_author_uri=\u003curl\u003e]\n\t\tWhat to put in the 'Author URI:' header.\n\n\t[--plugin_uri=\u003curl\u003e]\n\t\tWhat to put in the 'Plugin URI:' header.\n\n\t[--skip-tests]\n\t\tDon't generate files for unit testing.\n\n\t[--ci=\u003cprovider\u003e]\n\t\tChoose a configuration file for a continuous integration provider.\n\t\t---\n\t\tdefault: circle\n\t\toptions:\n\t\t  - circle\n\t\t  - gitlab\n\t\t  - bitbucket\n\t\t  - github\n\t\t---\n\n\t[--activate]\n\t\tActivate the newly generated plugin.\n\n\t[--activate-network]\n\t\tNetwork activate the newly generated plugin.\n\n\t[--force]\n\t\tOverwrite files that already exist.\n\n**EXAMPLES**\n\n    $ wp scaffold plugin sample-plugin\n    Success: Created plugin files.\n    Success: Created test files.\n\n\n\n### wp scaffold plugin-tests\n\nGenerates files needed for running PHPUnit tests in a plugin.\n\n~~~\nwp scaffold plugin-tests [\u003cplugin\u003e] [--dir=\u003cdirname\u003e] [--ci=\u003cprovider\u003e] [--force]\n~~~\n\nThe following files are generated by default:\n\n* `phpunit.xml.dist` is the configuration file for PHPUnit.\n* `.circleci/config.yml` is the configuration file for CircleCI. Use `--ci=\u003cprovider\u003e` to select a different service.\n* `bin/install-wp-tests.sh` configures the WordPress test suite and a test database.\n* `tests/bootstrap.php` is the file that makes the current plugin active when running the test suite.\n* `tests/test-sample.php` is a sample file containing the actual tests.\n* `.phpcs.xml.dist` is a collection of PHP_CodeSniffer rules.\n\nLearn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/).\n\n**ENVIRONMENT**\n\nThe `tests/bootstrap.php` file looks for the WP_TESTS_DIR environment\nvariable.\n\n**OPTIONS**\n\n\t[\u003cplugin\u003e]\n\t\tThe name of the plugin to generate test files for.\n\n\t[--dir=\u003cdirname\u003e]\n\t\tGenerate test files for a non-standard plugin path. If no plugin slug is specified, the directory name is used.\n\n\t[--ci=\u003cprovider\u003e]\n\t\tChoose a configuration file for a continuous integration provider.\n\t\t---\n\t\tdefault: circle\n\t\toptions:\n\t\t  - circle\n\t\t  - gitlab\n\t\t  - bitbucket\n\t\t  - github\n\t\t---\n\n\t[--force]\n\t\tOverwrite files that already exist.\n\n**EXAMPLES**\n\n    # Generate unit test files for plugin 'sample-plugin'.\n    $ wp scaffold plugin-tests sample-plugin\n    Success: Created test files.\n\n\n\n### wp scaffold post-type\n\nGenerates PHP code for registering a custom post type.\n\n~~~\nwp scaffold post-type \u003cslug\u003e [--label=\u003clabel\u003e] [--textdomain=\u003ctextdomain\u003e] [--dashicon=\u003cdashicon\u003e] [--theme] [--plugin=\u003cplugin\u003e] [--raw] [--force]\n~~~\n\n**OPTIONS**\n\n\t\u003cslug\u003e\n\t\tThe internal name of the post type.\n\n\t[--label=\u003clabel\u003e]\n\t\tThe text used to translate the update messages.\n\n\t[--textdomain=\u003ctextdomain\u003e]\n\t\tThe textdomain to use for the labels.\n\n\t[--dashicon=\u003cdashicon\u003e]\n\t\tThe dashicon to use in the menu.\n\n\t[--theme]\n\t\tCreate a file in the active theme directory, instead of sending to\n\t\tSTDOUT. Specify a theme with `--theme=\u003ctheme\u003e` to have the file placed in that theme.\n\n\t[--plugin=\u003cplugin\u003e]\n\t\tCreate a file in the given plugin's directory, instead of sending to STDOUT.\n\n\t[--raw]\n\t\tJust generate the `register_post_type()` call and nothing else.\n\n\t[--force]\n\t\tOverwrite files that already exist.\n\n**EXAMPLES**\n\n    # Generate a 'movie' post type for the 'simple-life' theme\n    $ wp scaffold post-type movie --label=Movie --theme=simple-life\n    Success: Created '/var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php'.\n\n\n\n### wp scaffold taxonomy\n\nGenerates PHP code for registering a custom taxonomy.\n\n~~~\nwp scaffold taxonomy \u003cslug\u003e [--post_types=\u003cpost-types\u003e] [--label=\u003clabel\u003e] [--textdomain=\u003ctextdomain\u003e] [--theme] [--plugin=\u003cplugin\u003e] [--raw] [--force]\n~~~\n\n**OPTIONS**\n\n\t\u003cslug\u003e\n\t\tThe internal name of the taxonomy.\n\n\t[--post_types=\u003cpost-types\u003e]\n\t\tPost types to register for use with the taxonomy.\n\n\t[--label=\u003clabel\u003e]\n\t\tThe text used to translate the update messages.\n\n\t[--textdomain=\u003ctextdomain\u003e]\n\t\tThe textdomain to use for the labels.\n\n\t[--theme]\n\t\tCreate a file in the active theme directory, instead of sending to\n\t\tSTDOUT. Specify a theme with `--theme=\u003ctheme\u003e` to have the file placed in that theme.\n\n\t[--plugin=\u003cplugin\u003e]\n\t\tCreate a file in the given plugin's directory, instead of sending to STDOUT.\n\n\t[--raw]\n\t\tJust generate the `register_taxonomy()` call and nothing else.\n\n\t[--force]\n\t\tOverwrite files that already exist.\n\n**EXAMPLES**\n\n    # Generate PHP code for registering a custom taxonomy and save in a file\n    $ wp scaffold taxonomy venue --post_types=event,presentation \u003e taxonomy.php\n\n\n\n### wp scaffold theme-tests\n\nGenerates files needed for running PHPUnit tests in a theme.\n\n~~~\nwp scaffold theme-tests [\u003ctheme\u003e] [--dir=\u003cdirname\u003e] [--ci=\u003cprovider\u003e] [--force]\n~~~\n\nThe following files are generated by default:\n\n* `phpunit.xml.dist` is the configuration file for PHPUnit.\n* `.circleci/config.yml` is the configuration file for CircleCI. Use `--ci=\u003cprovider\u003e` to select a different service.\n* `bin/install-wp-tests.sh` configures the WordPress test suite and a test database.\n* `tests/bootstrap.php` is the file that makes the current theme active when running the test suite.\n* `tests/test-sample.php` is a sample file containing the actual tests.\n* `.phpcs.xml.dist` is a collection of PHP_CodeSniffer rules.\n\nLearn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/).\n\n**ENVIRONMENT**\n\nThe `tests/bootstrap.php` file looks for the WP_TESTS_DIR environment\nvariable.\n\n**OPTIONS**\n\n\t[\u003ctheme\u003e]\n\t\tThe name of the theme to generate test files for.\n\n\t[--dir=\u003cdirname\u003e]\n\t\tGenerate test files for a non-standard theme path. If no theme slug is specified, the directory name is used.\n\n\t[--ci=\u003cprovider\u003e]\n\t\tChoose a configuration file for a continuous integration provider.\n\t\t---\n\t\tdefault: circle\n\t\toptions:\n\t\t  - circle\n\t\t  - gitlab\n\t\t  - bitbucket\n\t\t  - github\n\t\t---\n\n\t[--force]\n\t\tOverwrite files that already exist.\n\n**EXAMPLES**\n\n    # Generate unit test files for theme 'twentysixteenchild'.\n    $ wp scaffold theme-tests twentysixteenchild\n    Success: Created test files.\n\n## Installing\n\nThis package is included with WP-CLI itself, no additional installation necessary.\n\nTo install the latest version of this package over what's included in WP-CLI, run:\n\n    wp package install git@github.com:wp-cli/scaffold-command.git\n\n## Contributing\n\nWe appreciate you taking the initiative to contribute to this project.\n\nContributing 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.\n\nFor 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.\n\n### Reporting a bug\n\nThink you’ve found a bug? We’d love for you to help us get it fixed.\n\nBefore 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.\n\nOnce 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/).\n\n### Creating a pull request\n\nWant 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.\n\nOnce 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.\n\n## Support\n\nGitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support\n\n\n*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.*\n","funding_links":[],"categories":["cli"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Fscaffold-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-cli%2Fscaffold-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Fscaffold-command/lists"}