1
CLI-AUTOMATION
Jonathan Miller edited this page 2026-06-09 16:54:57 +00:00

CLI Tool Reference

Complete reference for all php bin/moko commands (45+ tools).

Quick Start

composer install
php bin/moko list              # Show all commands
php bin/moko health --path .   # Run health check
php bin/moko --help <command>  # Help for specific command

Global Flags

Flag Description
--dry-run Simulate without making changes
--verbose Show detailed output
--org <name> Target Gitea organization (default: MokoConsulting)
--path <dir> Target directory path

Audit

Command Description
audit:query Run audit queries against org repos

Automation

Command Description
automation:cleanup Clean up repo artifacts, stale branches
automation:migrate-gitea Migrate repos to Gitea
sync Bulk sync across all org repos

Build

Command Description
build:joomla Build Joomla extension (lint + validate + ZIP)
build:package Build generic package
build:updates-xml Generate Joomla update server XML
build:updates-xml-sync Sync update XML across repos

Bulk Operations

Command Description
bulk:enrich-manifest Update manifest.xml fields across all repos
bulk:enrich-mokostandards Push MokoStandards config to all repos
bulk:push-files Push specific files to multiple repos
bulk:push-manifest Push manifest.xml template to repos
bulk:push-mokostandards Push .moko-standards to repos
bulk:push-workflow Push CI workflow files to repos
bulk:sync-rulesets Sync branch protection rulesets
bulk:template-joomla Apply Joomla boilerplate to repos
bulk:trigger Trigger workflow runs across repos

Changelog

Command Description
changelog:promote Move [Unreleased] entries to version section
changelog:prune Remove empty changelog sections

Client Management

Command Description
client:health-check Check health of all client WaaS sites
client:inventory List all client repos and status

Deploy

Command Description
deploy:backup Take backup before deployment
deploy:health-check Verify site health after deploy
deploy:joomla Deploy Joomla extension via SFTP
deploy:rollback Rollback a Joomla deployment
deploy:sftp Generic SFTP file push
deploy:sync Sync Joomla files via SFTP

Fix / Auto-remediation

Command Description
fix:line-endings Convert line endings to LF
fix:permissions Fix file permissions (644/755)
fix:tabs Convert tabs to spaces
fix:trailing Remove trailing whitespace

Licensing

Command Description
license Manage SPDX license headers

Maintenance

Command Description
inventory Update org repo inventory
maintenance:inventory Generate repo inventory report
maintenance:labels Set up org-standard labels on repos
maintenance:pin-shas Pin GitHub Action SHAs for security
maintenance:rotate-secrets Rotate API tokens and secrets
maintenance:update-shas Update SHA hashes in workflows

Module Validation

Command Description
validate:module Run all validators on a repo

Monitoring

Command Description
dashboard Show client dashboard summary
grafana Manage Grafana dashboards

Platform

Command Description
manifest:element Get/set Joomla element name
manifest:read Display manifest.xml contents
platform:detect Auto-detect project platform

Shell Completion

php bin/moko completion bash > /etc/bash_completion.d/moko