Order Daemon for WooCommerce provides a comprehensive command-line interface designed for developers, system administrators, and WooCommerce agencies. The CLI offers powerful tools for configuration management, audit log analysis, rule management, health monitoring, and system maintenance.
Key Features
- Configuration Management: Export, import, and synchronize site configurations across multiple WooCommerce sites
- Audit Log Analysis: Advanced filtering, export, and maintenance of audit logs
- Rule Management: Professional rule management with interactive workflows and safety features
- Health Monitoring: Comprehensive system diagnostics and performance monitoring
- Enterprise Safety: Dry-run modes, interactive confirmations, and CI/CD automation support
Prerequisites
- WP-CLI installed and working: Verify with
wp --info - Order Daemon Pro active: Core plugin does not register CLI commands
- WooCommerce active: Required for most operations
- Appropriate permissions: Run
wpas the site’s PHP user - Premium license: Advanced features require valid Pro license
Important: Pro Plugin Required
CLI commands are only available in the Order Daemon Pro add-on. The core plugin does not register any CLI commands.
Verify CLI availability:
wp odcm --help
Check available command groups:
wp help odcm
Available Commands
Order Daemon Pro provides professional-grade CLI tools organized into main command groups:
Configuration Management (wp odcm config)
Professional configuration management for WooCommerce agencies managing multiple sites.
wp odcm config export
Export site configuration to file for backup, synchronization, or templating.
Signature:
wp odcm config export [--output=<file>] [--format=<format>] [--components=<components>] [--exclude-sensitive] [--include-meta]
Options:
--output=<file>– Output file path (default:odcm-config.json)--format=<format>– Output format:json,yaml(default:json)--components=<components>– Components:all,rules,options,filters(default:all)--exclude-sensitive– Exclude sensitive data like API keys--include-meta– Include metadata about export source (default:true)
Examples:
# Basic export - exports entire configuration
wp odcm config export
# Export only rules to YAML format
wp odcm config export --components=rules --format=yaml --output=rules.yaml
# Create client template without sensitive data
wp odcm config export --exclude-sensitive --output=client-template.json
# Export specific components
wp odcm config export --components=options,filters --output=settings.json
Sample Output:
=== 📋 CONFIGURATION EXPORT ===
🔄 Exporting configuration...
Success: ✅ Configuration exported to odcm-config.json
📊 Export summary:
Rules: 5
Options: 12
Filters: 8
Size: 15.2 KB
wp odcm config diff
Compare configurations between current site and local file to identify differences.
Signature:
wp odcm config diff --local=<file> [--components=<components>] [--format=<format>] [--show-values]
Options:
--local=<file>– Local configuration file to compare--components=<components>– Components to compare:all,rules,options,filters(default:all)--format=<format>– Output format:table,json(default:table)--show-values– Show actual values in differences
Examples:
# Compare current config with backup
wp odcm config diff --local=backup.json
# Compare specific components with values
wp odcm config diff --local=template.json --components=rules --show-values
Coming Soon
wp odcm config import– Import configuration from file (Phase 1 Week 2)wp odcm config sync– Synchronize configurations between sites (Phase 4)
Rule Management (wp odcm rule)
Professional completion rule management with rich visual formatting, interactive workflows, and enterprise-grade safety features.
wp odcm rule list
Display completion rules with professional formatting, intelligent filtering, and performance insights.
Signature:
wp odcm rule list [--format=<format>] [--status=<status>]
Options:
--format=<format>– Output format:table,json,csv,yaml(default:table)--status=<status>– Filter by status:all,active,inactive(default:all)
Rich Visual Features:
- ✅ Visual status indicators for active rules
- ⏸️ Visual status indicators for inactive rules
- Professional section headers and summaries
- Performance warnings and optimization tips
- Smart empty state guidance
Examples:
# List all rules with rich formatting
wp odcm rule list
# Filter by rule status
wp odcm rule list --status=active
wp odcm rule list --status=inactive
# Export for integration and analysis
wp odcm rule list --format=json > rules.json
wp odcm rule list --status=active --format=yaml > active-rules.yaml
Sample Output:
=== 📋 Order Completion Rules ===
🔄 Loading completion rules...
Found 3 rules (2 active, 1 inactive)
+----+-------------------------+---------------+----------+
| id | title | status | priority |
+----+-------------------------+---------------+----------+
| 15 | Complete Digital Orders | ✅ Active | 1 |
| 16 | VIP Customer Rules | ✅ Active | 2 |
| 17 | Test Rule | ⏸️ Inactive | 3 |
+----+-------------------------+---------------+----------+
💡 Quick Actions:
Activate: wp odcm rule activate <rule_id>
Deactivate: wp odcm rule deactivate <rule_id>
wp odcm rule activate
Activate a completion rule with enterprise-grade safety features.
Signature:
wp odcm rule activate <rule_id> [--dry-run] [--yes]
Arguments:
<rule_id>– The ID of the rule to activate
Options:
--dry-run– Preview the action without making changes--yes– Skip confirmation prompt (automation friendly)
Safety Features:
- Interactive confirmation prompts with rule details
- Dry-run mode to preview changes safely
- Comprehensive error handling with helpful suggestions
- Professional status reporting with visual indicators
Examples:
# Interactive activation with confirmation
wp odcm rule activate 123
# Automated activation for deployment scripts
wp odcm rule activate 123 --yes
# Preview activation without making changes
wp odcm rule activate 123 --dry-run
wp odcm rule deactivate
Deactivate a completion rule with safety warnings and impact explanations.
Signature:
wp odcm rule deactivate <rule_id> [--dry-run] [--yes]
Arguments:
<rule_id>– The ID of the rule to deactivate
Options:
--dry-run– Preview the action without making changes--yes– Skip confirmation prompt (automation friendly)
Examples:
# Interactive deactivation with safety warning
wp odcm rule deactivate 456
# Automated deactivation for maintenance
wp odcm rule deactivate 456 --yes
# Preview deactivation impact
wp odcm rule deactivate 456 --dry-run
Health Monitoring (wp odcm health)
Comprehensive system health monitoring and diagnostics with professional reporting.
wp odcm health check
Run comprehensive health checks on the Order Daemon system.
Signature:
wp odcm health check [--format=<format>] [--component=<component>] [--fix] [--exit-code]
Options:
--format=<format>– Output format:dashboard,table,json,yaml(default:dashboard)--component=<component>– Check specific component:all,core,database,rules,performance(default:all)--fix– Attempt to fix detected issues--exit-code– Exit with non-zero code if issues found (CI/CD friendly)
Examples:
# Run full health check with dashboard
wp odcm health check
# Check specific component
wp odcm health check --component=database
# CI/CD health check with fixes
wp odcm health check --fix --exit-code --format=json
wp odcm health status
Quick health status overview.
Examples:
# Quick status check
wp odcm health status
# Status in JSON format
wp odcm health status --format=json
Audit Log Management (wp odcm log)
Comprehensive audit log analysis and maintenance tools with advanced filtering capabilities.
wp odcm log list
Display audit log entries with advanced filtering and professional formatting.
Signature:
wp odcm log list [--limit=<number>] [--offset=<number>] [--order-id=<id>] [--status=<status>] [--since=<date>] [--format=<format>] [--advanced-filters]
Basic Options:
--limit=<number>– Maximum entries to display (default:20)--offset=<number>– Number of entries to skip (default:0)--order-id=<id>– Filter by WooCommerce order ID--format=<format>– Output format:table,json,csv,yaml(default:table)
Advanced Options (Premium):
--status=<status>– Filter by status:success,error,warning,info, etc.--since=<date>– Show logs after date (YYYY-MM-DD or relative like “24 hours ago”)--advanced-filters– Enable premium filtering features
Examples:
# View recent log entries
wp odcm log list --limit=10
# Monitor specific order processing
wp odcm log list --order-id=12345
# Check for errors (Premium)
wp odcm log list --status=error --since="24 hours ago" --advanced-filters
# Export logs for analysis
wp odcm log export --status=error --format=csv --output=errors.csv
wp odcm log export
Export log entries for analysis or backup.
wp odcm log clear
Remove old log entries to manage database size.
Debug Commands (wp odcm debug)
Advanced debugging and testing utilities for troubleshooting rule evaluation and system performance.
Available Commands:
wp odcm debug why_not– Analyze why rules didn’t trigger for specific orderswp odcm debug evaluate– Test rule evaluation against orderswp odcm debug performance– Performance analysis and optimization
Full debug command documentation coming in Phase 6-7.
Practical Workflows
Development & Testing
Safe Rule Development Workflow:
# 1. List current rules and their status
wp odcm rule list
# 2. Preview rule activation safely
wp odcm rule activate 123 --dry-run
# 3. Activate rule for testing
wp odcm rule activate 123
# 4. Monitor system health
wp odcm health check --component=performance
# 5. Monitor rule performance with logs
wp odcm log list --limit=10 --since="5 minutes ago"
# 6. Deactivate if issues detected
wp odcm rule deactivate 123 --yes
Deployment & Automation
Production Deployment Script:
#!/bin/bash
# Safe production deployment
echo "🚀 Starting deployment..."
# Health check before deployment
wp odcm health check --exit-code || exit 1
# Preview all rule changes
wp odcm rule activate 123 --dry-run
wp odcm rule activate 456 --dry-run
# Apply changes automatically
wp odcm rule activate 123 --yes
wp odcm rule activate 456 --yes
# Verify deployment health
wp odcm health check --component=rules --exit-code
# Export post-deployment configuration
wp odcm config export --output="deployment-$(date +%Y%m%d).json"
echo "✅ Deployment completed successfully"
Monitoring & Maintenance
System Monitoring Script:
#!/bin/bash
# Daily monitoring routine
# Health check
wp odcm health check --format=json > /var/log/odcm-health.json
# Rule performance check
ACTIVE_COUNT=$(wp odcm rule list --status=active --format=count)
if [ "$ACTIVE_COUNT" -gt 5 ]; then
echo "⚠️ Performance warning: $ACTIVE_COUNT active rules"
wp odcm rule list --status=active
fi
# Check for recent errors
ERROR_COUNT=$(wp odcm log list --status=error --since="24 hours ago" --format=count --advanced-filters)
if [ "$ERROR_COUNT" -gt 0 ]; then
echo "Found $ERROR_COUNT errors in last 24 hours"
wp odcm log export --status=error --since="24 hours ago" --output="/var/log/errors-$(date +%Y%m%d).json"
fi
# Weekly log cleanup
if [ "$(date +%u)" -eq 7 ]; then
wp odcm log clear --before="90 days ago" --yes
fi
Configuration Management
Multi-Site Configuration Workflow:
# Export template from staging site
wp odcm config export --exclude-sensitive --output=site-template.json
# Deploy to production sites
for site in site1.com site2.com site3.com; do
echo "Deploying to $site..."
# Transfer template and import (when import is available)
scp site-template.json $site:/tmp/
ssh $site "cd /var/www/html && wp odcm config import /tmp/site-template.json --dry-run"
done
Best Practices
Automation & Scripting
CI/CD Integration:
# Always use --format=json for machine-readable output
wp odcm health check --format=json --exit-code
# Use --yes flag to skip interactive prompts
wp odcm rule activate 123 --yes
# Preview changes before applying in critical environments
wp odcm rule activate 123 --dry-run
Error Handling:
# Check exit codes for automation
if ! wp odcm health check --exit-code; then
echo "Health check failed, aborting deployment"
exit 1
fi
Security Considerations
- Capability Checks: All commands respect WordPress capability requirements
- License Validation: Premium features check license status before execution
- Safe Operations: Dry-run modes prevent accidental changes
- Audit Trail: All operations logged for security auditing
Performance Optimization
- Use specific filters: Reduce dataset size with targeted filtering
- Batch operations: Use pagination for large datasets
- Regular maintenance: Implement log cleanup routines
- Monitor actively: Set up automated health checks
Troubleshooting
Common Issues
Command not found:
# Verify Pro plugin is active
wp plugin list --status=active | grep order-daemon
# Check CLI registration
wp help odcm
Permission errors:
# Check file ownership
ls -la /var/www/html/wp-content/plugins/order-daemon-pro/
# Run with appropriate user
sudo -u www-data wp odcm rule list
Premium license issues:
# Check license status
wp option get odcm_license_status
# Verify capability access
wp eval "echo odcm_can_use('audit_log_filter_advanced') ? 'Enabled' : 'Disabled';"
WordPress notices in output:
- All Action Scheduler conflicts have been resolved
- Commands should produce clean professional output
- If notices appear, report as a bug
Need Help?
Get command help:
# General help
wp help odcm
# Specific command help
wp help odcm rule list
# Available options
wp odcm rule list --help
Debug information:
# WordPress environment
wp --info
# Plugin status
wp plugin status order-daemon-pro
# System health
wp odcm health check

