Clone
3
CLI_AUTOMATION
Jonathan Miller edited this page 2026-05-26 03:57:29 +00:00

Back to Home

CLI Tool Reference

45 CLI tools available via php bin/moko <command>. Version 08.00.00.


Version Management

Tool Purpose
version:read Read version from README.md or manifest XML
version:bump Auto-increment patch version
version:propagate Propagate version from README to all files
version:set-platform Set version in Joomla XML or Dolibarr module

Release Pipeline

Tool Purpose
release Automate version branch release flow
release:notes Extract release notes from CHANGELOG.md
release:validate Pre-release validation
release:cascade Delete lesser pre-release channels
release:manage Create/update Gitea releases

Build and Package

Tool Purpose
build:package Build ZIP and tar.gz packages
build:joomla Build Joomla extension ZIP
build:updates-xml Generate Joomla updates.xml

Validation (15 checks)

Tool Purpose
health Full repository health check
check:syntax PHP syntax check
check:version Version consistency
check:changelog CHANGELOG.md format
check:structure Required files and directories
check:headers SPDX license headers
check:secrets Scan for leaked credentials
check:tabs Tab characters in YAML
check:paths Backslash path separators
check:xml XML well-formedness
check:enterprise Enterprise readiness
check:dolibarr Dolibarr module structure
check:joomla Joomla manifest validation
check:language Language file structure
check:client Client WaaS theme validation
check:wiki Wiki health check
detect Auto-detect platform type
drift Scan org for standards drift

Repository Management

Tool Purpose
repo:create Scaffold new governed repository
repo:archive Retire a repository
repo:scaffold-client Scaffold client-waas repo from template
repo:provision End-to-end client provisioning from JSON config

Bulk Operations

Tool Purpose
sync Bulk-sync standards to all repos
bulk:push-workflow Push workflow to all repos
bulk:trigger Trigger workflow across repos
bulk:sync-rulesets Apply branch protection rules

Monitoring and Dashboards

Tool Purpose
dashboard Generate unified client HTML dashboard
grafana Manage Grafana dashboards (push/delete/list/export)
client:inventory List all client-waas repos with status

Platform Detection

Tool Purpose
platform:detect Detect platform from .mokostandards
manifest:read Parse manifest.xml for CI

Code Quality

Tool Level Config
PHPCS PSR-12 (errors only) phpcs.xml
PHPStan Level 6 phpstan.neon + baseline
PHPUnit 19 tests phpunit.xml

Adding New Tools

Extend MokoEnterprise\CliFramework:

class MyTool extends CliFramework {
    protected function configure(): void {
        ->setDescription("What it does");
        ->addArgument("--name", "Description", "default");
    }
    protected function run(): int {
         = ->getArgument("--name");
        return 0;
    }
}
 = new MyTool();
exit(->execute());

Then register in bin/moko COMMAND_MAP.