PHPackages                             akirk/create-wp-app - 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. [Framework](/categories/framework)
4. /
5. akirk/create-wp-app

ActiveWordpress-plugin[Framework](/categories/framework)

akirk/create-wp-app
===================

Scaffold a WordPress plugin powered by WpApp

v1.4.2(2w ago)11.7k[1 PRs](https://github.com/akirk/create-wp-app/pulls)GPL-2.0-or-laterPHPPHP &gt;=7.4

Since Jan 30Pushed 2w agoCompare

[ Source](https://github.com/akirk/create-wp-app)[ Packagist](https://packagist.org/packages/akirk/create-wp-app)[ RSS](/packages/akirk-create-wp-app/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (4)Versions (13)Used By (0)

create-wp-app
=============

[](#create-wp-app)

Scaffold a WordPress plugin powered by [WpApp](https://github.com/akirk/wp-app).

Usage
-----

[](#usage)

```
composer create-project akirk/create-wp-app my-plugin
```

This prompts you for:

- **Plugin name** — Display name for your plugin
- **Namespace** — PHP namespace for your classes
- **Author** — Plugin author (optional)
- **URL path** — Where your app lives (e.g., `/my-plugin/`)
- **Setup type** — Full by default, or Minimal for a small direct `WpApp` setup

The default generated app uses the structured `BaseApp` scaffold:

```
my-plugin/
├── my-plugin.php      # Main plugin file
├── src/
│   └── App.php        # BaseApp subclass with routes, menu, and lifecycle hooks
├── templates/
│   └── index.php
├── composer.json
└── .gitignore

```

Screenshot
----------

[](#screenshot)

[![create-wp-app](https://private-user-images.githubusercontent.com/203408/542702942-f0180015-96e9-4ae1-af64-1cec0bae9de1.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODI4MDk5NjgsIm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2MDYzMFQwODU0MjhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hOWYwMzM0MGZlYjk0NTcxMzkyZDMyZmIxY2JiY2MwMWNlYjFiYzM3MGIxNzdiYTMzODQwMDQzMjZiZWM3NTRmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.s-INEoDGol9usuoCpgJDQBEzCp1bxjtXUiD3BMWSc_Y)Setup Types
-----------

[](#setup-types)

### Full

[](#full)

The default setup for generated apps:

```
my-plugin/
├── my-plugin.php      # Main plugin file
├── src/
│   └── App.php        # BaseApp subclass with routes, menu, and lifecycle hooks
├── templates/
│   └── index.php
├── composer.json
└── .gitignore

```

### Minimal

[](#minimal)

A smaller direct `WpApp` setup:

```
my-plugin/
├── my-plugin.php      # Main plugin file with WpApp initialization
├── templates/
│   └── index.php      # Your app's home page
├── composer.json
└── .gitignore

```

Non-Interactive Mode
--------------------

[](#non-interactive-mode)

For CI/CD or scripting, use environment variables:

```
WP_APP_PLUGIN_NAME="My App" \
WP_APP_NAMESPACE="MyApp" \
WP_APP_AUTHOR="Your Name" \
WP_APP_URL_PATH="my-app" \
WP_APP_SETUP_TYPE="full" \
WP_APP_OVERWRITE="1" \
WP_APP_DEPENDENCY_MODE="composer" \
WP_APP_AUTOLOAD_MODE="composer" \
composer create-project --no-interaction akirk/create-wp-app my-plugin
```

The command above creates a `my-plugin/` directory, configures the plugin from the environment variables, and removes the setup script:

```
my-plugin/
├── my-plugin.php       # Main plugin file for "My App"
├── src/
│   └── App.php         # App lifecycle extension points
├── templates/
│   └── index.php       # App home page shown at /my-app/
├── vendor/
│   └── autoload.php    # Composer-generated autoloader
├── composer.json       # Generated package metadata for my-plugin/my-plugin
├── README.md
└── .gitignore

```

`WP_APP_SETUP_TYPE` defaults to `full`. Use `minimal` only when you want the small direct `WpApp` setup.

Programmatic Usage
------------------

[](#programmatic-usage)

Use `Akirk\CreateWpApp\Scaffolder` when another tool, CLI, or WordPress ability needs to create the app without reimplementing file generation. If `target_dir` does not exist, the scaffolder creates it and seeds the base plugin files before applying the config. Set `overwrite` to `false` to reject a non-empty target directory before any files are generated.

### Normal Composer Project

[](#normal-composer-project)

This mode writes the generated app's `composer.json` and runs `composer dump-autoload`:

```
