PHPackages                             motivast/wp-cli-seed-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. [Database &amp; ORM](/categories/database)
4. /
5. motivast/wp-cli-seed-command

ActiveWp-cli-package[Database &amp; ORM](/categories/database)

motivast/wp-cli-seed-command
============================

WP CLI Seed Command is an extension for WP-CLI to seed database with sample data

1.0.1(5y ago)1811.5k↓33.3%MITPHP

Since Apr 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/motivast/wp-cli-seed-command)[ Packagist](https://packagist.org/packages/motivast/wp-cli-seed-command)[ Docs](https://github.com/motivast/wp-cli-seed-command)[ RSS](/packages/motivast-wp-cli-seed-command/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (13)Versions (4)Used By (0)

WP CLI Seed Command
===================

[](#wp-cli-seed-command)

[![CircleCI](https://camo.githubusercontent.com/2862017dfbe4ab5068770cd580af03b6d5afc25677e985e1e2de5b22a041fc47/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6f7469766173742f77702d636c692d736565642d636f6d6d616e642e7376673f7374796c653d737667)](https://circleci.com/gh/motivast/wp-cli-seed-command)

WP CLI Seed Command is an extension for WP-CLI to seed database with sample data.

Why?
----

[](#why)

Working with advanced WordPress project require to provide test data for other developers or testing scripts. Working with MySQL dumps or exported data has a couple of disadvantages. Data from files like import file or MySQL dump are static you can not quickly scale from 10 random to 100 random posts, also you can not import local media files.

This command-line tools aim to solve these problems. You can write your seeds in PHP which gives you unlimited possibilities.

Installation
------------

[](#installation)

You can install WP CLI Seed Command like any other WP-CLI extension

```
wp package install motivast/wp-cli-seed-command

```

If you want to install WP CLI Seed Command locally you can use composer in your project root directory

```
composer require motivast/wp-cli-seed-command

```

Getting started
---------------

[](#getting-started)

WP CLI Seed is providing two commands `wp seed` for seeding database with data and `wp scaffold seeder` to quickly create new seeders. To create the main seeder the following command.

```
wp scaffold seeder seeder

```

This command will create a `Seeder.php` file in the `seeds` directory with the following content.

```
