Eventonomy

WP-CLI Commands

Eventonomy registers a wp eventonomy command group for managing events, occurrences, RSVPs, and demo data from the command line. All commands go through the service layer - the same path as the REST API and admin UI.

What You Will Learn

  • The full wp eventonomy command surface
  • How to list, create, and delete events from the CLI
  • How to manage occurrences and RSVPs
  • How to seed and unseed demo data
  • How to recompute occurrences manually

Command Groups

Events

# List events (outputs the unified REST envelope)
wp eventonomy events list
wp eventonomy events list --status=pending --format=json

# Create an event
wp eventonomy events create --title="Tech Meetup" --start="2026-08-01 18:00:00" --timezone="America/New_York"

# Delete an event (soft-delete / trash by default)
wp eventonomy events delete 481

# Permanently delete
wp eventonomy events delete 481 --force

Occurrences

# List occurrences for an event
wp eventonomy occurrences list --event=481
wp eventonomy occurrences list --event=481 --format=csv

# Recompute occurrences for one event (or all events if --event is omitted)
wp eventonomy recompute-occurrences --event=481
wp eventonomy recompute-occurrences

RSVPs

# List RSVPs for an event
wp eventonomy rsvps list --event=481
wp eventonomy rsvps list --event=481 --status=going
wp eventonomy rsvps list --event=481 --format=csv

Import

# Import events from a CSV file
wp eventonomy import events.csv

# Dry run - preview what would be imported without writing
wp eventonomy import events.csv --dry-run

Demo Data

# Load ~20 demo events with venues, organizers, and cover images
wp eventonomy seed

# Remove demo data (only rows created by the seeder)
wp eventonomy unseed

Demo data is also available from Eventonomy → Tools → Demo data in wp-admin.

Adding Custom Subcommands

Add commands under the same group by calling WP_CLI::add_command on the cli_init action. Always resolve dependencies via evnm() - the CLI is just another surface adapter, same as REST.

add_action( 'cli_init', function () {
    WP_CLI::add_command( 'eventonomy export', function ( $args, $assoc_args ) {
        $events = evnm( \Eventonomy\Contracts\EventRepositoryInterface::class )
            ->query( [ 'status' => 'published', 'per_page' => 1000 ] );
        WP_CLI\Utils\format_items( 'table', $events['items'], [ 'id', 'title', 'start_local' ] );
    } );
} );

Notes

  • All commands exit with a non-zero code on error.
  • List commands return the unified REST envelope (items, total, etc.) - use --format=json for machine-readable output.
  • Seed/unseed only touches rows created by the DemoSeeder. Your real events are never affected by unseed.

What's Next?

Learn how to implement the Free↔Pro contract and deep-extend Eventonomy.

Extending →