Skip to content

CLI Commands

UnoPim provides a set of Artisan commands for managing your PIM installation. This page serves as a quick reference for all available commands. For detailed usage of specific commands, refer to their dedicated documentation pages.

System Commands

CommandDescription
php artisan unopim:versionDisplay the current UnoPim version
php artisan unopim:installRun the interactive UnoPim installer
php artisan unopim:publishPublish UnoPim assets and config (use --force to overwrite)
php artisan unopim:user:createCreate a default admin user
php artisan unopim:passport:clientCreate an API OAuth client for REST API authentication
php artisan unopim:images:purge-unusedRemove unused product images from storage

UnoPim Version

bash
php artisan unopim:version

Outputs the currently installed UnoPim version number.

Publish Assets

bash
# Publish assets and config
php artisan unopim:publish

# Force overwrite existing published files
php artisan unopim:publish --force

Use this after updating UnoPim to ensure all assets and configuration files are up to date.

Create Admin User

bash
php artisan unopim:user:create

Interactively creates a new admin user. See Creating a New User for more details.

Create OAuth Client

bash
php artisan unopim:passport:client

Creates an OAuth 2.0 client for API authentication. See API Authentication for more details.

Purge Unused Images

bash
# Preview which images would be removed (dry run)
php artisan unopim:images:purge-unused --dry-run

# Actually remove unused images
php artisan unopim:images:purge-unused

Scans product image storage and removes images that are no longer associated with any product. Always run with --dry-run first to review what will be deleted.


Elasticsearch Indexing

CommandDescription
php artisan unopim:product:indexRe-index all products in Elasticsearch
php artisan unopim:category:indexRe-index all categories in Elasticsearch
php artisan unopim:elastic:clearClear all Elasticsearch indices

For full Elasticsearch setup and configuration, see Elasticsearch Configuration.


Completeness

CommandDescription
php artisan unopim:completeness:recalculate --allRecalculate completeness for all products
php artisan unopim:completeness:recalculate --family=IDRecalculate for a specific attribute family
php artisan unopim:completeness:recalculate --product=IDRecalculate for a single product
php artisan unopim:completeness:recalculate --products=1 --products=2Recalculate for specific product IDs

For more details, see Queue Management — Completeness.


Dashboard

CommandDescription
php artisan unopim:dashboard:refreshClear dashboard statistics cache so the next page load shows fresh data

Data Transfer

CommandDescription
php artisan unopim:queue:work <job_id> <user_email>Process a specific queued import/export job

For queue worker setup, scheduling, and job management, see Queue Management.


Queue Worker

Start a queue worker to process background jobs (imports, exports, completeness calculations, notifications):

bash
php artisan queue:work --queue="default,system,completeness" --sleep=3 --tries=3

For production environments, use Supervisor to keep the worker running. See Configuring Supervisor.


Cron Setup

UnoPim requires a single cron entry to run the Laravel scheduler:

bash
crontab -e

Add this line (replace /path/to/unopim with your actual installation path):

bash
* * * * * cd /path/to/unopim && php artisan schedule:run >> /dev/null 2>&1

The scheduler automatically runs the following tasks:

TaskScheduleDescription
unopim:product:indexDaily at 00:01 & 12:01Elasticsearch product re-indexing
unopim:category:indexDaily at 00:01 & 12:01Elasticsearch category re-indexing
unopim:completeness:recalculate --allDaily at 02:00Recalculate product completeness scores
unopim:dashboard:refreshEvery 10 minutesRefresh dashboard statistics cache

For more details on scheduling and cron jobs, see Queue Management — Scheduled Tasks.

Released under the MIT License.