CLI Commands, Seeding & Troubleshooting
Entries registers 11 commands in processwire-console (php vendor/bin/wire). Every command supports --json for CI pipelines and deployment scripts.
CLI command reference
Section titled “CLI command reference”| Command | Purpose | Example |
|---|---|---|
make:entry |
Scaffold a Single, Collection, Block, Fieldset, or Managed Table blueprint (--class, --sync, --dir) |
php vendor/bin/wire make:entry rates --kind=collection --class |
entries:types |
List blueprints, sync index signatures (--sync), or emit TypeScript .d.ts (--typescript) |
php vendor/bin/wire entries:types --type=rates --json |
entries:reindex |
Rebuild entries_index for one blueprint or all blueprints |
php vendor/bin/wire entries:reindex --type=rates |
entries:clear |
Clear L1/L2 EntryCache and compiled schema caches |
php vendor/bin/wire entries:clear --type=rates |
entries:seed |
Populate starter records declared in blueprints (--mode=skip|upsert|replace) |
php vendor/bin/wire entries:seed --type=rates --mode=upsert |
entries:schedule |
Process due publish_from and publish_until transitions |
php vendor/bin/wire entries:schedule --json |
entries:export |
Export entries, media, and Managed Tables (--without-media, --tables, --include-tables) to json, csv, ics, or zip |
php vendor/bin/wire entries:export backups/entries.zip --format=zip --include-tables |
entries:import |
Import JSON, ZIP, or CSV archives (--mode=skip|upsert|replace, --map, --preview, --without-media) |
php vendor/bin/wire entries:import backups/entries.zip --mode=upsert |
entries:tables:sync |
Preview (--dry-run) or apply additive DDL changes for Managed Tables (--owner=..., --table=...) |
php vendor/bin/wire entries:tables:sync --dry-run --json |
entries:attach-fieldset |
Attach an embedded @fieldset:* or pivot blueprint to a ProcessWire page template (--style, --pivot-blueprint, --label, --selector, --columns, --searchable, --allow-user-template) |
php vendor/bin/wire entries:attach-fieldset --blueprint=seo --template=page --field=seo --dry-run --json |
entries:doctor |
Audit database tables, index parity, orphaned media, and schema drift (--fix --force) |
php vendor/bin/wire entries:doctor --json |
Declarative seeding (EntrySeeder)
Section titled “Declarative seeding (EntrySeeder)”Define starter records directly in YAML or point to an external PHP/YAML seed file:
seed: - code: LOW title: Low Season rate_multiplier: 0.85 - code: HIGH title: High Season rate_multiplier: 1.45 is_peak: trueseed: seeds/ports.phpPlace site/entries/seeds/ports.php returning an array of item arrays, then run:
php vendor/bin/wire entries:seed --type=ports --mode=skip --jsonUse --mode=skip in deployments to insert missing records without overwriting editorial changes, or --mode=upsert to update matching records by unique key.
Streaming export and import (EntryPorter)
Section titled “Streaming export and import (EntryPorter)”Export and import entries, isolated media, multi-language CSV columns (<field>__<langName>), ICS calendar feeds, and Managed Tables directly from PHP without buffering huge datasets in RAM:
<?php
declare(strict_types=1);
namespace ProcessWire;
$entries = $this->wire()->entries;
// Stream JSON, CSV, ICS, or full ZIP backup (including Managed Tables)$entries->exportJsonToFile('backups/entries.json', ['includeTables' => true]);$entries->exportCsvToFile('seasons', 'backups/seasons.csv');$icsCalendar = $entries->exportIcs('events');$entries->exportArchive('backups/full-backup.zip', ['includeTables' => true]);
// Preview and import CSV (honors field ACLs and <field>__<langName> columns)$preview = $entries->previewCsv('seasons', $csvContent);$stats = $entries->importCsv('seasons', $csvContent, ['mode' => 'upsert']);
// Inspect activity log and clear caches$recentEvents = $entries->getActivityLog(limit: 50, type: 'seasons', action: 'saved');$entries->clearCache('seasons');Troubleshooting
Section titled “Troubleshooting”A newly added field returns no matches in $entries->find()
Section titled “A newly added field returns no matches in $entries->find()”- Confirm the field has
index: truein its blueprint file. - Clear cached schemas and rebuild the index:
Terminal window php vendor/bin/wire entries:clear --jsonphp vendor/bin/wire entries:reindex --type=your_blueprint
Scheduled entries are not publishing automatically
Section titled “Scheduled entries are not publishing automatically”Verify that your blueprint includes publishable: true and that your server crontab runs entries:schedule (or ProcessWire’s schedule:run) every minute:
* * * * * cd /path/to/processwire && php vendor/bin/wire entries:schedule >/dev/null 2>&1Non-superuser editors cannot see Setup -> Entries
Section titled “Non-superuser editors cannot see Setup -> Entries”Check Access -> Roles and verify the role has entries-single, entries-collection, or entries-admin, plus any custom permission declared in the blueprint’s permission or permissions: map.
Diagnosing schema drift, orphaned rows, or unreferenced media
Section titled “Diagnosing schema drift, orphaned rows, or unreferenced media”Run the diagnostic report before applying automated fixes:
php vendor/bin/wire entries:doctor --json